Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 546874 - app-crypt/heimdal-1.5.3-r2 underlinking issue causes samba-4.1.17 to fail
Summary: app-crypt/heimdal-1.5.3-r2 underlinking issue causes samba-4.1.17 to fail
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Kerberos Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: underlinking
  Show dependency tree
 
Reported: 2015-04-17 05:27 UTC by Tiziano Müller
Modified: 2015-06-14 02:11 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiziano Müller gentoo-dev 2015-04-17 05:27:53 UTC
When building samba-4.1.17, the configure step fails because `heim_cmp` could not be found with the following output in the config log:

  [2/2] Linking default/testprog
  /usr/lib64/libheimbase.so: undefined reference to `pthread_getspecific'
  /usr/lib64/libheimbase.so: undefined reference to `pthread_key_create'
  /usr/lib64/libheimbase.so: undefined reference to `pthread_setspecific'
  collect2: error: ld returned 1 exit status
  ['x86_64-pc-linux-gnu-gcc', 'default/test_1.o', '-o', '/var/tmp/paludis/net-fs-samba-4.1.17/work/samba-4.1.17/bin/.conf_check_0/testbuild/default/testprog', '-O2', '-pipe', '-march=native', '-g', '-Wl,-O1,--hash-style=gnu,--sort-common', '-Wl,--as-needed', '-Wl,-O1,--hash-style=gnu,--sort-common', '-Wl,--as-needed', '-fstack-protector', '-Wl,-no-undefined', '-L/usr/local/lib', '-L/usr/lib64', '-Wl,-Bdynamic', '-lheimbase']

`ldd /usr/lib64/libheimbase.so` for app-crypt/heimdal-1.5.3-r2[X,berkdb,caps,ipv6,pkinit,threads] gives:

  linux-vdso.so.1 (0x00007fff581c4000)
  libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f2a1c7b2000)
  libc.so.6 => /lib64/libc.so.6 (0x00007f2a1c1e9000)
  /lib64/ld-linux-x86-64.so.2 (0x00007f2a1cc27000)

Relevant flags and packages:

  CHOST="x86_64-pc-linux-gnu"
  CFLAGS="-O2 -pipe -march=native -g"
  CXXFLAGS="${CFLAGS}"
  LDFLAGS="-Wl,-O1,--hash-style=gnu,--sort-common -Wl,--as-needed"

  sys-devel/gcc         4.9.2
  sys-libs/glibc        2.20-r2

When removing '-Wl,--as-needed' from LDFLAGS, building heimdal itself fails in the linking phase for libheimbase.so:

  /bin/sh ../../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -m32  -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-
cast -Wmissing-declarations -Wnested-externs  -O2 -pipe -march=native -g -fno-strict-aliasing  -Wl,-O1,--hash-style=gnu,--sort-common 
-o tc tc.o libheim-ipcc.la ../../lib/vers/libvers.la ../../lib/roken/libroken.la -lcrypt  -lresolv  
libtool: link: x86_64-pc-linux-gnu-gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wne
sted-externs -O2 -pipe -march=native -g -fno-strict-aliasing -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -o .libs/tc tc.o  ./.libs/
libheim-ipcc.a /var/tmp/paludis/app-crypt-heimdal-1.5.3-r2/work/heimdal-1.5.3-abi_x86_32.x86/base/.libs/libheimbase.so /var/tmp/paludi
s/app-crypt-heimdal-1.5.3-r2/work/heimdal-1.5.3-abi_x86_32.x86/lib/roken/.libs/libroken.so ../../lib/vers/.libs/libvers.a ../../lib/ro
ken/.libs/libroken.so -lcrypt -lresolv
  /var/tmp/paludis/app-crypt-heimdal-1.5.3-r2/work/heimdal-1.5.3-abi_x86_32.x86/base/.libs/libheimbase.so: undefined reference to `pthread_getspecific'
  /var/tmp/paludis/app-crypt-heimdal-1.5.3-r2/work/heimdal-1.5.3-abi_x86_32.x86/base/.libs/libheimbase.so: undefined reference to `pthread_key_create'
  /var/tmp/paludis/app-crypt-heimdal-1.5.3-r2/work/heimdal-1.5.3-abi_x86_32.x86/base/.libs/libheimbase.so: undefined reference to `pthread_setspecific'

When adding '-pthread' to CFLAGS for heimdal, `ldd ...` shows correctly:

  linux-vdso.so.1 (0x00007fff623f7000)
  libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fea11d65000)
  libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea11b49000)
  libc.so.6 => /lib64/libc.so.6 (0x00007fea1179c000)
  /lib64/ld-linux-x86-64.so.2 (0x00007fea121da000)

and building samba succeeds.
Comment 1 Alex Barker 2015-06-13 19:38:06 UTC
CFLAGS=-pthread does not work for me.
Comment 2 Alex Barker 2015-06-14 02:10:53 UTC
(In reply to Alex Barker from comment #1)
> CFLAGS=-pthread does not work for me.

CFLAGS && CXXFLAGS works.
Comment 3 Alex Barker 2015-06-14 02:11:01 UTC
(In reply to Alex Barker from comment #1)
> CFLAGS=-pthread does not work for me.

CFLAGS && CXXFLAGS works.