Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 May 2003 14:33:25 +0200
From:      Joerg Wunsch <j@uriah.heep.sax.de>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/devel/avr-libc Makefile
Message-ID:  <20030519143325.H2937@uriah.heep.sax.de>
In-Reply-To: <20030519121239.GA6087@rot13.obsecurity.org>; from kris@obsecurity.org on Mon, May 19, 2003 at 05:12:39AM -0700
References:  <200305190828.h4J8S8l0069634@repoman.freebsd.org> <20030519094115.GC1035@sunbay.com> <20030519115435.C2937@uriah.heep.sax.de> <20030519104604.GB17366@sunbay.com> <20030519125334.D2937@uriah.heep.sax.de> <20030519114332.GG17366@sunbay.com> <20030519115339.GI17366@sunbay.com> <20030519121239.GA6087@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
As Kris Kennaway wrote:

> Let's suppose for the sake of argument that we lived in joerg's ideal
> world where bsd.cpu.mk did not exist.  A user wishing to specify
> CPU-specific gcc optimizations for their native binaries would set
> CFLAGS="-O -pipe -march=whatever" in /etc/make.conf.  This would then
> be picked up by bsd.port.mk and passed into the port build environment
> as you demonstrated.  The cross-compiler would then fail in exactly
> the same place when it encounters the invalid -march.

Except that it would not default to this, so the local administrator
would knew whom to blame. ;-)

> The bug here appears to be that the cross-gcc binary is using the host
> gcc CFLAGS entry in the first place, instead of a default, safe CFLAGS
> (like "-O -pipe").

That's picked up via GNU configure, it seems.  However, it's always
been doing that way.  Nevertheless, the current brokeness must have
been introduced recently somehow.  On my around 5.0 system, overriding
NO_CPU_CFLAGS in the Makefile /did/ help out of the dilemma.

Normally, picking up the default optimization/debugging settings in
the configure step is considered a desired feature (in the past, many
ports didn't do this, so ports maintainers invented their own hacks,
and we complained why they didn't use the system's setting).  However,
the default CFLAGS of the system should not include any compiler or
architecture specific stuff that way (just -Osomething -gsomething
only).  Strictly spoken, not even -pipe would be allowed, because some
other cross-compiler, or someone trying to use icc for example, might
fall across it.  (I don't understand why -pipe hasn't been made the
default in gcc.)

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030519143325.H2937>