# Problem compiling 7-STABLE



## hsn (Jul 15, 2012)

I am trying to compile 7-STABLE on 7.3p5. I have in /etc/make.conf


```
CPUTYPE?=core2
CFLAGS= -O2 -pipe
COPTFLAGS= -O2 -pipe
```
which worked well for previous version and it works on 8.2/8.3 too but for some unknown reason it fails here.


```
===> asn1_compile (depend)
sed -e '106s/"/"#ifdef __PARSE_UNITS_H__\\n/;' -e '106s/",/\\n#endif\\n",/' /usr/src/kerberos5/tools/asn1_compile/../../../crypto/heimdal/lib/asn1/gen_glue.c > gen_glue-fixed.c
lex -t  /usr/src/kerberos5/tools/asn1_compile/../../../crypto/heimdal/lib/asn1/lex.l > lex.c
yacc -d -o parse.c /usr/src/kerberos5/tools/asn1_compile/../../../crypto/heimdal/lib/asn1/parse.y
cd /usr/src/kerberos5/tools/asn1_compile/../make-print-version && make
cc -O2 -pipe -march=core2 -DHAVE_CONFIG_H -I/usr/src/kerberos5/tools/make-print-version/../../include  -c /usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c
/usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c:1: error: bad value (core2) for -march= switch
/usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c:1: error: bad value (core2) for -mtune= switch
*** Error code 1

Stop in /usr/src/kerberos5/tools/make-print-version.
*** Error code 1
```


----------



## wblock@ (Jul 15, 2012)

hsn said:
			
		

> I am trying to compile 7-STABLE on 7.3p5. I have in /etc/make.conf
> 
> 
> ```
> ...



Don't set CFLAGS or COPTFLAGS.  By doing so you force everything to build with those flags.  And since you're setting them to what are normally the default values anyway, there is zero benefit.

No idea about setting CPUTYPE on FreeBSD 7.


----------



## hsn (Jul 15, 2012)

I tried to compile 7.4 with my settings and it works fine. Only 7-STABLE has problems.


----------



## wblock@ (Jul 15, 2012)

Does 7-STABLE compile when you remove the custom CFLAGS and COPTFLAGS?  If so, this is a "it hurts when I do this" problem.


----------



## hsn (Jul 15, 2012)

it does not. Same error:


```
cd /usr/src/kerberos5/tools/asn1_compile/../make-print-version && make
cc -O2 -fno-strict-aliasing -pipe -march=core2 -DHAVE_CONFIG_H -I/usr/src/kerberos5/tools/make-print-version/../../include  -c /usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c
/usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c:1: error: bad value (core2) for -march= switch
/usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c:1: error: bad value (core2) for -mtune= switch
*** Error code 1

Stop in /usr/src/kerberos5/tools/make-print-version.
*** Error code 1
```

but there are no code changes in kerberos5 which can affect broken 7-stable but working 7.4

http://svnweb.freebsd.org/base/stable/7/kerberos5/


----------



## hsn (Jul 15, 2012)

i didnt get why cc sometimes complains about -march=core2 and sometimes not:


```
cc -O2 -fno-strict-aliasing -pipe -march=core2 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir -DHAVE_STRERROR -DHAVE_UNISTD_H -I/usr/src/usr.sbin/zic/zic/.. -I/usr/src/usr.sbin/zic/zic/../../../lib/libc/stdtime   -o zic zic.o ialloc.o scheck.o
===> usr.sbin/zic/zdump (all)
cc -O2 -fno-strict-aliasing -pipe -march=core2 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir -I/usr/src/usr.sbin/zic/zdump/.. -I/usr/src/usr.sbin/zic/zdump/../../../lib/libc/stdtime  -c /usr/src/usr.sbin/zic/zdump/../zdump.c
cc -O2 -fno-strict-aliasing -pipe -march=core2 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir -I/usr/src/usr.sbin/zic/zdump/.. -I/usr/src/usr.sbin/zic/zdump/../../../lib/libc/stdtime  -c /usr/src/usr.sbin/zic/zdump/../ialloc.c

[ skip ]

===> make-print-version (obj)
/usr/obj/lib32/usr/src/kerberos5/tools/make-print-version created for /usr/src/kerberos5/tools/make-print-version
===> make-roken (obj)
/usr/obj/lib32/usr/src/kerberos5/tools/make-roken created for /usr/src/kerberos5/tools/make-roken
===> asn1_compile (obj)
/usr/obj/lib32/usr/src/kerberos5/tools/asn1_compile created for /usr/src/kerberos5/tools/asn1_compile
cd /usr/src/kerberos5/tools;  MAKEOBJDIRPREFIX=/usr/obj/lib32 make DESTDIR= depend
===> make-print-version (depend)
rm -f .depend
mkdep -f .depend -a    -DHAVE_CONFIG_H -I/usr/src/kerberos5/tools/make-print-version/../../include /usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c
echo make-print-version: /usr/lib/libc.a  >> .depend
===> make-roken (depend)
awk -f /usr/src/kerberos5/tools/make-roken/../../../crypto/heimdal/lib/roken/roken.awk /usr/src/kerberos5/tools/make-roken/../../../crypto/heimdal/lib/roken/roken.h.in > make-roken.c
rm -f .depend
mkdep -f .depend -a    -DHAVE_CONFIG_H -I/usr/src/kerberos5/tools/make-roken/../../include make-roken.c
echo make-roken: /usr/lib/libc.a  >> .depend
===> asn1_compile (depend)
sed -e '106s/"/"#ifdef __PARSE_UNITS_H__\\n/;' -e '106s/",/\\n#endif\\n",/' /usr/src/kerberos5/tools/asn1_compile/../../../crypto/heimdal/lib/asn1/gen_glue.c > gen_glue-fixed.c
lex -t  /usr/src/kerberos5/tools/asn1_compile/../../../crypto/heimdal/lib/asn1/lex.l > lex.c
yacc -d -o parse.c /usr/src/kerberos5/tools/asn1_compile/../../../crypto/heimdal/lib/asn1/parse.y
cd /usr/src/kerberos5/tools/asn1_compile/../make-print-version && make
cc -O2 -fno-strict-aliasing -pipe -march=core2 -DHAVE_CONFIG_H -I/usr/src/kerberos5/tools/make-print-version/../../include  -c /usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c
/usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c:1: error: bad value (core2) for -march= switch
/usr/src/kerberos5/tools/make-print-version/../../../crypto/heimdal/lib/vers/make-print-version.c:1: error: bad value (core2) for -mtune= switch
*** Error code 1
```


----------



## wblock@ (Jul 15, 2012)

It's hard to tell what you've done.  My guess is that parts of the older FreeBSD 7 don't like the core2 CPUTYPE because buildworld has not been done yet.


----------



## hsn (Jul 16, 2012)

I just installed 7.4 instead of 7-stable.


----------



## hsn (Jul 16, 2012)

With 7.4 world, 7-STABLE still fails to compile with above error.


----------

