Subject: pkg/25759: gives wrong flags, can not compile packages
To: None <>
From: None <>
List: pkgsrc-bugs
Date: 05/31/2004 03:05:54
>Number:         25759
>Category:       pkg
>Synopsis: gives wrong flags, can not compile packages
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 31 11:13:00 UTC 2004
>Originator:     Alejandro Yoo
>Release:        NetBSD 1.6.2
System: NetBSD 1.6.2 NetBSD 1.6.2 (GENERIC) #0: Tue Feb 10 21:53:10 UTC 2004 i386
Architecture: i386
Machine: i386
	After a fresh install of NetBSD 1.6.2 -with fresh cvsuped pkgsrc-, installing cpuflags (/usr/pkgsrc/devel/cpuflags) with "make install clean clean-depends" makes the system no longer able to compile any packages.
	Cpuflags installs correctly, and
		.sinclude "/usr/pkg/share/mk/"
	is added to /etc/mk.conf (which in my case I had to create, because it was a fresh installed system).
	Executing "cpuflags" returns:
		-march=pentium3 -mno-sse
	Trying to compile /usr/pkgsrc/lang/perl58:

	What optimizer/debugger flag should be used? [-O2 -march=pentium3 -mno-sse]  
	Any additional cc flags? [-fno-strict-aliasing -I/usr/pkg/include]  
	Let me guess what the preprocessor flags are...
	Any additional ld flags (NOT including libraries)?
	[-Wl,-R/usr/pkg/lib  -L/usr/pkg/lib]  
	Checking your choice of C compiler and flags for coherency...
	I've tried to compile and run the following simple program:

	#include <stdio.h>
	int main() { printf("Ok\n"); return(0); }

	I used the command:

		gcc -o try -O2 -march=pentium3 -mno-sse -fno-strict-aliasing -I/usr/pkg/include -Wl,-R/usr/pkg/lib -L/usr/pkg/lib try.c -lm -lcrypt

	and I got the following output:

	cc1: Invalid option `no-sse'
	cc1: bad value (pentium3) for -march= switch
	I can't compile the test program.
	You have a BIG problem.  Shall I abort Configure [y]  
	Ok.  Stopping Configure.
	*** Error code 1

	make: stopped in /usr/pkgsrc/lang/perl58
	*** Error code 1


	Explained above. Other packages return similar errors. 
	Deleting the .sinclude line from /etc/mk.conf makes de system able to compile packages again, but they are not cpu specific.