libz.so: could not read symbols: File in wrong format
Martin Herrman
martin at herrman.nl
Fri May 14 20:22:31 UTC 2010
All,
although not new to linux or compiling software (e.g. kernel, seldom used
apps, running Gentoo), I'm new to cross-compiling and need some help :-)
What is it that I want to accomplish? Create a new custom firmware for my
mediaplayer (EM7075).
What did I do so far?
1. install mips-4.3.51-mips-linux-gnu.bin, typical install, location:
/root/CodeSourcery
2. Modify .bash_profile (I do realise that this impacts all my compilations
on Gentoo :-))
martindesktop ~ # cat /root/.bash_profile
# New environment setting added by Sourcery G++ Lite for MIPS GNU/Linux on
Fri May 14 10:16:00 CEST 2010 1.
# The unmodified version of this file is saved in
/root/.bash_profile254443263.
# Do NOT modify these lines; they are used to uninstall.
PATH="/root/CodeSourcery/Sourcery_G++_Lite/bin:${PATH}"
export PATH
# End comments by InstallAnywhere on Fri May 14 10:16:00 CEST 2010 1.
CFLAGS="-EL"
export CFLAGS
CXXFLAGS="-EL"
export CXXFLAGS
# -s removed, no stripping anymore.. (because I hoped that striping caused
the error)
LDFLAGS="-Xlinker -rpath /lib -Xlinker -rpath-link
/root/CodeSourcery/Sourcery_G++_Lite/lib/gcc/mips-linux-gnu/4.3.2/el"
export LDFLAGS
STRIP="/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-strip"
export STRIP
CC="/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-gcc"
export CC
CXX="/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-g++"
export CXX
# Removed: 'rc' argument because of zlib fails, it adds rc already
AR="/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-ar"
export AR
martindesktop ~ #
3. download, gunzip and untar zlib-1.2.5.tar.gz
4. ./configure --prefix=/root/EM7075/mips; make; make install
5. download, gunzip and untar openssl-1.0.0.tar.gz
6. ./Configure dist --prefix=/root/EM7075/mips zlib
--with-zlib-include=/root/EM7075/mips/include
--with-zlib-lib=/root/EM7075/mips/lib
7. when executing 'make', the following error pops up:
/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-gcc -DMONOLITH -I..
-I../include -DZLIB -O -c -o ts.o
ts.c
/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-gcc -DMONOLITH -I..
-I../include -DZLIB -O -c -o openssl.o
openssl.c
rm -f
openssl
shlib_target=; if [ -n "" ]; then
\
shlib_target="";
\
fi;
\
LIBRARIES="-L.. -lssl -L.. -lcrypto" ;
\
make -f ../Makefile.shared -e
\
APPNAME=openssl OBJECTS="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"
\
LIBDEPS=" $LIBRARIES -L/root/EM7075/mips/lib -lz"
\
link_app.${shlib_target}
make[2]: Entering directory
`/root/EM7075/openssl-1.0.0/apps'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto -L/root/EM7075/mips/lib
-lz}";
LDCMD="${LDCMD:-/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-gcc}";
LDFLAGS="${LDFLAGS:--DZLIB -O}"; LIBPATH=`for x in $LIBDEPS; do echo $x;
done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e
's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o
${APPNAME:=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
${LIBDEPS} )
/root/EM7075/mips/lib/libz.so: could not read symbols: File in wrong
format
collect2: ld returned 1 exit
status
make[2]: *** [link_app.] Error
1
make[2]: Leaving directory
`/root/EM7075/openssl-1.0.0/apps'
make[1]: *** [openssl] Error
2
make[1]: Leaving directory
`/root/EM7075/openssl-1.0.0/apps'
make: *** [build_apps] Error 1
8. libz.so is a symlink to libz.so.1.2.5
martindesktop openssl-1.0.0 # file /root/EM7075/mips/lib/libz.so
/root/EM7075/mips/lib/libz.so: symbolic link to `libz.so.1.2.5'
martindesktop openssl-1.0.0 # file /root/EM7075/mips/lib/libz.so.1.2.5
/root/EM7075/mips/lib/libz.so.1.2.5: ELF 32-bit LSB shared object, MIPS,
MIPS32 rel2 version 1 (SYSV), dynamically linked, with unknown capability
0xf41 = 0x756e6700, not stripped
9. nm shows the symbols:
martindesktop openssl-1.0.0 # nm
/root/EM7075/mips/lib/libz.so.1.2.5
00000000 A
ZLIB_1.2.0
(..)
martindesktop openssl-1.0.0 #
/root/CodeSourcery/Sourcery_G++_Lite/bin/mips-linux-gnu-nm
/root/EM7075/mips/lib/libz.so.1.2.5
00000000 A ZLIB_1.2.0
(..)
10. I have replaced the symlink with the original libz.so.1.2.5, makes no
difference (as expected).
11. looked into the known problems file inside the tar.gz, but no luck.
12. I expect that this could be a 32/64-bit issue, or an incompatibility
issue (openssl 1.0.0 depends on zlib < 1.2.5?), but I'm clueless..
I hope someone can help me solving this issue, much thanks in advance!
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/mips-gnu-discuss/attachments/20100514/91ea9fee/attachment.html>
More information about the mips-gnu-discuss
mailing list