This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Link with correct values-*.o files on Solaris (PR target/40411)


Hi Jonathan,

> On 30/01/18 15:51 +0100, Rainer Orth wrote:
>>Hi Joseph,
>>
>>> On Tue, 30 Jan 2018, Rainer Orth wrote:
>>>
>>>> So it seems the following snippet
>>>>
>>>> #define STARTFILE_ARCH_SPEC \
>>>> [...]
>>>>      %{std=c9*|std=iso9899\\:199409|std=c1*:values-Xc.o%s; :values-Xa.o%s} \
>>>>
>>>> seems like the right thing to do, as you said.
>>>
>>> That version would need updating when we add -std=c2x (once there's a C2x
>>> working draft with features being added to it).  If you use std=c* instead
>>> of separate std=c9* and std=c1* you'd avoid needing such a change - but
>>> then of course it would cover -std=c++* for C++.
>>
>>I know, that why I used the current form.  Admittedly it's a maintenance
>>problem (likely to be forgotten in the future).  If we add in -ansi, we
>>can just as well add -std=c++* (thus -std=c*), too.
>>
>>I guess that's the safest option overall, unless Jonathan has objections
>>from a C++ standards perspective.
>
> No objections from me, I'm happy either way.

thanks.  So I've opted to include -ansi for C++ backwards compatibility
and thus -std=c* for ease of maintenance.

Here's what I've commited after another round of testing.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-01-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/40411
	* config/sol2.h (STARTFILE_ARCH_SPEC): Use -std=c*,
	-std=iso9899:199409 instead of -pedantic to select values-Xc.o.

# HG changeset patch
# Parent  53e957fef7f285d1a5bb84f370d5158d238b2ceb
Fix use of Solaris values-Xc.o (PR target/40411)

diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -180,7 +180,10 @@ along with GCC; see the file COPYING3.  
    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.
+   values-Xa.o.  Since -pedantic is a diagnostic option only in GCC, we
+   need to specifiy the -std=c* options and -std=iso9899:199409.  We
+   traditionally include -ansi, which affects C and C++, and also -std=c++*
+   for consistency.
 
    The values-xpg[46].o objects define either or both __xpg[46] variables,
    selecting XPG4 mode (__xpg4) and conforming C99/SUSv3 behavior (__xpg6).
@@ -195,7 +198,7 @@ along with GCC; see the file COPYING3.  
 #undef STARTFILE_ARCH_SPEC
 #define STARTFILE_ARCH_SPEC \
   "%{!shared:%{!symbolic: \
-     %{pedantic:values-Xc.o%s; :values-Xa.o%s} \
+     %{ansi|std=c*|std=iso9899\\:199409: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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]