-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue]: linker/cxx flags issues #210
Comments
1) When `clang` is used as system compiler, libraries were built without respecting LDFLAGS. For example, this affected LTO flags, if any (and it only affected clang, not gcc). 2) Linker flags are registered as CXX flags, which produces warnings during compilation: ``` clang++: warning: -Wl,-z,noexecstack: 'linker' input unused [-Wunused-command-line-argument] clang++: warning: -Wl,-znoexecheap: 'linker' input unused [-Wunused-command-line-argument] clang++: warning: -Wl,-z,relro: 'linker' input unused [-Wunused-command-line-argument] clang++: warning: -Wl,-z,now: 'linker' input unused [-Wunused-command-line-argument] ``` 3) Clang does not support `-Wtrampolines` flag: ``` warning: unknown warning option '-Wtrampolines' [-Wunknown-warning-option] ``` 4) No linkers support `noexecheap` anymore. `noexecheap` linker flag was a part of PaX patches to GNU ld, (which were dropped in 2017)[https://www.gentoo.org/support/news-items/2017-08-19-hardened-sources-removal.html]. Now ld/ld.lld/ld.gold don't support it and protection of heap is managed by NX bit. Therefore every compiler produces this warning: ``` ld.lld: warning: unknown -z value: noexecheap ``` Closes ROCm#210.
The Issues: Sometimes the build system (like CMake or Make) doesn't pass LDFLAGS correctly. You can manually set them before building: It seems linker flags like -znoexecheap are being treated as compiler flags (CXXFLAGS), which causes warnings. The flags -Wtrampolines and -znoexecheap are no longer needed and cause warnings. If you're still facing these issues, make sure you're using the latest version of the ROCm libraries. Sometimes these problems get fixed in newer versions. |
Problem Description
Hi,
There are multiple non-critical, but annoying issues when building from source:
When
clang
is used as system compiler, libraries were built without respecting LDFLAGS. For example, this affected LTO flags, if any (and it only affected clang, not gcc).Linker flags are registered as CXX flags, which produces warnings during compilation:
-Wtrampolines
flag:noexecheap
anymore. This was mentioned in Unknown linker flag 'noexecheap' for ld.gold #87 which was closed, but the issue is still active.noexecheap
linker flag was a part of PaX patches to GNU ld, (which were dropped in 2017)[https://www.gentoo.org/support/news-items/2017-08-19-hardened-sources-removal.html]. Now ld/ld.lld/ld.gold don't support it and protection of heap is managed by NX bit. Therefore every compiler produces this warning:Please see linked pull request which fixes these problems.
Operating System
Gentoo
CPU
GPU
ROCm Version
ROCm 6.3.0
ROCm Component
rocm_smi_lib
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: