Link with correct values-*.o files on Solaris (PR target/40411)
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Fri, 12 Jan 2018 09:52:53 +0000 (09:52 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Fri, 12 Jan 2018 09:52:53 +0000 (09:52 +0000)
gcc/testsuite:
PR libfortran/67412
* gfortran.dg/execute_command_line_2.f90: Remove dg-xfail-run-if
on *-*-solaris2.10.

libstdc++-v3:
PR libstdc++/64054
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
Remove dg-xfail-run-if.

gcc:
PR target/40411
* config/sol2.h (STARTFILE_ARCH_SPEC): Don't use with -shared or
-symbolic.
Use values-Xc.o for -pedantic.
Link with values-xpg4.o for C90, values-xpg6.o otherwise.

From-SVN: r256568

gcc/ChangeLog
gcc/config/sol2.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/execute_command_line_2.f90
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc

index 5ed1111f9bd4e510caae3ec39adda95aa705149e..36e8aa8b51109ec87881c02fce4a0f55bed37c2d 100644 (file)
@@ -1,3 +1,11 @@
+2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR target/40411
+       * config/sol2.h (STARTFILE_ARCH_SPEC): Don't use with -shared or
+       -symbolic.
+       Use values-Xc.o for -pedantic.
+       Link with values-xpg4.o for C90, values-xpg6.o otherwise.
+
 2018-01-12  Martin Liska  <mliska@suse.cz>
 
        PR ipa/83054
index 1681313b0cd7aef000af6ea27389d4548f07c7f8..f296cf5731c590c76965d5363632081809cd5d7c 100644 (file)
@@ -169,9 +169,34 @@ along with GCC; see the file COPYING3.  If not see
 #undef SUPPORTS_INIT_PRIORITY
 #define SUPPORTS_INIT_PRIORITY HAVE_INITFINI_ARRAY_SUPPORT
 
+/* Solaris libc and libm implement multiple behaviours for various
+   interfaces that have changed over the years in different versions of the
+   C standard.  The behaviour is controlled by linking corresponding
+   values-*.o objects.  Each of these objects contain alternate definitions
+   of one or more variables that the libraries use to select which
+   conflicting behaviour they should exhibit.  There are two sets of these
+   objects, values-X*.o and values-xpg*.o.
+
+   The values-X[ac].o objects set the variable _lib_version.  The Studio C
+   compilers use values-Xc.o with either -Xc or (since Studio 12.6)
+   -pedantic to select strictly conformant ISO C behaviour, otherwise
+   values-Xa.o.
+
+   The values-xpg[46].o objects define either or both __xpg[46] variables,
+   selecting XPG4 mode (__xpg4) and conforming C99/SUSv3 behavior (__xpg6).
+
+   Since GCC 5, gcc defaults to -std=gnu11 or higher, so we link
+   values-xpg6.o to get C99 semantics.  Besides, most of the runtime
+   libraries always require C99 semantics.
+
+   Since only one instance of _lib_version and __xpg[46] takes effekt (the
+   first in ld.so.1's search path), we only link the values-*.o files into
+   executable programs.  */
 #undef STARTFILE_ARCH_SPEC
-#define STARTFILE_ARCH_SPEC "%{ansi:values-Xc.o%s} \
-                           %{!ansi:values-Xa.o%s}"
+#define STARTFILE_ARCH_SPEC \
+  "%{!shared:%{!symbolic: \
+     %{pedantic:values-Xc.o%s; :values-Xa.o%s} \
+     %{std=c90|std=gnu90:values-xpg4.o%s; :values-xpg6.o%s}}}"
 
 #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
 #define STARTFILE_CRTBEGIN_SPEC "%{static:crtbegin.o%s; \
index fa0c2f1b0edfb9d2c7715c7e5831ac2843e43683..017281df3d2afe7157e8d5d7b11f69c60c73f086 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR libfortran/67412
+       * gfortran.dg/execute_command_line_2.f90: Remove dg-xfail-run-if
+       on *-*-solaris2.10.
+
 2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * lib/target-supports.exp (check_effective_target_branch_cost):
index 3e34f322f07c80fa4da8be609f696d740b2f6e77..5a4e9cc7b8299a812d93a8075b7f1534ba495e0d 100644 (file)
@@ -1,5 +1,4 @@
 ! { dg-do run }
-! { dg-xfail-run-if "PR libfortran/67412" { *-*-solaris2.10 } }
 !
 ! Check that EXECUTE_COMMAND_LINE handles invalid command lines appropriately
 !
index 46908d32ef64f770e146a6c013ac304914897fea..01963be85b516de250ab88f2e50350df18060509 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR libstdc++/64054
+       * testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
+       Remove dg-xfail-run-if.
+
 2018-01-10  François Dumont  <fdumont@gcc.gnu.org>
 
        * include/bits/forward_list.h
index 7c1dde9eb6621dfd6b607ddd46b9e788e7c54bca..f71551b397e095b2c73eb596eff00abd420fce23 100644 (file)
@@ -1,6 +1,5 @@
 // { dg-do run { target c++11 } }
 // { dg-require-string-conversions "" }
-// { dg-xfail-run-if "PR libstdc++/64054" { *-*-solaris* } }
 // { dg-xfail-run-if "broken long double IO" { newlib_broken_long_double_io  } }
 
 // 2014-03-27 Rüdiger Sonderfeld