Edward Peschko <horos11@xxxxxxxxx> writes: > I was trying to compile a new version of libselinux, and ran across a > weird error (attached). I tried a bunch of stuff, and finally searched > all the libraries on the system for that symbol, which was found in > /lib/ld-2.3.4.so. > > In desperation I added it explicitly on the command line, and it > compiled. So. Is this just a bug in gcc and the linker chain? > Shouldn't the linker itself handle linking in symbols found in the > linker itself? Or perhaps its a bug. /lib/ld-2.3.4.so is the dynamic linker. It is not the linker. > cc -shared -o libselinux.so.1 avc.lo avc_internal.lo avc_sidtab.lo > booleans.lo canonicalize_context.lo checkAccess.lo check_context.lo > compute_av.lo compute_create.lo compute_member.lo compute_relabel.lo > compute_user.lo context.lo disable.lo enabled.lo fgetfilecon.lo > freeconary.lo freecon.lo fsetfilecon.lo get_context_list.lo > get_default_type.lo getenforce.lo getfilecon.lo getpeercon.lo init.lo > is_customizable_type.lo lgetfilecon.lo load_policy.lo lsetfilecon.lo > matchmediacon.lo matchpathcon.lo policyvers.lo procattr.lo > query_user_context.lo rpm.lo selinux_check_securetty_context.lo > selinux_config.lo setenforce.lo setfilecon.lo setrans_client.lo > seusers.lo -ldl -lsepol -L/usr/lib > -Wl,-soname,libselinux.so.1,-z,defs,-z,relro > matchpathcon.lo(.text+0x166): In function `set_matchpathcon_flags': > /usr/src/redhat/BUILD/libselinux-1.33.4/src/matchpathcon.c:84: > undefined reference to `___tls_get_addr' Normally this will link against -lc, which on GNU/Linux will normally mean /usr/lib/libc.so, which will normally explicitly link against the dynamic linker under the name /lib/ld-linux-x86-64.so.2 or /lib32/ld-linux.so.2. You mentioned the name ld-2.3.4.so, though, which is a fairly old version of glibc. It's possible that the /usr/lib/libc.so on your system doesn't refer to the dynamic linker. Please check. If so, then that fact in conjunction with your use of -z defs is the cause of your problem. Ian