cvs commit: ports/devel/avr-libc Makefile

Ruslan Ermilov ru at FreeBSD.org
Mon May 19 05:25:00 PDT 2003


On Mon, May 19, 2003 at 05:12:39AM -0700, Kris Kennaway wrote:
> On Mon, May 19, 2003 at 02:53:40PM +0300, Ruslan Ermilov wrote:
> 
> >  # Work around the braind*** introduced by <bsd.cpu.mk> in freebsd-current.
> >  MAKE_ENV=	NO_CPU_CFLAGS=true
> > +# Prevent bsd.port.mk from setting CFLAGS/CXXFLAGS to unfriendly values.
> > +CFLAGS=		-O -pipe
> > +CXXFLAGS=	-O -pipe
> 
> Hmm.  I see the problem - essentially it boils down to using the host
> compiler CFLAGS when running the cross-compiler, and has nothing to do
> with bsd.cpu.mk.
> 
Nice, so all parties agree that bsd.cpu.mk is not guilty (that speaks
the share/mk/ maintainer ;-).

> 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.
> 
> 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").
> 
Yes, precisely so.  I'm not even sure if NO_CPU_CFLAGS is really
necessary after my patch, but I can't check it easily.

I've looked in the CVS history, and we appear to set CFLAGS in
MAKEENV only to make gmake(1) happy, to make it use optimized
CFLAGS, which is good.

Perhaps then, bsd.port.mk could be fixed to not add CFLAGS and
CXXFLAGS to environment, if specifically asked not to, like
in this case.  Or perhaps this port should set CFLAGS to -O
-pipe -mavr, if such thing ever exists.  ;)


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru at sunbay.com		Sunbay Software AG,
ru at FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20030519/dd4308cb/attachment.bin


More information about the cvs-all mailing list