Bug 436374

Summary: Error: file number 2 already allocated
Product: [Fedora] Fedora Reporter: Doug Chapman <dchapman>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-06 21:13:40 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:
Bug Depends On:    
Bug Blocks: 163350    
Attachments:
Description Flags
asm file from g++ -g -S foo.cc none

Description Doug Chapman 2008-03-06 20:55:28 UTC
Description of problem:

This is an odd one.  It was first seen with "real" code but the reproducer is
simply this:

create a file "foo.cc" with nothing but:

#include <iostream>

then build it in 2 steps:
g++ -g -S foo.cc
g++ -g foo.s

foo.s: Assembler messages:
foo.s:155: Error: file number 2 already allocated


If I do it in 1 step as normal:
g++ -g foo.cc

it works just fine.  There is at least 1 package in Fedora (I forget which one
right now) that for some reason does this in 2 steps and breaks.

I realize you may not have easy access to an ia64 box.  I will attach the .s
file which I imagine might be helpful.  Don't hesitate to ask me to try things
out to get more info.

Version-Release number of selected component (if applicable):
gcc-4.3.0-0.11


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Doug Chapman 2008-03-06 20:55:28 UTC
Created attachment 297101 [details]
asm file from g++ -g -S foo.cc

Comment 2 Jakub Jelinek 2008-03-06 21:13:40 UTC
User error.  You can't use -g twice.  Either you use -g to compile foo.cc, then
foo.s will already contain debug info, or you assemble with -g and the assembler
adds debugging info for the assembler.  If you both compile with -g, the
assembler already contains debug info and thus adding assembler debug info for
it is a bug.

Comment 3 Doug Chapman 2008-03-06 21:26:39 UTC
Thanks, I will get the offending package to fix their makefiles.

- Doug