Problem with mingw port, obeys $(CPUTYPE) but shouldn't

Martin Cracauer cracauer at
Thu Jun 30 21:42:48 GMT 2005

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
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 which is exactly what
we want.  But since 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 Cracauer <cracauer at>
 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.

More information about the freebsd-ports mailing list