Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 370421

Summary: net-libs/c-client with --as-needed makes php-5.5.0 fail to build
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Net-Mail Packages <net-mail+disabled>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 129413    

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-07 08:39:45 UTC
configure:51363: checking whether build with IMAP works
configure:51407: i686-pc-linux-gnu-gcc -o conftest -I/usr/include -O2 -pipe  -L/usr/lib -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -lc-client   -lcrypt -lpam -lgmp -lt1 -lfreetype -lpng -lz -ljpeg -ldb-5.0 -lgdbm -lcurl -lbz
2 -lz -lpcre -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lcurl -lssl -lcrypto -lrt -lssl -lcrypto -ldl -lz -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lssl -lcrypto -ldl -lz >&5
/usr/lib/libc-client.so: undefined reference to `SSL_get_fd'
/usr/lib/libc-client.so: undefined reference to `BIO_new_mem_buf'
/usr/lib/libc-client.so: undefined reference to `SSL_set_bio'
/usr/lib/libc-client.so: undefined reference to `BIO_free'
/usr/lib/libc-client.so: undefined reference to `TLSv1_client_method'
/usr/lib/libc-client.so: undefined reference to `X509_STORE_CTX_get_error'
/usr/lib/libc-client.so: undefined reference to `X509_NAME_oneline'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_set_verify'
/usr/lib/libc-client.so: undefined reference to `PEM_read_bio_PrivateKey'
/usr/lib/libc-client.so: undefined reference to `sk_value'
/usr/lib/libc-client.so: undefined reference to `SSL_ctrl'
/usr/lib/libc-client.so: undefined reference to `SSL_load_error_strings'
/usr/lib/libc-client.so: undefined reference to `SSL_state'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_use_certificate_chain_file'
/usr/lib/libc-client.so: undefined reference to `SSL_get_peer_certificate'
/usr/lib/libc-client.so: undefined reference to `X509_get_subject_name'
/usr/lib/libc-client.so: undefined reference to `SSL_free'
/usr/lib/libc-client.so: undefined reference to `PEM_read_bio_X509'
/usr/lib/libc-client.so: undefined reference to `X509_get_ext_d2i'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_use_RSAPrivateKey_file'
/usr/lib/libc-client.so: undefined reference to `SSL_set_connect_state'
/usr/lib/libc-client.so: undefined reference to `RAND_seed'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_new'
/usr/lib/libc-client.so: undefined reference to `SSL_read'
/usr/lib/libc-client.so: undefined reference to `SSL_set_fd'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_use_PrivateKey'
/usr/lib/libc-client.so: undefined reference to `SSL_pending'
/usr/lib/libc-client.so: undefined reference to `X509_verify_cert_error_string'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_load_verify_locations'
/usr/lib/libc-client.so: undefined reference to `BIO_new_socket'
/usr/lib/libc-client.so: undefined reference to `ERR_get_error'
/usr/lib/libc-client.so: undefined reference to `SSLv23_client_method'
/usr/lib/libc-client.so: undefined reference to `sk_num'
/usr/lib/libc-client.so: undefined reference to `EVP_PKEY_free'
/usr/lib/libc-client.so: undefined reference to `ERR_error_string'
/usr/lib/libc-client.so: undefined reference to `SSL_library_init'
/usr/lib/libc-client.so: undefined reference to `X509_STORE_CTX_get_current_cert'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_set_cipher_list'
/usr/lib/libc-client.so: undefined reference to `SSL_new'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_use_certificate'
/usr/lib/libc-client.so: undefined reference to `SSL_write'
/usr/lib/libc-client.so: undefined reference to `X509_free'
/usr/lib/libc-client.so: undefined reference to `TLSv1_server_method'
/usr/lib/libc-client.so: undefined reference to `SSL_accept'
/usr/lib/libc-client.so: undefined reference to `SSL_shutdown'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_set_default_verify_paths'
/usr/lib/libc-client.so: undefined reference to `ERR_load_crypto_strings'
/usr/lib/libc-client.so: undefined reference to `RSA_generate_key'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_set_tmp_rsa_callback'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_ctrl'
/usr/lib/libc-client.so: undefined reference to `SSL_get_error'
/usr/lib/libc-client.so: undefined reference to `SSL_CTX_free'
/usr/lib/libc-client.so: undefined reference to `SSLv23_server_method'
collect2: ld returned 1 exit status
configure:51407: $? = 1
configure: program exited with status 1

Portage 2.1.10 (default/linux/x86/10.0, gcc-4.6.0-asneeded, glibc-2.14-r0, 2.6.39 i686)
=================================================================
System uname: Linux-2.6.39-i686-Quad-Core_AMD_Opteron-tm-_Processor_2350-with-gentoo-2.0.2
Timestamp of tree: Mon, 06 Jun 2011 20:30:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.1-r1, 3.2
dev-util/cmake:           2.8.4-r1
sys-apps/baselayout:      2.0.2
sys-apps/openrc:          0.8.2-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21
sys-devel/gcc:            4.6.0
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)
sys-libs/glibc:           2.14
Repositories: gentoo
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/tomoyo/conf /usr/share/bufrtables /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /usr/share/openvpn/easy-rsa /usr/share/qpsmtpd/plugins /var/lib/hsqldb /var/phxd /var/qmail/alias /var/qmail/control /var/yp/Makefile"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/games/angband/edit/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms split-log strict test test-fail-continue unknown-features-warn unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j14"
PKGDIR="/var/spool/portage/packages"
PORTAGE_COMPRESS=""
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/cache/portage/tree"
PORTDIR_OVERLAY=""
SYNC="rsync://yamato.home.flameeyes.eu/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 java5 java6 modules mudflap mysql ncurses nls nostatic nptl nptlonly openmp pam pcre pcsc-lite perl postgres pppd python qt3support readline ruby semantic-desktop session ssl sysfs tcpd unicode vhosts x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest cgi" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18 jruby ruby19 ree18" USERLAND="GNU" VIDEO_CARDS="intel radeon nouveau vmware" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Eray Aslan gentoo-dev 2011-06-07 10:27:27 UTC
I cannot reproduce this.  It looks like a dup of bug #359221 tho.  What version and use flags for net-libs/c-client and virtual/imap-c-client?
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-07 10:47:25 UTC
Calculating dependencies... done!
[ebuild   R    ] net-libs/c-client-2007e-r2  USE="pam ssl -doc" 0 kB
[ebuild   R    ] virtual/imap-c-client-1  USE="ssl" 0 kB

The problem is that c-client[ssl] does _not_ link against libssl/libcrypto as it should, causing an underlinking problem.
Comment 3 Eray Aslan gentoo-dev 2011-06-07 10:57:50 UTC
# lddtree /usr/lib/libc-client.so
libc-client.so => /usr/lib/libc-client.so (interpreter => none)
    libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0
    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0
        libz.so.1 => /lib/libz.so.1
    libcrypt.so.1 => /lib/libcrypt.so.1
    libpam.so.0 => /lib/libpam.so.0
    libdl.so.2 => /lib/libdl.so.2
        ld-linux.so.2 => /lib/ld-linux.so.2
    libc.so.6 => /lib/libc.so.6

So, why is yours different?


# emerge --info
Portage 2.1.9.42 (default/linux/x86/10.0/developer, gcc-4.4.5, libc-0-r0, 2.6.39-linode33 i686)
=================================================================
System uname: Linux-2.6.39-linode33-i686-Intel-R-_Xeon-R-_CPU_L5520_@_2.27GHz-with-gentoo-2.0.2
Timestamp of tree: Fri, 03 Jun 2011 08:45:01 +0000
app-shells/bash:     4.1_p9
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/cmake:      2.8.4-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.82
sys-kernel/linux-headers: 2.6.36.1
sys-libs/glibc:      2.12.2
virtual/os-headers:  0
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks fixlafiles fixpackages multilib-strict news parallel-fetch protect-owned sandbox sfperms sign splitdebug strict stricter test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="ftp://mirror.bytemark.co.uk/gentoo/"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync1.uk.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa berkdb bluetooth bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gdu gif gpm gtk iconv ipv6 jpeg lcms ldap libnotify mad mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf png policykit ppds pppd qt3support qt4 readline sdl session snmp spell ssl startup-notification svg sysfs tcpd tiff truetype udev unicode usb vorbis x264 x86 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-07 11:03:53 UTC
I'm using forced --as-needed, while c-client build system is ignoring --as-needed as set in LDFLAGS:


i686-pc-linux-gnu-gcc -L/usr/lib -lssl -lcrypto -lcrypt -lpam -ldl -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -O2 -pipe -fPIC -DCHUNKSIZE=65536  -shared  -Wl,-soname,libc-client.so.1 -o libc-client.so.1.0.0 osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o dummy.o pseudo.o netmsg.o flstring.o fdstring.o rfc822.o nntp.o smtp.o imap4r1.o pop3.o unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o


The libraries are passed too early, so they are discarded with my method. While the standard method is ignored because --as-needed gets appended _after_ the libraries.
Comment 5 Eray Aslan gentoo-dev 2011-06-07 12:10:10 UTC
+  07 Jun 2011; Eray Aslan <eras@gentoo.org> files/c-client-2007e-ldflags.patch:
+  Fix as-needed flag - bug #370421
+

This is not autotools and no separate $(LIBS) in the build process, so gross hack for now:

x86_64-pc-linux-gnu-gcc -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -L/usr/lib -lssl -lcrypto -lcrypt -lpam -ldl -O2 -pipe -march=core2 -fPIC -DCHUNKSIZE=65536  -shared  -Wl,-soname,libc-client.so.1 -o libc-client.so.1.0.0 osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o dummy.o pseudo.o netmsg.o flstring.o fdstring.o rfc822.o nntp.o smtp.o imap4r1.o pop3.o unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -L/usr/lib -lssl -lcrypto -lcrypt -lpam -ldl

Compiles and looks fine but not really tested.  Can you please check?  Fixing the whole build correctly is not really worth it imho so I am hoping that this will be acceptable.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-07 12:17:17 UTC
If it uses the implicit make macros, you can use the LDLIBS variable. Otherwise you'll have to write your own rule to have it right I'm afraid.
Comment 7 Eray Aslan gentoo-dev 2011-06-07 12:20:49 UTC
No LDLIBS unfortunately.  I'll see what I can do to fix it properly.
Comment 8 Eray Aslan gentoo-dev 2011-06-07 13:12:11 UTC
+  07 Jun 2011; Eray Aslan <eras@gentoo.org> files/c-client-2007e-ldflags.patch:
+  Fix as-needed properly - bug #370421
+

Thanks for the help.