cvs commit: ports/devel/avr-libc Makefile

Joerg Wunsch j at uriah.heep.sax.de
Mon May 19 05:40:13 PDT 2003


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. ;-)


More information about the cvs-ports mailing list