Hi!
I was just porting an application to the Fonera 2.0n (
http://en.wikipedia.org/wiki/Fonera#Fonera_2.0n ), and openssl is one of
its dependencies, so I am cross-compiling it.
I have the toolchain for the platform, it's based on openwrt. And built
some required libraries on the Fonera and then copied the libraries to
my system for crosscompiling the application in order to get a full
toolchain.
I modified the Configure file as my arch is not there, so I added this:
"linux-mipsel","/pathtosdk/fon/openwrt/staging_dir/toolchain-mipsel_gcc4.1.2/bin/mipsel-linux-uclibc-gcc:-DTERMIO
-O3 -fomit-frame-pointer -Wall
-I/pathtosdk/fon/openwrt/staging_dir/mipsel/usr/include
-I/pathtosdk/system/usr/include -L/pathtosdk/system/usr/lib
-L/pathtosdk/fon/openwrt/staging_dir/mipsel/usr/lib
::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL
BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
And also modified the Makefile in order to the command 'ar' points to
the right one on the toolchain.
Then when issuing make it compiles several files, but it exits with
these errors:
------------------------------------------------
rm -f openssl
shlib_target=; if [ -n "libcrypto.so.0.9.8 libssl.so.0.9.8" ]; then \
shlib_target="linux-shared"; \
elif [ -n "" ]; then \
FIPSLD_CC=/pathtosdk/fon/openwrt/staging_dir/toolchain-mipsel_gcc4.1.2/bin/mipsel-linux-uclibc-gcc;
CC=../fips/fipsld; export CC FIPSLD_CC; \
fi; \
LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \
[ "x" = "xlibfips" ] && LIBRARIES="$LIBRARIES -lfips"; \
make -f ../Makefile.shared -e \
CC=${CC} 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 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 cms.o" \
LIBDEPS=" $LIBRARIES -ldl" \
link_app.${shlib_target}
make[2]: Entering directory `/pathtosdk/openssl/openssl-0.9.8l/apps'
openssl.o: In function `main':
openssl.c:(.text+0x990): undefined reference to `CRYPTO_malloc_debug_init'
req.o: In function `req_main':
req.c:(.text+0x119c): undefined reference to `EC_KEY_free'
req.c:(.text+0x21c0): undefined reference to `EC_KEY_generate_key'
req.c:(.text+0x3b30): undefined reference to `EC_KEY_new'
req.c:(.text+0x3b50): undefined reference to `PEM_read_bio_ECPKParameters'
req.c:(.text+0x3b70): undefined reference to `EC_KEY_set_group'
req.c:(.text+0x3b8c): undefined reference to `EC_GROUP_free'
req.c:(.text+0x3bbc): undefined reference to `EC_KEY_get0_group'
req.c:(.text+0x3bd4): undefined reference to `EC_GROUP_get_degree'
req.c:(.text+0x3c74): undefined reference to `EC_KEY_free'
req.c:(.text+0x3d94): undefined reference to `EC_KEY_dup'
enc.o: In function `enc_main':
enc.c:(.text+0xe8c): undefined reference to `EVP_CIPHER_CTX_set_flags'
ec.o: In function `ec_main':
ec.c:(.text+0x31c): undefined reference to `EC_KEY_free'
ec.c:(.text+0x7b8): undefined reference to `PEM_read_bio_EC_PUBKEY'
ec.c:(.text+0x80c): undefined reference to `EC_KEY_get0_group'
ec.c:(.text+0x8c4): undefined reference to `PEM_write_bio_EC_PUBKEY'
ec.c:(.text+0x98c): undefined reference to `d2i_EC_PUBKEY_bio'
ec.c:(.text+0x9cc): undefined reference to `PEM_read_bio_ECPrivateKey'
ec.c:(.text+0x9ec): undefined reference to `EC_KEY_set_conv_form'
ec.c:(.text+0xa08): undefined reference to `EC_KEY_print'
ec.c:(.text+0xa3c): undefined reference to `EC_KEY_set_asn1_flag'
ec.c:(.text+0xa58): undefined reference to `d2i_ECPrivateKey_bio'
ec.c:(.text+0xb48): undefined reference to `i2d_EC_PUBKEY_bio'
ec.c:(.text+0xbfc): undefined reference to `PEM_write_bio_ECPrivateKey'
ec.c:(.text+0xc2c): undefined reference to `i2d_ECPKParameters'
ec.c:(.text+0xc44): undefined reference to `i2d_ECPrivateKey_bio'
ec.c:(.text+0xc60): undefined reference to `PEM_write_bio_ECPKParameters'
ecparam.o: In function `ecparam_main':
ecparam.c:(.text+0x4d4): undefined reference to `EC_GROUP_new_by_curve_name'
ecparam.c:(.text+0x4f4): undefined reference to `EC_GROUP_set_asn1_flag'
ecparam.c:(.text+0x50c): undefined reference to
`EC_GROUP_set_point_conversion_form'
ecparam.c:(.text+0x9dc): undefined reference to `EC_GROUP_free'
ecparam.c:(.text+0xc10): undefined reference to `EC_get_builtin_curves'
ecparam.c:(.text+0xc4c): undefined reference to `EC_get_builtin_curves'
ecparam.c:(.text+0xe1c): undefined reference to `EC_GROUP_set_asn1_flag'
ecparam.c:(.text+0xe3c): undefined reference to `ECPKParameters_print'
ecparam.c:(.text+0xe60): undefined reference to `EC_GROUP_set_seed'
ecparam.c:(.text+0xe7c): undefined reference to
`EC_GROUP_set_point_conversion_form'
ecparam.c:(.text+0xe9c): undefined reference to `EC_GROUP_method_of'
ecparam.c:(.text+0xf68): undefined reference to `EC_METHOD_get_field_type'
ecparam.c:(.text+0xfb0): undefined reference to `EC_GROUP_check'
ecparam.c:(.text+0x10c0): undefined reference to
`PEM_read_bio_ECPKParameters'
ecparam.c:(.text+0x1168): undefined reference to `d2i_ECPKParameters'
ecparam.c:(.text+0x11ec): undefined reference to `EC_KEY_new'
ecparam.c:(.text+0x1244): undefined reference to `EC_KEY_set_group'
ecparam.c:(.text+0x1268): undefined reference to `EC_KEY_generate_key'
ecparam.c:(.text+0x12b0): undefined reference to `EC_KEY_free'
ecparam.c:(.text+0x1304): undefined reference to
`PEM_write_bio_ECPKParameters'
ecparam.c:(.text+0x135c): undefined reference to `i2d_ECPKParameters'
ecparam.c:(.text+0x140c): undefined reference to `EC_GROUP_get_curve_GFp'
ecparam.c:(.text+0x1434): undefined reference to `EC_GROUP_get0_generator'
ecparam.c:(.text+0x1450): undefined reference to
`EC_GROUP_get_point_conversion_form'
ecparam.c:(.text+0x1468): undefined reference to `EC_POINT_point2bn'
ecparam.c:(.text+0x148c): undefined reference to `EC_GROUP_get_order'
ecparam.c:(.text+0x14a8): undefined reference to `EC_GROUP_get_cofactor'
ecparam.c:(.text+0x1a74): undefined reference to
`PEM_write_bio_ECPrivateKey'
ecparam.c:(.text+0x1a9c): undefined reference to `EC_KEY_free'
ecparam.c:(.text+0x1ad8): undefined reference to `i2d_ECPrivateKey_bio'
ecparam.c:(.text+0x1af4): undefined reference to `EC_KEY_free'
genrsa.o: In function `genrsa_main':
genrsa.c:(.text+0x458): undefined reference to `RSA_X931_generate_key_ex'
genrsa.c:(.text+0x998): undefined reference to `EVP_idea_cbc'
gendsa.o: In function `gendsa_main':
gendsa.c:(.text+0x7e4): undefined reference to `EVP_idea_cbc'
s_server.o: In function `ssl_servername_cb':
s_server.c:(.text+0x2b08): undefined reference to `SSL_get_servername'
s_server.o: In function `s_server_main':
s_server.c:(.text+0x4664): undefined reference to `EC_KEY_new_by_curve_name'
s_server.c:(.text+0x4714): undefined reference to `EC_KEY_free'
s_server.c:(.text+0x4c70): undefined reference to `EC_KEY_new_by_curve_name'
s_client.o: In function `s_client_main':
s_client.c:(.text+0x1668): undefined reference to
`SSL_CTX_set_client_cert_engine'
s_client.o: In function `ssl_servername_cb':
s_client.c:(.text+0x3e44): undefined reference to `SSL_get_servername'
s_client.c:(.text+0x3e60): undefined reference to `SSL_get_servername_type'
speed.o: In function `speed_main':
speed.c:(.text+0xc44): undefined reference to `idea_set_encrypt_key'
speed.c:(.text+0xc84): undefined reference to `RC2_set_key'
speed.c:(.text+0x164c): undefined reference to `EVP_ripemd160'
speed.c:(.text+0x264c): undefined reference to `idea_cbc_encrypt'
speed.c:(.text+0x27e0): undefined reference to `RC2_cbc_encrypt'
speed.c:(.text+0x37f4): undefined reference to `EC_KEY_new_by_curve_name'
speed.c:(.text+0x381c): undefined reference to `EC_KEY_precompute_mult'
speed.c:(.text+0x3834): undefined reference to `EC_KEY_generate_key'
speed.c:(.text+0x384c): undefined reference to `ECDSA_sign'
speed.c:(.text+0x3928): undefined reference to `ECDSA_sign'
speed.c:(.text+0x39ec): undefined reference to `ECDSA_verify'
speed.c:(.text+0x4130): undefined reference to `EC_KEY_free'
speed.c:(.text+0x4154): undefined reference to `EC_KEY_free'
speed.c:(.text+0x4178): undefined reference to `EC_KEY_free'
speed.c:(.text+0x419c): undefined reference to `EC_KEY_free'
speed.c:(.text+0x41c0): undefined reference to `EC_KEY_free'
speed.o:speed.c:(.text+0x41e4): more undefined references to
`EC_KEY_free' follow
speed.o: In function `speed_main':
speed.c:(.text+0x48c0): undefined reference to `EC_KEY_new_by_curve_name'
speed.c:(.text+0x48e0): undefined reference to `EC_KEY_new_by_curve_name'
speed.c:(.text+0x4908): undefined reference to `EC_KEY_generate_key'
speed.c:(.text+0x4924): undefined reference to `EC_KEY_generate_key'
speed.c:(.text+0x5194): undefined reference to `ECDSA_verify'
speed.c:(.text+0x583c): undefined reference to `EVP_md2'
speed.c:(.text+0x5e68): undefined reference to `MD2_options'
speed.c:(.text+0x5f28): undefined reference to `idea_options'
speed.c:(.text+0x6518): undefined reference to `EC_KEY_get0_group'
speed.c:(.text+0x6530): undefined reference to `EC_GROUP_get_degree'
speed.c:(.text+0x6560): undefined reference to `EC_KEY_get0_public_key'
speed.c:(.text+0x6578): undefined reference to `ECDH_compute_key'
speed.c:(.text+0x6598): undefined reference to `EC_KEY_get0_public_key'
speed.c:(.text+0x65b0): undefined reference to `ECDH_compute_key'
speed.c:(.text+0x66e4): undefined reference to `EC_KEY_get0_public_key'
speed.c:(.text+0x66fc): undefined reference to `ECDH_compute_key'
version.o: In function `version_main':
version.c:(.text+0x2ac): undefined reference to `MD2_options'
version.c:(.text+0x33c): undefined reference to `idea_options'
pkcs12.o: In function `pkcs12_main':
pkcs12.c:(.text+0x2540): undefined reference to `EVP_idea_cbc'
smime.o: In function `smime_main':
smime.c:(.text+0x14dc): undefined reference to `EVP_rc2_40_cbc'
smime.c:(.text+0x1514): undefined reference to `EVP_rc2_40_cbc'
smime.c:(.text+0x15e8): undefined reference to `EVP_rc2_cbc'
smime.c:(.text+0x1644): undefined reference to `EVP_rc2_64_cbc'
collect2: ld returned 1 exit status
make[2]: *** [link_app.gnu] Error 1
make[2]: Leaving directory `/pathtosdk/openssl/openssl-0.9.8l/apps'
make[1]: *** [openssl] Error 2
make[1]: Leaving directory `/pathtosdk/openssl/openssl-0.9.8l/apps'
make: *** [build_apps] Error 1
------------------------------------------------
I don't know if the toolchain is missing some libraries, but it would
fail to compile when including the headers in this case.
Anyone has any idea on how to fix this?
Thanks in advance,
Angel
--
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org