Aha ! this solved my problem:
$ ./Configure --prefix=/usr -shared debug-linux-ia32-aes/gcc:'-m32 '${CFLAGS}
But it `does not know how to build shared objects for this platform' -
here's how ( this works because my $CFLAGS contained '-fPIC -DPIC' :
$ gcc -m32 -o libssl.so.1.0.0 -shared
-Wl,-soname,libssl.so,--whole-archive,./libssl.a,--no-whole-archive
$ gcc -m32 -o libcrypto.so.1.0.0 -shared
-Wl,-soname,libcrypto.so,--whole-archive,./libcrypto.a,--no-whole-archive
Now I can do, after build:
$ cd include; find * -type f | while read f; do if ! cmp $f
/usr/include/openssl/$f ; then echo $f ; fi; done
$ # NO OUTPUT - OK !
And:
$ nm libcrypto.so.1.0.0 | grep ' T ' | sed 's/^.*\ T\ //' > i386.crypt.syms
$ nm /usr/lib64/libcrypto.so.1.0.0 | grep ' T ' | sed 's/^.*\ T\ //' >
x86_64.crypt.syms
$ cmp i386.crypt.syms x86_64.crypt.syms
# NO OUTPUT - OK !
same for libssl.1.0.0 - hooray!
It would be nice to have some message from the x86_64 Configure to the effect
that:
' To build i686 versions of the openssl libraries for this platform, use
the "debug-linux-ia32-aes" target with -m32 CFLAGS .
'
( I think used this Configure for x86_64 :
$ ./Configure --prefix=/usr -shared linux-elf-x86_64/gcc:'-march=x86-64
-mtune=k8 -O2 -g -fPIC -DPIC'
it would also be really nice if openssl's "version" command had an option to
show the actual "Configure" command line
used for building that instance - it shows the resulting options, but not the
Configure command line:
$ openssl version -a
OpenSSL 1.0.0d 8 Feb 2011
built on: Fri Apr 8 19:43:39 IST 2011
platform: linux-x86_64
options: bn(64,64) rc4(8x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN
-DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
-DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM -march=x86-64 -mtune=k8 -g -O -fPIC -pipe
OPENSSLDIR: "/usr/lib64/openssl"
:-)
Sorry for raising this issue - it is resolved now - but please, building shared
libs on Linux should be really straightforward these days - see 'libtool(1)' -
it raises some suggestions for further improvement :
o having 'openssl --version -c' print the actual Configure command line would
have been really helpful
o some warning from Configure i686 that "AES is enabled in system openssl
headers but will be disabled for this build"
or from Configure for x86_64 that "to enable AES for i686 versions of the
openssl libraries, build for the debug-linux-ia32-aes target"
would have been nice.
Thanks for OpenSSL!
All the best,
Jason
On Wednesday 27 April 2011 08:50:00 you wrote:
>
> Greetings,
>
> This message has been automatically generated in response to the
> creation of a trouble ticket regarding:
> "openssl-1.0.0d build bug ? i686 build does not define AES_unwrap_key
> and other symbols on x86_64",
> a summary of which appears below.
>
> There is no need to reply to this message right now. Your ticket has been
> assigned an ID of [openssl.org #2503].
>
> Please include the string:
>
> [openssl.org #2503]
>
> in the subject line of all future correspondence about this issue. To do so,
> you may reply to this message.
>
> Thank you,
> [email protected]
>
> -------------------------------------------------------------------------
> Hi -
>
> Building openssl-1.0.0d for my native x86_64 linux platform enables defining
> the AES_* symbols in /usr/include/openssl/ ;
> then when I build the i686 libssl and libcrypto libraries (only) for i686,
> using the same Configure arguments with only
> --libdir changed from lib64 to lib32 , these symbols are declared in the
> headers but not defined in the i686 version
> of the libraries , so that, for instance, the openssh configure succeeds for
> x86_64 but fails for i686 :
>
>
>
> configure:10105: /usr/bin/gcc -m32 -o conftest -march=i686 -mtune=generic -g
> -O2 -fPIC -DPIC -Wa,--compress-debug-sections -Wall -Wpointer-arith
> -Wuninitialized -Wsi\
> gn-compare -Wformat-security -Wno-pointer-sign -Wno-unused-result
> -fno-strict-aliasing -fno-builtin-memset -fstack-protector-all -I/usr/include
> -L/usr/lib -Wl,-L/us\
> r/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/32,-L/usr/lib64/gcc/x86_64-pc-linux-gnu/lib32,-L/usr/lib32,-L/lib32,-R/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/32:/usr/lib64/gc\
> c/x86_64-pc-linux-gnu/4.6.0/lib32:/usr/lib32:/lib32,--dynamic-linker,/lib32/ld-linux.so.2
> -fstack-protector-all conftest.c -lcrypto -lssl -ldl -lutil -lz -lnsl >&5
> /usr/bin/ld: skipping incompatible /usr/lib/libcrypto.so when searching for
> -lcrypto
> /usr/bin/ld: skipping incompatible /usr/lib/libcrypto.a when searching for
> -lcrypto
> /usr/bin/ld: skipping incompatible /usr/lib/libssl.so when searching for -lssl
> /usr/bin/ld: skipping incompatible /usr/lib/libssl.a when searching for -lssl
> /usr/bin/ld: skipping incompatible /usr/lib/libdl.so when searching for -ldl
> /usr/bin/ld: skipping incompatible /usr/lib/libdl.a when searching for -ldl
> /usr/bin/ld: skipping incompatible /usr/lib/libutil.so when searching for
> -lutil
> /usr/bin/ld: skipping incompatible /usr/lib/libutil.a when searching for
> -lutil
> /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
> /usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
> /usr/bin/ld: skipping incompatible /usr/lib/libnsl.so when searching for -lnsl
> /usr/bin/ld: skipping incompatible /usr/lib/libnsl.a when searching for -lnsl
> /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
> /usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_unwrap_key'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_set_decrypt_key'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `ENGINE_load_gost'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_ofb128_encrypt'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_cbc_encrypt'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_cfb128_encrypt'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_cfb1_encrypt'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_set_encrypt_key'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_ecb_encrypt'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_wrap_key'
> /usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../lib32/libcrypto.so:
> undefined reference to `AES_cfb8_encrypt'
> collect2: ld returned 1 exit status
>
> I suggest wrapping those declarations in /usr/include/openssl/aes.h with
> #if ! defined( __i386__ )
>
> #endif
> or something.
>
> Any advice would be much appreciated - how can I best get the same headers
> and --enable-* Configure options to work for
> both i686 and x86_64 Linux platforms so that one set of headers can be used
> for both ?
>
> Thanks & Regards,
>
> Jason Vas Dias <[email protected]>
>
>
>
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]