In a mixed computing environment, it’s sometimes useful to have heterogeneous machines use the same library collection. For example, when running on a cluster (e.g., managed by condor), software should run regardless of the underlying operating system distribution. My environment required glibc (version 2.15); it took a bit of fiddling to get it to work, so hopefully this will save you some time.
configure errors
1 |
checking for -z relro option... no<br />configure: error: linker with -z relro support required |
Solution: install gawk. Problem was due to incorrect parsing of the output rather than lack of support.
make errors
Executive summary: run make -j8 CFLAGS=”-U_FORTIFY_SOURCE -O2 -fno-stack-protector”
1 |
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:<br />../misc/syslog.c: In function ‘__vsyslog_chk’:<br />../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available<br />../misc/syslog.c:155:9: sorry, unimplemented: called from here |
Solution: add -U_FORTIFY_SOURCE to CFLAGS. Note that -O2 is also required in CFLAGS.
1 |
./src/glibc-2.15/build/libc_pic.a(dl-addr.os): In function `_dl_addr_inside_object':<br />dl-addr.c:(.text+0x0): multiple definition of `_dl_addr_inside_object'<br />./src/glibc-2.15/build/elf/dl-allobjs.os:(.text+0x10ef0): first defined here |
Solution: this was perhaps the trickiest. Adding -march=* or -DNDEBUG didn’t help, eventually adding -fno-stack-protector to CFLAGS did the trick.
1 |
echo libnss_db-2.15.so /home/yonch/lib/libnss_db.so.2 >> /home/yonch/src/glibc-2.15/build/elf/symlink.list<br />rm -f /home/yonch/lib/libnss_db.so.new<br />/bin/sh ../scripts/rellns-sh /home/yonch/lib/libnss_db.so.2 /home/yonch/lib/libnss_db.so.new<br />mv -f /home/yonch/lib/libnss_db.so.new /home/yonch/lib/libnss_db.so<br />.././scripts/mkinstalldirs /var/db<br />mkdir /var/db<br />mkdir: cannot create directory `/var/db': Permission denied<br />make[2]: *** [/var/db/Makefile] Error 1 |
Solution: nothing – the library seemed to work for me, even with this error. The software I run does not use libnss, though.
That’s it
a “make check” looked okay (although it took forever, so was killed half way).