Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 413559 - dev-libs/openssl-1.0.1a does not link on n32 MIPS64: undefined reference to `OPENSSL_ia32cap_P'
Summary: dev-libs/openssl-1.0.1a does not link on n32 MIPS64: undefined reference to `...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: MIPS Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-25 19:07 UTC by Petr Pisar
Modified: 2012-04-26 03:24 UTC (History)
0 users

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 Petr Pisar 2012-04-25 19:07:28 UTC
I cannot emerge dev-libs/openssl-1.0.1a on my MIPS64 system with n32 ABI. The build fails on linking libcrypt.so with this error message:

+ mips64el-unknown-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -Wall -O2 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop -fno-strict-aliasing -Wa,--noexecstack -o openssl openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o -L.. -lssl -L.. -lcrypto -ldl -lz
../libcrypto.so: undefined reference to `OPENSSL_ia32cap_P'
collect2: ld returned 1 exit status
make[2]: *** [link_app.gnu] Error 1
make[2]: Leaving directory `/var/tmp/portage/dev-libs/openssl-1.0.1a/work/openssl-1.0.1a/apps'

This is my toolchain settings:

CFLAGS="-O2 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop"
CXXFLAGS="$CFLAGS"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
CHOST="mips64el-unknown-linux-gnu"

I found similar report for ARM on openssl-dev list (http://www.mail-archive.com/openssl-dev@openssl.org/msg30854.html) which refers to committed patch <http://cvs.openssl.org/chngview?cn=22455> which is not part of dev-libs/openssl-1.0.1a.

I have not yet tried the patch because I have no idea how secure the change is.
Comment 1 Petr Pisar 2012-04-25 20:44:06 UTC
I confirm the patch applies cleanly and allows to link the library.
Comment 2 SpanKY gentoo-dev 2012-04-26 03:24:36 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add fix from upstream for building on non-x86 arches
http://sources.gentoo.org/dev-libs/openssl/files/openssl-1.0.1a-hmac-ia32cap.patch?rev=1.1
http://sources.gentoo.org/dev-libs/openssl/openssl-1.0.1a.ebuild?r1=1.2&r2=1.3