Bug 73933 - Compiling with -mcpu fails on code including sys/user.h
Summary: Compiling with -mcpu fails on code including sys/user.h
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: sparc64 (show other bugs)
Version: 5.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-sparc64 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-14 13:50 UTC by Tim Bishop
Modified: 2004-11-14 19:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Bishop freebsd_committer freebsd_triage 2004-11-14 13:50:26 UTC
	If I optimise for my ultrasparc 2 processor by using the
	compile option:

	-mcpu=ultrasparc

	I get the following build failure:

	/usr/include/sys/user.h:105:2: #error "Unknown architecture"

Fix: 

Unsure. There's some tests in user.h which are all failing.
	Maybe another case needs to be added?
How-To-Repeat: 	Simple code to demonstrate this:

	#include <stdio.h>
	#include <sys/param.h>
	#include <sys/user.h>
	int main() {
		printf("Hello World\n");
		return 0;
	}

	Testing compiling normally and with -mcpu:

	gcc -Wall -o hello hello.c
	gcc -Wall -mcpu=ultrasparc -o hello2 hello.c
	In file included from hello.c:3:
	/usr/include/sys/user.h:105:2: #error "Unknown architecture"

	The first compile worked fine, and the second failed.
Comment 1 David E. O'Brien freebsd_committer freebsd_triage 2004-11-14 19:55:32 UTC
State Changed
From-To: open->closed

CPU ultrasparc is the default.  Unfornately the configuring for what 
mcpu should parse is a little convoluted and this is why using mcpu=ultrasparc 
doesn't work. But if it did work, it wouldn't make any difference.