With a recent libsanitizer merge from upstream, we're now seeing a lot
of ASAN test suite failures with the following error:

  ==26426==ASan runtime does not come first in initial library list; you should
  either link runtime to your application or manually preload it with 
LD_PRELOAD.

This is caused by powerpc*-linux not defining LIBASAN_EARLY_SPEC which is
defined in gnu-user.h.  It looks like all *-linux architectures include
gnu-user.h except for powerpc*-linux.  The following patch makes powerpc*-linux
match the other linux architectures... and fixes a compiler error when we
try to redefine CC1_SPEC.

This passed bootstrap and regtesting on powerpc64-linux with no regressions.
Ok for mainline?

Peter

        * config.gcc (powerpc*-*-linux*): Include gnu-user.h in tm_file.
        * config/rs6000/sysv4.h (CC!_SPEC): Undefine it before defining it.

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc      (revision 212572)
+++ gcc/config.gcc      (working copy)
@@ -2243,7 +2243,7 @@ powerpc-*-rtems*)
        tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems 
rs6000/t-ppccomm"
        ;;
 powerpc*-*-linux*)
-       tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
+       tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h 
rs6000/sysv4.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
        tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} 
rs6000/t-ppccomm"
        extra_objs="$extra_objs rs6000-linux.o"
Index: gcc/config/rs6000/sysv4.h
===================================================================
--- gcc/config/rs6000/sysv4.h   (revision 212572)
+++ gcc/config/rs6000/sysv4.h   (working copy)
@@ -539,6 +539,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
 #endif
 
 /* Pass -G xxx to the compiler.  */
+#undef CC1_SPEC
 #define        CC1_SPEC "%{G*} %(cc1_cpu)" \
 "%{meabi: %{!mcall-*: -mcall-sysv }} \
 %{!meabi: %{!mno-eabi: \


Reply via email to