C preprocessor, mips assembler and #ident (root cause of PRs 2620 and 5789)

Billinghurst, David (CRTS) David.Billinghurst@riotinto.com
Sun Mar 3 15:33:00 GMT 2002

There are two PRs relating to compiling .S files on irix6.5
 - other/2620: Filenames differ only in case 
 - libgcj/5789: boehm-gc won't build on irix

The root cause of these is that:
 - some irix headers contain #ident directives
 - gcc .S files include these headers
 - the gcc C preprocessor passes #ident lines unconditionally
 - the irix assembler chokes on #ident lines

Two possible fixes are:

 - adding an option to cpp0 to drop #ident directives and 
   using this for .S files on irix

 - working around the problem when compiling .S files by:
    - passing the -Wp,-P to cpp so that line numbers are dropped
    - removing -nocpp from the assembler flags so that the irix
      cpp is run on the .s file.  
   The irix cpp will strip out #ident directives, but chokes on 
   gcc cpp #line directives

Are either of these viable for 3.1

More information about the Gcc-bugs mailing list