Bug 539832 - Weird preprocessor behaviour
Summary: Weird preprocessor behaviour
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 12
Hardware: powerpc
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 550279 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-21 09:07 UTC by Julian Sikorski
Modified: 2009-12-24 17:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-11-23 07:57:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test case (283 bytes, text/plain)
2009-11-21 09:07 UTC, Julian Sikorski
no flags Details

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. ***


Note You need to log in before you can comment on or make changes to this bug.