Bug #915
NeL fails to build with --as-needed
Status: | Closed | Start date: | 05/18/2010 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | kervala | % Done: | 100% |
|
Category: | Build | |||
Target version: | Version 0.8.0 |
Description
Building NeL with cmake fails when using --as-needed:
Scanning dependencies of target nl_sample_command [ 51%] Building CXX object samples/misc/command/CMakeFiles/nl_sample_command.dir/main.cpp.o [ 51%] Building CXX object src/3d/CMakeFiles/nel3d.dir/mesh_multi_lod.cpp.o Linking CXX executable ../../../bin/nl_sample_command ../../../lib/libnelmisc.so.0.7.0: undefined reference to `clock_getres' ../../../lib/libnelmisc.so.0.7.0: undefined reference to `clock_gettime' collect2: ld returned 1 exit status make[2]: *** [bin/nl_sample_command] Error 1 make[1]: *** [samples/misc/command/CMakeFiles/nl_sample_command.dir/all] Error 2
Disabling --as-needed resolves this issue and NeL builds successfully.
History
#1 Updated by kervala almost 5 years ago
Do you know why --as-needed disable -lrt ?
Edit: Please could you retry with last Mercurial version ?
#2 Updated by kervala almost 5 years ago
I succeeded to compile NeL with --as-needed, nl_sample_command is linked successfully with -lrt and is working fine.
Do you still have this problem ?
#3 Updated by molator almost 5 years ago
I succeeded too on Debian.
#4 Updated by kervala almost 5 years ago
I got this same error while using -Wl,--as-needed, I'm looking for a workaround.
#5 Updated by kervala almost 5 years ago
- Status changed from New to Validated
#6 Updated by kervala almost 5 years ago
It seems like adding : -Wl,--no-as-needed
before -lrt
fix this
#7 Updated by kervala almost 5 years ago
- Status changed from Validated to Resolved
- Assignee set to kervala
- Target version set to Version 0.8.0
Seems like that's working better now :)
Please could you try again ?
We added : --as-needed and --no-undefined by default for Linux
#8 Updated by kervala almost 5 years ago
- % Done changed from 0 to 100
#9 Updated by kervala almost 5 years ago
AllenJB> please could you check again if you still have this error ? Thanks.
#10 Updated by kervala almost 5 years ago
- Status changed from Resolved to Closed