Summary: | dev-lang/php-5.4.8[imap] hardened - ./conftest: symbol lookup error: /usr/lib64/libc-client.so.1: undefined symbol: crypt | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Marcin Mirosław <bug> |
Component: | Current packages | Assignee: | PHP Bugs <php-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | frp.bissey, martin, net-mail+disabled |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=545086 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 372079 | ||
Attachments: | config.log |
Description
Marcin Mirosław
2013-02-12 13:01:13 UTC
Created attachment 338692 [details]
config.log
Cannot reproduce this. Can I have your useflags for php, as well as which c-client you are using? Sure, useflags for php are: [ebuild NS ] dev-lang/php-5.4.13:5.4 [5.3.18:5.3] USE="apache2 bcmath cli crypt ctype exif fileinfo filter gd iconv imap ipv6 json mysql mysqli nls pdo postgres readline session sockets spell sqlite ssl unicode xml xmlrpc zlib -berkdb -bzip2 -calendar -cdb -cgi -cjk -curl -curlwrappers -debug -doc -embed -enchant -firebird -flatfile -fpm (-frontbase) -ftp -gdbm -gmp -hash -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit -mhash -mssql -mysqlnd -oci8-instant-client -odbc -pcntl -phar -posix -qdbm -recode (-selinux) -sharedmem -simplexml -snmp -soap (-sybase-ct) -sysvipc -threads -tidy -tokenizer -truetype -wddx -xmlreader -xmlwriter -xpm -xsl -zip" net-libs/c-client-2007f-r4 was built with the following: USE="ipv6 (multilib) ssl -chappa -doc -kerberos -pam -static-libs -topal" ABI_X86="64" CFLAGS="-march=native -O2 -fexpensive-optimizations -fpeel-loops -fgraphite-identity -floop-interchange -ftree-loop-linear -floop-block -floop-strip-mine -fira-loop-pressure -fpredictive-commoning -freorder-blocks-and-partition -ftracer -ftree-vectorize -frecord-gcc-switches -fno-unwind-tables -fno-asynchronous-unwind-tables -pipe -Wdisabled-optimization -Wstack-protector -fPIC" CXXFLAGS="-march=native -O2 -fexpensive-optimizations -fpeel-loops -fgraphite-identity -floop-interchange -ftree-loop-linear -floop-block -floop-strip-mine -fira-loop-pressure -fpredictive-commoning -freorder-blocks-and-partition -ftracer -ftree-vectorize -frecord-gcc-switches -fno-unwind-tables -fno-asynchronous-unwind-tables -pipe -Wdisabled-optimization -Wstack-protector -fPIC" Jus to be sure, did you change linker to gold? Mine is: # ld -v GNU gold (GNU Binutils 2.23.1) 1.11 (In reply to comment #3) > Sure, useflags for php are: > [ebuild NS ] dev-lang/php-5.4.13:5.4 [5.3.18:5.3] USE="apache2 bcmath > cli crypt ctype exif fileinfo filter gd iconv imap ipv6 json mysql mysqli > nls pdo postgres readline session sockets spell sqlite ssl unicode xml > xmlrpc zlib -berkdb -bzip2 -calendar -cdb -cgi -cjk -curl -curlwrappers > -debug -doc -embed -enchant -firebird -flatfile -fpm (-frontbase) -ftp -gdbm > -gmp -hash -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit -mhash > -mssql -mysqlnd -oci8-instant-client -odbc -pcntl -phar -posix -qdbm -recode > (-selinux) -sharedmem -simplexml -snmp -soap (-sybase-ct) -sysvipc -threads > -tidy -tokenizer -truetype -wddx -xmlreader -xmlwriter -xpm -xsl -zip" > > net-libs/c-client-2007f-r4 was built with the following: > USE="ipv6 (multilib) ssl -chappa -doc -kerberos -pam -static-libs -topal" > ABI_X86="64" > CFLAGS="-march=native -O2 -fexpensive-optimizations -fpeel-loops > -fgraphite-identity -floop-interchange -ftree-loop-linear -floop-block > -floop-strip-mine -fira-loop-pressure -fpredictive-commoning > -freorder-blocks-and-partition -ftracer -ftree-vectorize > -frecord-gcc-switches -fno-unwind-tables -fno-asynchronous-unwind-tables > -pipe -Wdisabled-optimization -Wstack-protector -fPIC" > CXXFLAGS="-march=native -O2 -fexpensive-optimizations -fpeel-loops > -fgraphite-identity -floop-interchange -ftree-loop-linear -floop-block > -floop-strip-mine -fira-loop-pressure -fpredictive-commoning > -freorder-blocks-and-partition -ftracer -ftree-vectorize > -frecord-gcc-switches -fno-unwind-tables -fno-asynchronous-unwind-tables > -pipe -Wdisabled-optimization -Wstack-protector -fPIC" > That exact setup works for me ... And I cannot really spot any specific difference either ... Can you test with 5.5 too? > Jus to be sure, did you change linker to gold? > Mine is: > # ld -v > GNU gold (GNU Binutils 2.23.1) 1.11 Sure: # ld -v GNU gold (GNU Binutils 2.23.2) 1.11 The same problem with php:5.5 : configure:51879: checking whether build with IMAP works configure:51923: x86_64-pc-linux-gnu-gcc -o conftest -I/usr/include -march=native -O2 -fexpensive-optimizations -fpeel-loops -fgraphite-identity -floop-interchange -ftree-loop-linear -floop-block -floop-strip-mine -fira-loop-pressure -fpredictive-commoning -freorder-blocks-and-partition -ftracer -ftree-vectorize -frecord-gcc-switches -fno-unwind-tables -fno-asynchronous-unwind-tables --param l2-cache-size=128 --param l1-cache-size=16 --param l1-cache-line-size=32 -pipe -Wdisabled-optimization -Wstack-protector -L/usr/lib64 -Wl,-O1 -Wl,--as-needed -Wl,--sort-common conftest.c -lc-client -lcrypto -lssl -lcrypto -lcrypt -lpam -lpng -lz -ljpeg -lz -lsqlite3 -lpcre -lcrypto -lssl -lcrypto -lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl >&5 configure:51923: $? = 0 configure:51923: ./conftest ./conftest: symbol lookup error: /usr/lib64/libc-client.so.1: undefined symbol: crypt configure:51923: $? = 127 configure: program exited with status 127 Shouldn't be libraries passed in diffrent order? Like that: -lcrypto -lssl -lcrypto -lcrypt -lc-client -lpam -lpng -lz -ljpeg -lz -lsqlite3 -lpcre -lcrypto -lssl -lcrypto -lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl I can even reproduce problem with USE="-* cli imap ssl". As for now I can reproduce problem only on hardened profile. But I'm not sure if this is only one reason that triggers error. I get the same error when trying to build mail-client/alpine-2.00-r5 (alpine-2.00-r4 worked fine). It seems that net-libs/c-client is underlinked: Adding -lcrypt to LDFLAGS when building c-client solves the issue. Got the same problem trying to install alpine. Merging c-client with LDFLAGS="-lcrypt" did solve the problem indeed. When building net-libs/c-client, there are a number of different "targets" listed in its Makefile. The one we wind up using is "lnx": if use kernel_linux ; then use pam && target=lnp passwdtype=pam || target=lnx passwdtype=std However, "lnx" is... lnx: # Linux non-shadow passwords and that's clearly not us. In the "lnx" target, "-lcrypt" does not get appended to LDFLAGS. This looks a lot more promising: slx: # Secure Linux ... BASELDFLAGS="-lcrypt" I would suggest that net-mail@ change "lnx" to "slx" in the c-client ebuild. That should add "-lcrypt" to LDFLAGS and fix the issue. commit 3524b85eb813d017c7fa32843a3949d065ab2d6b Author: Michael Orlitzky <mjo@gentoo.org> Date: Sat Feb 18 10:27:51 2017 -0500 net-libs/c-client: new revision building the "slx" target with USE="-pam". The build system for c-client supports a few different targets. When USE=pam was not set, we were using the "lnx" target, which supposes that the crypt() function is available directly in libc. That is not the case in Gentoo, but things usually worked out when libcrypt was linked in transitively (by, say, PHP). However, the "gold" linker is more strict than "bfd" with regard to transitive dependencies. The gold linker treats them as superfluous and mercilessly prunes them; thus c-client could wind up with no crypt() function when the gold linker was used: c-client was not linking with -lcrypt itself, and even though consumers might be linking in c-client with -lcrypt, the crypt library appeared unused and would be omitted. By switching from the "lnx" target to "slx", we ensure that -lcrypt is passed to the linker when it links c-client itself. Thus the crypt() function is where it is expected to be, and the associated PHP build failure is resolved. I was unable to reproduce a related bug in mail-client/alpine. I added two (unrelated) missing "die" statements to the ebuild while I was at it. This non-maintainer commit was with permission from robbat2. Gentoo-Bug: 456928 Gentoo-Bug: 545086 Package-Manager: portage-2.3.3 |