Issue 132055
Summary Code that uses a libcall marks internal symbol as exported when making object file
Labels new issue
Assignees
Reporter gbaraldi
    This is showing up as https://github.com/JuliaLang/julia/pull/57658#issuecomment-2727385403 which is holding up julia being able to compile with LLVM20.

The issue is that a defining a libcall in a module and then having it be used is making the libcall symbol become external
```llvm
source_filename = "text"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.14.0-macho"

declare i16 @julia_float_to_half(float)

define internal i16 @__truncsfhf2(float %0) {
  %2 = call i16 @julia_float_to_half(float %0)
  ret i16 %2
}

define hidden swiftcc half @julia_fp(float %0) {
  %2 = fptrunc float %0 to half
  ret half %2
}

@llvm.compiler.used = appending global [1 x ptr] [ptr @__truncsfhf2], section "llvm.metadata"
```

```
0000000000000000 T ___truncsfhf2
                 U _julia_float_to_half
0000000000000010 T _julia_fp
usr/lib/julia on  debug-llvm-20 [?] 
❯ llc lala.ll -filetype=obj -o llvm19.o
usr/lib/julia on  debug-llvm-20 [?] 
❯ nm llvm19.o
0000000000000000 t ___truncsfhf2
                 U _julia_float_to_half
0000000000000010 T _julia_fp
```
Not sure if this is an intentional change or not but it's between LLVM 19 and 20
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to