Don't preprocess .S files with -P on Solaris/x86 (PR target/85994)

Message ID yddr2l08azr.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show
  • Don't preprocess .S files with -P on Solaris/x86 (PR target/85994)
Related show

Commit Message

Rainer Orth June 21, 2018, 2:34 p.m.
When bootstrapping gcc on Solaris/x86 with gas, there are a couple of
comparison failures:

i386-pc-solaris2.11/amd64/libgcc/avx_savms64f.o differs
i386-pc-solaris2.11/amd64/libgcc/sse_resms64.o differs
i386-pc-solaris2.11/amd64/libgcc/sse_resms64f_s.o differs

and several more.

The differences occur in the .debug_line sections, where tmp file names
are embedded.

The resulting object files have (in readelf --debug-dump output):

 The Directory Table (offset 0x1b):
  1     /var/tmp/

 The File Name Table (offset 0x26):
  Entry Dir     Time    Size    Name
  1     1       0       0       cc3DRYva.s

while on Linux I see

 The Directory Table (offset 0x1b):
  1     /vol/gcc/src/hg/trunk/local/libgcc/config/i386

 The File Name Table (offset 0x4b):
  Entry Dir     Time    Size    Name
  1     1       0       0       resms64.h

On Linux, linemarkers (# <line> ...) are passed to gas, while on Solaris
they are suppressed by passing -P to cpp for -x assembler-with-cpp.
This was necessary once because old versions of the native assembler
didn't grok them.

However, on closer investigation it turned out that neither the original
Solaris 10/x86 FCS assembler nor the first one to support line markers
(from patch 119961-03) are able to bootstrap gcc any longer for
unrelated reasons.  Obviously, nobody has cared to report that, so I
just drop support for them.  This makes the need for the -P go away,
thus fixing the comparison failures.

Bootstrapped without regressions on i386-pc-solaris2.1[01], will apply
to mainline and gcc-8 branch shortly.


Rainer Orth, Center for Biotechnology, Bielefeld University

2018-05-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/85994
	* config/i386/sol2.h (CPP_SPEC): Don't pass -P for
	-x assembler-with-cpp.


# HG changeset patch
# Parent  74e1ffd73c4cc935c6435b276f4c0d682b4a06d6
Avoid passing -P to cpp on Solaris/x86 (PR target/85994)

diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -51,9 +51,8 @@  along with GCC; see the file COPYING3.  
 #define TARGET_SUN_TLS 1
-/* Solaris 2/Intel as chokes on #line directives before Solaris 10.  */
 #undef CPP_SPEC
-#define CPP_SPEC "%{,assembler-with-cpp:-P} %(cpp_subtarget)"
+#define CPP_SPEC "%(cpp_subtarget)"
 /* GNU as understands --32 and --64, but the native Solaris
    assembler requires -xarch=generic or -xarch=generic64 instead.  */