[oe] openssl fails to compile with external toolchain

Tom Kirkpatrick tom at settopsolutions.com
Tue Oct 31 22:36:39 UTC 2006


Hi guys,

as some of you probably know from the IRC room (nickname: tkp), I'm  
trying to get my OE setup to use a prebuilt toolchain following the  
instructions from the wiki. I built the toolchain with OE (meta- 
toolchain) and it seems to be working OK now (although meta-toolchain  
needed a little modification to fix some broken symlinks). However,  
when it came to building openssl, oe chocked...

| + LD_LIBRARY_PATH=..:
| + ccache i586-stv-linux-gcc-3.4.4 -march=c3 -mtune=c3 -o openssl - 
DMONOLITH -I.. -I../include -fPIC -DTHREADS -D_REENTRANT -DDSO_DLFCN - 
DHAVE_DLFCN_H -DTERMIO -Wall -fexpensive-optimizations -fomit-frame- 
pointer -frename-registers -O2 -DL_ENDIAN 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  
x509.o genrsa.o gendsa.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 spkac.o smime.o rand.o engine.o ocsp.o  
prime.o -L.. -lssl -L.. -lcrypto -lgcc -ldl -L/home/tom/stv/oe-stv/ 
build/tmp-stv-via-c3/staging/i586-stv-linux/lib
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/bin/ld: warning: ld-linux.so.2, needed by /usr/local/i586/ 
oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586-stv-linux/lib/ 
libdl.so, not found (try using -rpath or -rpath-link)
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libdl.so: undefined reference to  
`_rtld_global at GLIBC_PRIVATE'
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libc.so.6: undefined reference to  
`__libc_enable_secure at GLIBC_PRIVATE'
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libc.so.6: undefined reference to  
`__libc_stack_end at GLIBC_2.1'
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libdl.so: undefined reference to  
`_rtld_global_ro at GLIBC_PRIVATE'
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libc.so.6: undefined reference to  
`___tls_get_addr at GLIBC_2.3'
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libc.so.6: undefined reference to `_dl_argv at GLIBC_PRIVATE'
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libdl.so: undefined reference to  
`_dl_rtld_di_serinfo at GLIBC_PRIVATE'
| /usr/local/i586/oe/lib/gcc/i586-stv-linux/3.4.4/../../../../i586- 
stv-linux/lib/libdl.so: undefined reference to  
`_dl_tls_get_addr_soft at GLIBC_PRIVATE'
| collect2: ld returned 1 exit status
| make[1]: *** [openssl] Error 1

The problem being that it was not finding ld-linux.so.2. Looking at  
the bb file (openssl.inc) I see the line:
      export EX_LIBS = "-lgcc -ldl -L${STAGING_LIBDIR}

Since I'm using an external toolchain, L${STAGING_LIBDIR is clearly  
wrong, as the libs are not in STAGING_LIBDIR, they are in $ 
{PRE_BUILT}/lib , so I managed to get it to compile by changing that  
line to read:
     export EX_LIBS = "-lgcc -ldl ${TARGET_LDFLAGS}"

Does this look like a sensible fix (I'm no expert, and I'm learning  
as I go along), and if so, would someone like to change this in the  
repo?


best regards
tom (tkp)


More information about the Openembedded-devel mailing list