Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jun 2005 17:42:46 -0400
From:      Martin Cracauer <cracauer@cons.org>
To:        ports@freebsd.org
Subject:   Problem with mingw port, obeys $(CPUTYPE) but shouldn't
Message-ID:  <20050630174246.A73270@cons.org>

next in thread | raw e-mail | index | archive | help
The mingw port seems to inherit CPU-specific settings from
/etc/make.conf which it shouldn't.  It uses an older version of gcc
which is bound not to understand the fancy tuning from the CPU type.

I have
  CPUTYPE=pentium-m
in my /etc/make.conf

and I get

/mnt/part2/usr/ports/devel/mingw-gcc/work/gcc-2.95.3-20010828/gcc/xgcc -B/mnt/part2/usr/ports/devel/mingw-gcc/work/gcc-2.95.3-20010828/gcc/ -B/usr/local/i386-mingw32msvc/bin/ -I/usr/local/i386-mingw32msvc/include -DCROSS_COMPILE -DIN_GCC     -O2 -fno-strict-aliasing -pipe -march=pentium-m -I./include    -DCYGWIN_CROSS_DIR=\"/usr/local/i386-mingw32msvc\" -I. -I. -I./config -I./../include \
  -aux-info SYSCALLS.c.X -S -o tmp-SYSCALLS.s SYSCALLS.c
cc1: bad value (pentium-m) for -march= switch
gmake[1]: *** [SYSCALLS.c.X] Error 1
gmake[1]: Leaving directory `/mnt/part2/usr/ports/devel/mingw-gcc/work/gcc-2.95.3-20010828/gcc'
gmake: *** [all-gcc] Error 2


I think ports like this which use older gcc versions need to kill the
additional CFLAGS from the CPUTYPE definition.

Commenting out CPUTYPE from /etc/make.conf makes the build work.


There is an option NO_CPU_CFLAGS in bsd.cpu.mk which is exactly what
we want.  But since bsd.cpu.mk is invoked before the port's Makefile
is parsed we cannot flip this switch on.  Afterwards it is too late
since $(CFLAGS) has already been "infected" and you can't tell
CPU-specific settings from other settings in that one variable.

If we invoke another fork of make we can successfully set it in an
environment variable.

In general, it is a problem that some CFLAGS settings done by the user
might only apply to what the user thinks is the standard compiler on
the system, no maybe prots which use other compilers than the system
compiler should not obey CFLAGS at all.

Maybe I overlook something simple to set the environment variable
before /usr/share/mk/* is parsed?

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org>   http://www.cons.org/cracauer/
 No warranty.    This email is probably produced by one of my cats 
 stepping on the keys. No, I don't have an infinite number of cats.



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