Subject: Re: Build customized NetBSD 2.0
To: None <netbsd-help@netbsd.org>
From: None <sigsegv@rambler.ru>
List: netbsd-help
Date: 08/10/2004 17:17:09
Dmitry Ivanov wrote:

>On Tue, Aug 10, 2004 at 08:37:16AM +0200, Jukka Salmi wrote:
>  
>
>>Set COPTS+=-Os (see mk.conf(5)).
>>    
>>
>
>I set COPTS+=-Os -pipe. Now build.sh fails with:
>
>###########################
>#   compile  racoon/crypto_openssl.o
>/home/web/tmp/netbsd/src/obj/tooldir.Linux-2.6.7-unknown/bin/i386--netbsdelf-gcc
>-g -Os -pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
>-Wno-sign-compare -Wno-traditional -Wno-uninitialized  -Werror   -DINET6
>-DHAVE_FUNCTION_MACRO=1 -DHAVE_LIBCRYPTO=1 -DHAVE_LIBL=1 -DHAVE_LIBY=1
>-DENABLE_IPV6=1 -DADVAPI=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1
>-DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_TIME_H=1
>-DHAVE_UNISTD_H=1 -DHAVE_STDARG_H=1 -DHAVE_VARARGS_H=1 -DTIME_WITH_SYS_TIME=1
>-DRETSIGTYPE=void -DHAVE_VPRINTF=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_SELECT=1
>-DHAVE_SOCKET=1 -DHAVE_STRERROR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOUL=1
>-DHAVE_STRDUP=1 -DHAVE_GETIFADDRS=1 -DHAVE_ARC4RANDOM=1 -DHAVE_PFKEYV2
>-DYIPS_DEBUG -DIPSEC  -I. -I/home/web/tmp/netbsd/src/crypto/dist/kame/racoon
>-DSYSCONFDIR=\"/etc/racoon\" -DHAVE_OPENSSL_OPENSSLV_H=1 -DYY_NO_UNPUT
>-I/home/web/tmp/netbsd/src/crypto/dist/kame/libipsec
>-I/home/web/tmp/netbsd/src/crypto/dist/kame/racoon/missing -DHAVE_GSSAPI
>-I/home/web/tmp/netbsd/src/obj/destdir.i386/usr/include/krb5
>-DHAVE_SIGNING_C=1 -DHAVE_OPENSSL_PEM_H=1 -DHAVE_OPENSSL_X509_H=1
>-DHAVE_OPENSSL_EVP_H=1  -nostdinc -isystem
>/home/web/tmp/netbsd/src/obj/destdir.i386/usr/include  -c    
>/home/web/tmp/netbsd/src/crypto/dist/kame/racoon/crypto_openssl.c
>
>/home/web/tmp/netbsd/src/crypto/dist/kame/racoon/crypto_openssl.c:
> In function `eay_str2asn1dn':
>/home/web/tmp/netbsd/src/crypto/dist/kame/racoon/crypto_openssl.c:186:
> warning: dereferencing type-punned pointer will break strict-aliasing rules
>/home/web/tmp/netbsd/src/crypto/dist/kame/racoon/crypto_openssl.c:
> In function `eay_cmp_asn1dn':
>/home/web/tmp/netbsd/src/crypto/dist/kame/racoon/crypto_openssl.c:215:
> warning: dereferencing type-punned pointer will break strict-aliasing rules
>/home/web/tmp/netbsd/src/crypto/dist/kame/racoon/crypto_openssl.c:218:
> warning: dereferencing type-punned pointer will break strict-aliasing rules
>
>*** Failed target:  crypto_openssl.o
>##################################
>
>I repeated it twice and got the same message.
>It compiles fine wihtout COPTS.
>Could it be OpenSSL/gcc issue or cross-build problem?
>
>  
>
I think a Make file inserts the following compiler flag when compiling 
kernel "-Werror" which means the build will fail if there are any 
compiler warnings. I guess tweaking compiler flags for optimization can 
produce such compiler warnings, try leaving out "-Os" flags etc, and use 
"-march" flag instead, i.e. this is what I use on my athlon machine:

COPTS+=-pipe -march=athlon-tbird -m3dnow -mmmx