From owner-freebsd-ports@FreeBSD.ORG Thu Jun 30 21:42:47 2005 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E25DE16A41C for ; Thu, 30 Jun 2005 21:42:47 +0000 (GMT) (envelope-from cracauer@schlepper.zs64.net) Received: from schlepper.zs64.net (schlepper.zs64.net [212.12.50.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79E3843D1F for ; Thu, 30 Jun 2005 21:42:47 +0000 (GMT) (envelope-from cracauer@schlepper.zs64.net) Received: from schlepper.zs64.net (schlepper [212.12.50.230]) by schlepper.zs64.net (8.13.1/8.12.9) with ESMTP id j5ULgkc8074168 for ; Thu, 30 Jun 2005 23:42:46 +0200 (CEST) (envelope-from cracauer@schlepper.zs64.net) Received: (from cracauer@localhost) by schlepper.zs64.net (8.13.1/8.12.9/Submit) id j5ULgkJ8074167 for ports@freebsd.org; Thu, 30 Jun 2005 17:42:46 -0400 (EDT) (envelope-from cracauer) Date: Thu, 30 Jun 2005 17:42:46 -0400 From: Martin Cracauer To: ports@freebsd.org Message-ID: <20050630174246.A73270@cons.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Cc: Subject: Problem with mingw port, obeys $(CPUTYPE) but shouldn't X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 21:42:48 -0000 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 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.