[hexagon] Remove aliases w/o leading __#682
Conversation
These hexagon builtins incorrectly created aliases in the global namespace which can (and in at least one case, did) conflict with symbols defined by other programs. This should address the issue reported as rust-lang/rust#129823: Compiling compiler_builtins v0.1.123 Compiling core v0.0.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core) Compiling rustc-std-workspace-core v1.99.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core) Compiling byteorder v1.5.0 Compiling zerocopy v0.7.34 error: symbol 'fma' is already defined error: could not compile `compiler_builtins` (lib) due to 1 previous error Also: some of the symbols defined were not just aliases, so those are now qualified with `__hexagon_`. The compiler does not yet emit calls to these particular ones, but if/when it does, it can use the new names.
|
Does changing the symbols from Fyi we get pinged on new PRs already, just need to allow some time for reviews (this PR has only been open 8 hours). |
|
It would, but it was an error to define them that way at all - I don't believe we ever had calls to the unqualified symbols. Probably just an artifact from how it was originally written and tested.
I don't think there is any.
Ok, my mistake. I'm not in any hurry to get this merged, just wanted to avoid it falling through the cracks. Good to know it wouldn't have. |
tgross35
left a comment
There was a problem hiding this comment.
Makes sense. Thanks for confirming!
|
This change will be in 0.1.124, you can put up a PR to rust-lang/rust to update compiler-builtins after #683 merges. |
Ok - will, do. Thanks! |
This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685
…ins, r=tgross35 Update compiler-builtins to 0.1.125 This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685 Fixes: rust-lang#129823
…s, r=<try> Update compiler-builtins to 0.1.125 This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685 try-job: aarch64-apple try-job: aarch64-gnu try-job: armhf-gnu try-job: test-various
…ins, r=tgross35 Update compiler-builtins to 0.1.125 This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685
…s, r=tgross35 Update compiler-builtins to 0.1.125 This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685
…ss35 Update compiler-builtins to 0.1.125 This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685
…ss35 Update compiler-builtins to 0.1.125 This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685
This commit updates the compiler-builtins crate from 0.1.123 to 0.1.125. The changes in this update are: * rust-lang/compiler-builtins#682 * rust-lang/compiler-builtins#678 * rust-lang/compiler-builtins#685
The `fma:` label in dffma.s was being exported as a global symbol causing a "symbol 'fma' is already defined" error when linking with libm's `fma` function. Unfortunately rust-lang#682 removed `.global fma` but didn't address the implicit global export of the label itself. --- old.txt 2026-01-30 20:31:37.265844316 -0600 +++ new.txt 2026-01-30 20:31:46.531950264 -0600 @@ -1,4 +1,3 @@ -00000000 t fma 00000000 T __hexagon_fmadf4 00000000 T __hexagon_fmadf5 00000000 T __qdsp_fmadf5
The `fma:` label in dffma.s was being exported as a global symbol causing a "symbol 'fma' is already defined" error when linking with libm's `fma` function. Unfortunately rust-lang#682 removed `.global fma` but didn't address the implicit global export of the label itself. --- old.txt 2026-01-30 20:31:37.265844316 -0600 +++ new.txt 2026-01-30 20:31:46.531950264 -0600 @@ -1,4 +1,3 @@ -00000000 t fma 00000000 T __hexagon_fmadf4 00000000 T __hexagon_fmadf5 00000000 T __qdsp_fmadf5
The `fma:` label in dffma.s was being exported as a global symbol causing a "symbol 'fma' is already defined" error when linking with libm's `fma` function. Unfortunately rust-lang#682 removed `.global fma` but didn't address the implicit global export of the label itself. --- old.txt 2026-01-30 20:31:37.265844316 -0600 +++ new.txt 2026-01-30 20:31:46.531950264 -0600 @@ -1,4 +1,3 @@ -00000000 t fma 00000000 T __hexagon_fmadf4 00000000 T __hexagon_fmadf5 00000000 T __qdsp_fmadf5
The `fma:` label in dffma.s was being exported as a global symbol causing a "symbol 'fma' is already defined" error when linking with libm's `fma` function. Unfortunately #682 removed `.global fma` but didn't address the implicit global export of the label itself. --- old.txt 2026-01-30 20:31:37.265844316 -0600 +++ new.txt 2026-01-30 20:31:46.531950264 -0600 @@ -1,4 +1,3 @@ -00000000 t fma 00000000 T __hexagon_fmadf4 00000000 T __hexagon_fmadf5 00000000 T __qdsp_fmadf5
[hexagon] Remove aliases w/o leading __
The `fma:` label in dffma.s was being exported as a global symbol causing a "symbol 'fma' is already defined" error when linking with libm's `fma` function. Unfortunately rust-lang/compiler-builtins#682 removed `.global fma` but didn't address the implicit global export of the label itself. --- old.txt 2026-01-30 20:31:37.265844316 -0600 +++ new.txt 2026-01-30 20:31:46.531950264 -0600 @@ -1,4 +1,3 @@ -00000000 t fma 00000000 T __hexagon_fmadf4 00000000 T __hexagon_fmadf5 00000000 T __qdsp_fmadf5
These hexagon builtins incorrectly created aliases in the global namespace which can (and in at least one case, did) conflict with symbols defined by other programs.
This should address the issue reported as rust-lang/rust#129823:
Also: some of the symbols defined were not just aliases, so those are now qualified with
__hexagon_. The compiler does not yet emit calls to these particular ones, but if/when it does, it can use the new names.