Bug 63765 - [5.0 Regression] libobjc testsuite failures on AIX caused by setting _XOPEN_SOURCE
Summary: [5.0 Regression] libobjc testsuite failures on AIX caused by setting _XOPEN_S...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libobjc (show other bugs)
Version: 5.0
: P3 major
Target Milestone: 5.0
Assignee: Rainer Orth
URL: https://gcc.gnu.org/ml/gcc-patches/20...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-06 18:12 UTC by David Edelsohn
Modified: 2015-02-05 12:23 UTC (History)
3 users (show)

See Also:
Host:
Target: powerpc-ibm-aix*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-11-06 00:00:00


Attachments
proposed patch (466 bytes, patch)
2014-11-07 10:05 UTC, Rainer Orth
Details | Diff
alternative patch (342 bytes, patch)
2014-11-11 14:20 UTC, Rainer Orth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Edelsohn 2014-11-06 18:12:22 UTC
The Objective C testsuite results have regressed from 1 failure to 180 failures after the libobjc patch was applied.
Comment 1 David Edelsohn 2014-11-06 18:13:43 UTC
Confirmed.
Comment 2 Andrew Pinski 2014-11-06 18:35:04 UTC
Caused by:
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00073.html

Let's only define the new value for Solaris instead of for everyone.
Comment 3 Rainer Orth 2014-11-07 09:55:33 UTC
I'll prepare and test a patch along that line over the weekend.

David, just out of interest: could you check what happens if you remove the
definition of _XOPEN_SOURCE in thr.c completely?  In my experience, defining
feature test macros more often than not causes more trouble than it solves
anything.

Thanks, and sorry for the breakage.

  Rainer
Comment 4 Rainer Orth 2014-11-07 10:05:34 UTC
Created attachment 33916 [details]
proposed patch
Comment 5 David Edelsohn 2014-11-08 21:32:51 UTC
If _XOPEN_SOURCE is removed from thr.c completely, the testsuite results revert to 1 failure.
Comment 6 ro@CeBiTec.Uni-Bielefeld.DE 2014-11-10 15:58:58 UTC
> --- Comment #5 from David Edelsohn <dje at gcc dot gnu.org> ---
> If _XOPEN_SOURCE is removed from thr.c completely, the testsuite results revert
> to 1 failure.

Did this failure already exist before my patch?  If so, such a change is
certainly better than arch-specific _XOPEN_SOURCE values.  Andrew, what
do you thing?

Thanks.
        Rainer
Comment 7 David Edelsohn 2014-11-10 16:07:35 UTC
Yes, the single objc failure existed before the patch. But I don't know if *other* targets need _XOPEN_SOURCE=500.
Comment 8 ro@CeBiTec.Uni-Bielefeld.DE 2014-11-10 16:11:25 UTC
> --- Comment #7 from David Edelsohn <dje at gcc dot gnu.org> ---
> Yes, the single objc failure existed before the patch. But I don't know if
> *other* targets need _XOPEN_SOURCE=500.

True, but now (end of stage1) is the time to find out.  In most
compilation environments, defining no feature test macros gives you the
superset of everything available.

Ultimately, it's Andrew's call.

	Rainer
Comment 9 David Edelsohn 2014-11-10 16:34:08 UTC
I would have expected _XOPEN_SOURCE=500 to be defined in a host-specific configure file (like libstdc++-v3/config/os/.../os_defines.h) or added to the compile line in configure.
Comment 10 Andrew Pinski 2014-11-10 16:50:48 UTC
Let's go with the one defining _XOPEN_SOURCE only for Solaris until someone programs David's suggestion of the host-specific configure file.
Comment 11 ro@CeBiTec.Uni-Bielefeld.DE 2014-11-11 14:15:17 UTC
> --- Comment #9 from David Edelsohn <dje at gcc dot gnu.org> ---
> I would have expected _XOPEN_SOURCE=500 to be defined in a host-specific
> configure file (like libstdc++-v3/config/os/.../os_defines.h) or added to the
> compile line in configure.

Given how little target-specific configuration libobjc needs, this seems
overkill to me.

	Rainer
Comment 12 ro@CeBiTec.Uni-Bielefeld.DE 2014-11-11 14:19:00 UTC
> --- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> Let's go with the one defining _XOPEN_SOURCE only for Solaris until someone
> programs David's suggestion of the host-specific configure file.

Huh?  As I've just checked, both Solaris and Linux/x86_64 do fine
without any definition of _XOPEN_SOURCE at all, as does AIX.  Only if
_XOPEN_SOURCE is defined at all does Solaris need a value >= 600 with
C99 and beyond.

The attached patch does just that.

	Rainer
Comment 13 Rainer Orth 2014-11-11 14:20:54 UTC
Created attachment 33933 [details]
alternative patch
Comment 14 Andrew Pinski 2014-11-11 17:17:29 UTC
(In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #11)
> > --- Comment #9 from David Edelsohn <dje at gcc dot gnu.org> ---
> > I would have expected _XOPEN_SOURCE=500 to be defined in a host-specific
> > configure file (like libstdc++-v3/config/os/.../os_defines.h) or added to the
> > compile line in configure.
> 
> Given how little target-specific configuration libobjc needs, this seems
> overkill to me.

That is because it picks up most of it from GCC's target headers right now.  I had plans to changing that but I never got around fixing that around 9 years ago :).
Comment 15 Rainer Orth 2015-01-26 14:15:26 UTC
I've never received comments on my alternative patch.  Either that one, which I
prefer since it's cleaner) or the previous one (ugly and target-specific), needs
to be applied to have AIX bootstrap, I believe.

What should we do?

  Rainer
Comment 16 David Edelsohn 2015-01-26 15:41:08 UTC
The alternative patch works on AIX.  I thought that it was going to be installed.
Comment 17 David Edelsohn 2015-01-27 22:03:15 UTC
What other comments are needed to install the alternative patch?  It works for Solaris and AIX, where the problems started.
Comment 18 Jakub Jelinek 2015-01-28 07:51:48 UTC
(In reply to David Edelsohn from comment #16)
> The alternative patch works on AIX.  I thought that it was going to be
> installed.

I don't remember it being ever posted to gcc-patches, patch review doesn't happen in bugzilla.
Comment 19 Rainer Orth 2015-01-28 10:28:32 UTC
Done now.

I hadn't posted the patches so far, since Andrew as libobjc maintainer had
commented on the first proposol in the PR already.

  Rainer
Comment 20 Rainer Orth 2015-02-05 09:42:16 UTC
Author: ro
Date: Thu Feb  5 09:41:44 2015
New Revision: 220438

URL: https://gcc.gnu.org/viewcvs?rev=220438&root=gcc&view=rev
Log:
Fix failures on AIX (PR libobjc/63765)

	PR libobjc/63765
	* thr.c (_XOPEN_SOURCE): Remove.

Modified:
    trunk/libobjc/ChangeLog
    trunk/libobjc/thr.c
Comment 21 Rainer Orth 2015-02-05 12:23:06 UTC
Fixed for 5.0.