riscv-perf-model
riscv-perf-model copied to clipboard
Cannot compile with Profile build type
I'm trying to compile with CMAKE_BUILD_TYPE=Profile but I'm getting the following error:
/home/dan/anaconda3/envs/sparta/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/dan/anaconda3/envs/sparta/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib/gcrt1.o: relocation R_X86_64_32S against symbol `__libc_csu_fini' can not be used when making a PIE object; recompile with -fPIE
/home/dan/anaconda3/envs/sparta/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: failed to set dynamic section sizes: bad value
Has anyone else encountered this?
I don't have that issue, but a different one. Specifically stf is built with LTO while the linking stage doesn't accept it. Got a flag mismatch.
Have you tried with clang?
Same error as this?
/home/dan/anaconda3/envs/riscv_perf_model/bin/../lib/gcc/x86_64-conda-linux-gnu/10.4.0/../../../../x86_64-conda-linux-gnu/bin/ld: stf_lib/lib/libstf.a: error adding symbols: file format not recognized
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/olympia.dir/build.make:131: olympia] Error 1
make[1]: *** [CMakeFiles/Makefile2:360: CMakeFiles/olympia.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Managed to fix it by moving the setup_stf_linker out of the Release build only
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bee99e2..4fc4298 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,9 +38,10 @@ set (DISABLE_STF_DOXYGEN ON)
if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
set (FULL_LTO true)
- include(${STF_LIB_BASE}/cmake/stf_linker_setup.cmake)
- setup_stf_linker(false)
endif()
+include(${STF_LIB_BASE}/cmake/stf_linker_setup.cmake)
+setup_stf_linker(false)
+
# Use ccache if installed
find_program (CCACHE_PROGRAM ccache)
Will create PR
Yep. That’s the one. Thanks for debugging On Mar 5, 2024, at 4:42 PM, danbone @.***> wrote: Managed to fix it by moving the setup_stf_linker out of the Release build only diff --git a/CMakeLists.txt b/CMakeLists.txt index bee99e2..4fc4298 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,9 +38,10 @@ set (DISABLE_STF_DOXYGEN ON)
if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease") set (FULL_LTO true)
- include(${STF_LIB_BASE}/cmake/stf_linker_setup.cmake)
- setup_stf_linker(false) endif() +include(${STF_LIB_BASE}/cmake/stf_linker_setup.cmake) +setup_stf_linker(false)
Use ccache if installed
find_program (CCACHE_PROGRAM ccache)
Will create PR
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
@danbone Can I take up this issue?
Unless Dan disagrees, feel free to take it. I just reproduced the original issue.
@klingaard didn't this get fixed by https://github.com/riscv-software-src/riscv-perf-model/commit/9d9a345060039594b2782520e743ab5ec2a613d3
@danbone Can I take up this issue? If you allow me to do so.. I think in this issue we are supposed to work on "-fPIE" error during compilation, with "CMAKE_BUILD_TYPE=Profile" in conda environment. It will be solved by adjusting compiler flags for PIE compatiability. I am interested to work on this
Yes, absolutely fine by me