Andy Polyakov via RT wrote:
>> On my old Debian box during OpenSSL 0.9.7 build, make fails:
>>
>>
>> make[2]: Entering directory `/usr/local/openssl/crypto/rand'
>> gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -c -o md_rand.o md_rand.c
>> gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -c -o randfile.o randfile.c
>> gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -c -o rand_lib.o rand_lib.c
>> gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -c -o rand_err.o rand_err.c
>> gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -c -o rand_egd.o rand_egd.c
>> gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -c -o rand_win.o rand_win.c
>> gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -c -o rand_unix.o rand_unix.c
>> /tmp/cch1r2js.s: Assembler messages:
>> /tmp/cch1r2js.s:54: Error: Incorrect register `%rbp' used with `l' suffix
>> /tmp/cch1r2js.s:65: Error: Incorrect register `%rbp' used with `l' suffix
>> make[2]: *** [rand_unix.o] Error 1
>> make[2]: Leaving directory `/usr/local/openssl/crypto/rand'
>> make[1]: *** [subdirs] Error 1
>> make[1]: Leaving directory `/usr/local/openssl/crypto'
>> make: *** [sub_all] Error 1

>
> This was discussed once, it has to be compiler bug.
>
>> Can you help me?

>
> There is nothing we can do, drop optimization level or upgrade compiler. A.


To confirm after getting the build fail execute:


cd crypto/rand

gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT
-DDSO_DLFCN -DHA VE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -DL_ENDIAN -DTERMIO
-O3 -Wall -DMD32_REG_T=int -c -S -dp -o rand_unix.s rand_unix.c

gcc -I.. -I../.. -I../../include -c -o rand_unix.o rand_unix.s

Then post the created file "rand_unix.s" on the web and notify the list
of the exact error you got and where it can be downloaded from on the web.

Also please post you version of "gcc -v" and the version or Linux
distribution you have installed it came with to the list so maybe it can
be added to an FAQ of known problematic compiler versions.


Basically if there is no inline assembler directives __asm__ in play
then using an "l" suffix instruction to target the "%rbp" register is
invalid assembler, for example "movl $42,%rbp" this is because the "l"
suffix on IA32 means a 32bit wide operation but the %rbp is a 64bit wide
register so the "q" should be used instead making it "movq $42,%rbp".


Darryl
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org