Bug 118146

Summary: 7.0-BETA2 buildworld fails when CFLAGS is set to '' before build
Product: Base System Reporter: yuri
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 7.0-BETA2   
Hardware: Any   
OS: Any   

Description yuri 2007-11-20 08:50:01 UTC
Compilation failure occurred on 7.0-BETA2 system during buildworld.

cc -fpic -DPIC -I/usr/local/include  -DTERMIOS -DANSI_SOURCE -I/usr/src/secure/l
ib/libcrypto/../../../crypto/openssl -I/usr/src/secure/lib/libcrypto/../../../cr
ypto/openssl/crypto -I/usr/obj/usr/src/secure/lib/libcrypto -DOPENSSL_THREADS -D
DSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_IDEA -DL_ENDIAN -DNO_IDEA -std=gnu89  -c /
usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/engine/eng_openssl.c
 -o eng_openssl.So
cc -fpic -DPIC -I/usr/local/include  -DTERMIOS -DANSI_SOURCE -I/usr/src/secure/l
ib/libcrypto/../../../crypto/openssl -I/usr/src/secure/lib/libcrypto/../../../cr
ypto/openssl/crypto -I/usr/obj/usr/src/secure/lib/libcrypto -DOPENSSL_THREADS -D
DSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_IDEA -DL_ENDIAN -DNO_IDEA -std=gnu89  -c /
usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/engine/eng_padlock.c
 -o eng_padlock.So
/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/engine/eng_padlock.
c: In function 'padlock_xcrypt_ecb':
/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/engine/eng_padlock.
c:445: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm
'
/usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/engine/eng_padlock.
c:445: error: 'asm' operand has impossible constraints
*** Error code 1

Fix: 

make sure CFLAGS either empty or has some -Ox options before buildworld.
But compile should be successful even with CFLAGS="".
How-To-Repeat: /etc/make.conf has a line "CFLAGS="
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2007-11-20 18:19:55 UTC
My CFLAGS when the problem occurred was set in /etc/make.conf as
CFLAGS=-I/usr/local/include

Yuri
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2007-11-21 02:20:00 UTC
I confirm that after deleting and re-downloading the sources this problem still
exists.

Please investigate.

Yuri
Comment 3 ru freebsd_committer freebsd_triage 2007-11-21 14:37:37 UTC
State Changed
From-To: open->closed

It's documented in make.conf(5) that we don't support optimization 
levels other than -O and -O2, and specifying an empty CFLAGS is 
equivalent to -O0, which breaks the i386 build in this case.