CPUTYPE for gcc3

YONETANI Tomokazu qhwt+dragonfly-submit at les.ath.cx
Mon Jan 26 04:39:17 PST 2004

Now that great efforts are made to enable gcc3 on DragonFly,
I decided to build kernel/world with gcc3, and possibly with
-march=pentiumN flag. Just adding the flag to CFLAGS breaks the
buildworld because newer -march flags won't work with gcc2,
and part of buildworld falls back to gcc2 even when CCVER=gcc3
is specified. The idea is to make bsd.cpu.mk sensitive
to CCVER so as to enable newer flags only when gcc3 is in use.


what it does is:
- split bsd.cpu.mk into bsd.gcc2.cpu.mk and bsd.gcc3.cpu.mk,
  keeping the old bsd.cpu.mk as the former, and bsd.cpu.mk
  from FreeBSD-CURRENT as the latter.
- include bsd.cpu.mk from gnu/lib/gcc2/Makefile so that CPUTYPE
  is re-evaluated after setting CCVER=gcc2.
- add CCVER=gcc2 to lib/libc_r/Makefile to force building
  libc_r with gcc2.

after successfully applying the patch, you can add
. makeenv CCVER
to your make.conf without breaking the buildworld/buildkernel.

using gcc2 to build libc_r may not be necessary in the future,
but at the moment building libc_r with gcc3 breaks any programs
linked with -pthread (Mozilla, for example).

More information about the Submit mailing list