Bug 539832

Summary: Weird preprocessor behaviour
Product: [Fedora] Fedora Reporter: Julian Sikorski <belegdol>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: bobkaiser1, jakub
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-23 07:57:08 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:
Attachments:
Description Flags
test case none

Description Julian Sikorski 2009-11-21 09:07:57 UTC
Created attachment 372709 [details]
test case

Description of problem:
The problem was originally encountered with sdlmame from RPM Fusion nonfree repository - the source RPMs are huge and thus I'll just link to CVS:

http://cvs.rpmfusion.org/viewvc/rpms/sdlmame/F-10/?root=nonfree

If you drop ARCHOPTS=-Upowerpc from the spec, the build will fail at the linking stage claiming that cpu_disassemble_powerpc is missing. I also found the attached test case in the web. Apparently, for some reason cpu_disassemble_powerpc will get relabeled as cpu_disassemble_1 - first hand info is available on http://forums.ps2dev.org/viewtopic.php?t=12314. As said before, adding -Upowerpc to cflags works this issue around. This affects ppc and ppc64 in  all released branches (F-10, F-11 and F-12; devel is probably affected as well but since ppc was dropped it does not really matter.

Version-Release number of selected component (if applicable):
4.3.2-7

How reproducible:
always

Steps to Reproduce:
1. gcc hello.c -S 
2. head hello.s
  
Actual results:
label cpu_disassemble_1 against cpu_disassemble_powerpc, powerpc name was replaced with 1

Expected results:
No replacement occurs.

Additional info:
I'm not really sure what I'm talking about, I'm just a packager. If you need any more data, I'll relay the information to the appropriate people.

Comment 1 Jakub Jelinek 2009-11-23 07:57:08 UTC
That's not surprising, powerpc is a predefined macro on powerpc unless using strict C89/99 modes.  So, either preprocess with -std=c89 or -std=c99, or -Upowerpc, or better yet don't use identifiers that are predefined.

Comment 2 Julian Sikorski 2009-11-23 10:56:35 UTC
OK, thanks for the info.

Comment 3 Chris Campbell 2009-12-24 17:28:58 UTC
*** Bug 550279 has been marked as a duplicate of this bug. ***