CPUTYPE for gcc3

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jan 26 07:38:41 PST 2004


On Mon, Jan 26, 2004 at 09:37:33PM +0900, YONETANI Tomokazu wrote:
> Hello.
> 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.

I had a similiar patch in the pipe.

> http://les.ath.cx/DragonFly/gcc3-cputype.diff.gz
> 
> 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.

Well, I called them bsd.cpu.${CCVER}.mk and added the ability to specify
which an alternative file for non-system compilers. It will bark if you
don't do that ;-)

> - include bsd.cpu.mk from gnu/lib/gcc2/Makefile so that CPUTYPE
>   is re-evaluated after setting CCVER=gcc2.

This one needs further investigation. I'm currently thinking about
the order of including ../Makefile.inc and bsd.cpu.mk which should
fix this. Anyway I'd prefer to manually include ../Makefile.inc.

> - add CCVER=gcc2 to lib/libc_r/Makefile to force building
>   libc_r with gcc2.

I want to investigate this too. That's why I said buildworld with gcc3
is not recommented.

> after successfully applying the patch, you can add
> CCVER=gcc3
> .makeenv CCVER

The .makeenv should be unnecessary, I changed bsd.own.mk to always
re-export 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).

Thanks for the report, even though I didn't commit your patch.

Joerg





More information about the Submit mailing list