Conversation
8f20dfa to
89119a7
Compare
e1f0442 to
3fa94b1
Compare
|
Grabbing this to cmakefy this a little bit more. |
This uses the cmake internal find_program that will utilize the PATH at configuration time. This way we don't need to pass CXXFLAGS to clang.
|
@springmeyer I moved some of this logic to cmake to make it work consistent with the gcc binutils. Otherwise this looks good to me. 👍 |
|
@TheMarex great, thanks for the cmake help! I think before merging this we should test node-osrm against it. My hope is that the |
|
confirmed that node-osrm master is working against this branch and the build flags show |
|
@springmeyer 🙇 thanks for you help. Merging. |
…clang check_cxx_compiler_flag(-flto) doesn't work properly on clang and always produces a negative result, see Project-OSRM/osrm-backend#2120 for details proposed in Project-OSRM/osrm-backend#3377 solution (use -Wl,-flto instead of -flto) seems to always produce positive result, even in toolchains without lto support, which leads to false positive checks and fails during build there seems to be some "dirty" workaround (usins try_compile / try_run / check_c_source_compiles) but because clang builds are low priority and don't really need lto, for now just explicitely disable lto support for them
Issue
Targeting #2120.
The gcc -flto support works currently by:
osrm-backend/CMakeLists.txt
Lines 221 to 223 in ef087f9
lto-wrapperfor linkingFor clang++ and -flto to work we need to:
-fltoflag in both compile flags and link flags manually (since no equivalentlto-wrapperexists for linking with clang++)llvm-arandllvm-ranlibThis PR builds i into the CMakeLists.txt and ii + iii into the
.travis.yml.This PR also:
-fltoand related flags to the pkg config file. Without this the example.cpp will not link because it is not compiled with-fltoand the lto-enabledlibosrm.acannot be used.Tasklist