This is the mail archive of the mailing list for the GCC 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: [libgomp, libiberty, libobjc] Fix gnu11 fallout on Solaris 10+

Richard Henderson <> writes:

> On 10/22/2014 04:43 AM, Rainer Orth wrote:
>> The gnu11 patch broke Solaris 10 and 11 bootstrap: <sys/feature_test.h>
>> has
>> /*
>>  * It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application
>>  * using c99.  The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b,
>>  * and POSIX.1c applications. Likewise, it is invalid to compile an XPG6
>>  * or a POSIX.1-2001 application with anything other than a c99 or later
>>  * compiler.  Therefore, we force an error in both cases.
>>  */
>> #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
>> #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
>> 	and pre-2001 POSIX applications"
>> #elif !defined(_STDC_C99) && \
>> 	(defined(__XOPEN_OR_POSIX) && defined(_XPG6))
>> #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
>> 	require the use of c99"
>> #endif
>> so the headers now error out for any definition of (say) _XOPEN_SOURCE < 600.
> Hum.
> Does it hurt us to simply update to 600 everywhere?  If we can, I'd prefer that
> as a solution.  But if that causes more problems than it solves, I'm ok with
> this as a solution.

This certainly depends on what the oldest systems we still support are.
E.g. in Solaris 8 (no longer supported on mainline, just serving as
illustration) <sys/feature_test.h> we have for XPG5/UNIX 98:

#if (_XOPEN_SOURCE - 0 == 500)
#define _XPG5

Changing _XOPEN_SOURCE to 600 loses this completely.  Same on Solaris 9
(equally no longer supported), and at least some pre-XPG6 systems, I fear.
I cannot tell if we still support any of those, though.

This might not even an issue for the cases as hand: e.g. even Solaris 8
<pthread.h> defines PTHREAD_MUTEX_RECURSIVE (the reason to define
_XOPEN_SOURCE in libgomp/config/posix/lock.c) unconditionally.

We might as well try and watch out for breakage, given that we are still
in stage1.

> I would like the comments updated to mention the reason for XPG6; just saying
> that Solaris requires it for C99 and later seems sufficient.

Sure, will do once we've decided which route to follow.

And even with the _XOPEN_SOURCE business out of the way, there's still
the question what to do about _POSIX_SOURCE in libiberty/sigsetmask.c.
Given that it was introduced almost 20 years ago, it may well be
unnecessary for the systems we still care about.


Rainer Orth, Center for Biotechnology, Bielefeld University

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