Bug 185507

Summary: gcc doesn't like -march=$(arch) on x86_64
Product: [Fedora] Fedora Reporter: Jón Fairbairn <jon.fairbairn>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-15 13:55:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jón Fairbairn 2006-03-15 11:33:10 UTC
Description of problem:
gcc rejects x86_64 as a value for -march, but arch (and friends)
all return that string

Version-Release number of selected component (if applicable):
gcc-4.0.2-8.fc4

How reproducible:
always

Steps to Reproduce:
1.echo 'foo' | gcc -E - -march=x86_64
2.
3.
  
Actual results:

# 1 "<stdin>"
:0: error: bad value (x86_64) for -march= switch
:0: error: bad value (x86_64) for -mtune= switch

Expected results:

# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
foo

Additional info:
arch outputs x86_64, as do the config.guess scripts supplied with such packages
as rpm. rpm packages are all named *.x86_64.*

gcc does accept x86-64, but this is not documented (and different from the other
programmes)

This breaks some configure scripts...

Comment 1 Jakub Jelinek 2006-03-15 13:55:32 UTC
Configure scripts that do this are helplessly broken.
There is no such CPU as x86_64, you either don't need to use -march= at all
and just use -m64 to generate 64-bit code, or you should choose some real
CPU (opteron, athlon64, nocona, k8, athlon-fx).  -march=x86-64 is supported
too as a generic 64-bit CPU, but that's the name of the arch, x86_64 is just
mangled name of the arch so that it can be used in config triplets that don't
allow hyphen in the arch name.