Skip to content

Trying to compile duplicate symbols crashes Julia REPL #169

Open
@minecraft2048

Description

This is on Julia 1.10, Arch Linux and StaticCompiler v0.7.2:

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0 (2023-12-25)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using StaticCompiler

julia> using StaticTools

julia> struct hello_struct
           a::Int
           b::Int
       end

julia> function my_add(a,b)
           return a+b
       end
my_add (generic function with 1 method)

julia> function my_add(s::hello_struct)
           return s.a + s.b
       end
my_add (generic function with 2 methods)

julia> StaticCompiler.generate_obj(((my_add, (Int,Int)),(my_add, (hello_struct,))), "test")
error: Linking globals named 'my_add': symbol multiply defined!

byakuya@ifrit-hpc /r/m/b/1/s/julia-gnuradio-interop [1]> 

It makes sense for generate_obj to fail to generate object code with duplicate symbols (ideally we implement Itanium ABI name mangling though, #162), but it shouldn't crash the whole Julia REPL

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions