Comment 3 for bug 918570

Revision history for this message
Tuomo Tanskanen (tuomotanskanen) wrote : Re: unable to build tests with gcc 4.6

I'm a bit out of my comfort zone here, but little digging suggests it has something to do with --as-needed of ld/binutils, not gcc 4.6. For Ubuntu default seems different than in e.g. SUSE. Sorry for confusion.

Demonstration of failure here in openSUSE build system:
https://build.opensuse.org/package/live_build_log?arch=i586&package=upstart&project=home%3Atuomotanskanen&repository=openSUSE_12.1_standard_x86_64_i586

---clip---
make check-am
make[2]: Entering directory `/home/abuild/rpmbuild/BUILD/upstart-1.4/init'
make test_system test_environ test_process test_job_class test_job_process test_job test_log test_event test_event_operator test_blocked test_parse_job test_parse_conf test_conf test_control
make[3]: Entering directory `/home/abuild/rpmbuild/BUILD/upstart-1.4/init'
  CC test_system.o
  CCLD test_system
  CC test_environ.o
  CCLD test_environ
  CC test_process.o
  CCLD test_process
/usr/lib/gcc/i586-suse-linux/4.6/../../../../i586-suse-linux/bin/ld: job_process.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.2'
/usr/lib/gcc/i586-suse-linux/4.6/../../../../i586-suse-linux/bin/ld: note: 'clock_gettime@@GLIBC_2.2' is defined in DSO /lib/librt.so.1 so try adding it to the linker command line
/lib/librt.so.1: could not read symbols: Invalid operation

To me, it only makes sense Upstart should explicitly list the required libraries for the linker.