Bug #915

NeL fails to build with --as-needed

Added by AllenJB about 9 years ago. Updated over 8 years ago.

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.

nel-9999_20100518-154641.log - Full build log (76.4 kB) AllenJB, 05/18/2010 07:24 pm

nel-9999_20100518-154641.environment.log - Build environment (112.3 kB) AllenJB, 05/18/2010 07:24 pm

nel-9999_emerge.info - "emerge --info" (build environment) (4.7 kB) AllenJB, 05/18/2010 07:24 pm

History

#1 Updated by kervala almost 9 years ago

Do you know why --as-needed disable -lrt ?

Edit: Please could you retry with last Mercurial version ?

#2 Updated by kervala almost 9 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 9 years ago

I succeeded too on Debian.

#4 Updated by kervala almost 9 years ago

I got this same error while using -Wl,--as-needed, I'm looking for a workaround.

#5 Updated by kervala almost 9 years ago

  • Status changed from New to Validated

#6 Updated by kervala almost 9 years ago

It seems like adding : -Wl,--no-as-needed before -lrt fix this

#7 Updated by kervala over 8 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 over 8 years ago

  • % Done changed from 0 to 100

#9 Updated by kervala over 8 years ago

AllenJB> please could you check again if you still have this error ? Thanks.

#10 Updated by kervala over 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF