Freebsd-7.4 + std gcc 4.2.1 fails to honour -march=i586

Julian H. Stacey jhs at berklix.com
Wed Jul 20 12:35:21 UTC 2011


Hi,
Reference:
> From:		John Baldwin <jhb at freebsd.org> 
> Date:		Wed, 20 Jul 2011 07:48:05 -0400 
> Message-id:	<201107200748.05786.jhb at freebsd.org> 

John Baldwin wrote:
> On Wednesday, July 20, 2011 7:33:26 am Julian H. Stacey wrote:
> > What should FreeBSD do ? 
> > 	Add a comment to man gcc ... that -march=i586 is not
> > 	enough, & feed the comment back to gcc project & see how
> > 	they want to handle it ?
> 
> No, this is not a GCC bug.  If you want to use a single build machine that 
> will compile programs for other machines on a network to use, it must use the 
> lowest common denominator for its CPUTYPE in /etc/make.conf.
> 
> The out-of-the-box crt files from a FreeBSD install will work fine on a 486
> and above, so can only get yourself into this quandry by building a new world 
> with a CPUTYPE (or similar CFLAGS) setting in /etc/make.conf that violates 
> this rule.
> 
> You can fix your machine by fixing the CPUTYPE in your build machine and 
> building and installing a new world (do use NO_CLEAN=yes for your build, do a 
> full build).  You will also want to rebuild any other binaries on this machine 
> that you share with other machines.
> 
> -- 
> John Baldwin


Hi John, 
Yes I realise all that now thanks.
The point now is man gcc is misleading/ incomplete:
	"-march=cpu-type
           Generate instructions for the machine type cpu-type."
Those instructions will not make a program that runs on a lesser CPU type
without alternate crt for lesse CPU.

CFLAGS in make.conf is fine for single developer/ host debugging,
but is not appropriate for multi user multi make builds os src/ ports/ other

Its seems just that gcc -march fails to select alternate crt.

One gross ugly solution needing root would be to create chroots,
but Too ugly.

I suggest gcc via -march should also be used as a selection for sub
dirs for crt ? & we should co-operate with gcc project on that,
*BSD & *linux must all face same phenomena so lets not develop
a non standard solution.

Even if we're too lazy to do anything more, we should at least
document it as a patch to man gcc.

Cheers,
Julian
-- 
Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com
 Reply below, not above;  Indent with "> ";  Cumulative like a play script.
 Format: Plain text. Not HTML, multipart/alternative, base64, quoted-printable.


More information about the freebsd-hackers mailing list