Closed emollier closed 7 months ago
I managed to go past this issue with the following change, as it seems the -fPIE option landing late in the compiler command line was erasing the behavior of -fPIC:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,7 +103,7 @@ else ()
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wl,-z,noexecstack -Wl,-znoexecheap -Wl,-z,relro ")
set(CMAKE_CXX_FLAGS
- "${CMAKE_CXX_FLAGS} -Wtrampolines -Wl,-z,now -fPIE")
+ "${CMAKE_CXX_FLAGS} -Wtrampolines -Wl,-z,now")
endif ()
# Use this instead of above for 32 bit
Additionally, this change fixed a build failure on PA-RISC; see Debian bug #1030876. Please don't hesitate to let me know if this change is of interest, so I prepare a proper merge request, or if in the contrary this is causing other problems.
Fixed as of c4c19e7
Greetings,
for information, the Debian project is investigating the use of link time optimization at large scale, and Matthias Klose noticed in Debian Bug #1015653 that the rocm-smi-lib was failing to link with the following error:
You can refer to a more complete log in the Debian bug tracker. Note that the build occurred with -fPIC enabled, so the message is probably a red herring. I'm not sure what to make of this error. It may be nothing, or maybe it could be symptomatic of something else, I don't know. In doubt, I thought you might be interested to be aware of the issue.
In the meantime, I can simply make sure no attempt will be made to build rocm-smi-lib with link time optimization enabled in Debian. This shouldn't be too harmful, I don't believe it's in the rocm-smi-lib that performances are the most critical.
Have a nice day :) Étienne.