public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [libgo] Use stat_atim.go on Solaris 12+
@ 2015-08-26 11:16 Rainer Orth
  2015-09-03  9:03 ` Rainer Orth
  2015-09-10 22:14 ` Ian Lance Taylor
  0 siblings, 2 replies; 4+ messages in thread
From: Rainer Orth @ 2015-08-26 11:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

Solaris 12 changes the stat_[amc]tim members of struct stat from
timestruc_t to timespec_t for XPG7 compatiblity, thus breaking the libgo
build.  The following patch checks for this change and uses the common
stat_atim.go if appropriate.

Btw., I noticed that go/os/stat_atim.go and stat_dragonfly.go are identical;
no idea why that would be useful.

Bootstrapped without regressions on i386-pc-solaris2.1[12] and
sparc-sun-solaris2.1[12].

I had to regenerate aclocal.m4 since for some reason it had been built
with automake 1.11.1 instead of the common 1.11.6, thus inhibiting
Makefile.in regeneration.

Ok for mainline now and the gcc 5 branch after some soak time?

	Rainer


2015-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (have_stat_timespec): Check for timespec_t st_atim
	in <sys/stat.h>.
	(HAVE_STAT_TIMESPEC): New conditional.
	* configure: Regenerate.
	* Makefile.am [LIBGO_IS_SOLARIS && HAVE_STAT_TIMESPEC]
	(go_os_stat_file): Use go/os/stat_atim.go.
	* aclocal.m4: Regenerate.
	* Makefile.in: Regenerate.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol12-libgo-stat_atim.patch --]
[-- Type: text/x-patch, Size: 1131 bytes --]

# HG changeset patch
# Parent b83d7b91430fc3d2c2f34df34aaf648b178d2cad
Use stat_atim.go on Solaris 12+

diff --git a/libgo/Makefile.am b/libgo/Makefile.am
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -880,7 +880,11 @@ endif
 endif
 
 if LIBGO_IS_SOLARIS
+if HAVE_STAT_TIMESPEC
+go_os_stat_file = go/os/stat_atim.go
+else
 go_os_stat_file = go/os/stat_solaris.go
+endif
 else
 if LIBGO_IS_LINUX
 go_os_stat_file = go/os/stat_atim.go
diff --git a/libgo/configure.ac b/libgo/configure.ac
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -654,6 +654,12 @@ AC_CACHE_CHECK([epoll_event data.fd offs
 STRUCT_EPOLL_EVENT_FD_OFFSET=${libgo_cv_c_epoll_event_fd_offset}
 AC_SUBST(STRUCT_EPOLL_EVENT_FD_OFFSET)
 
+dnl Check if <sys/stat.h> uses timespec_t for st_?tim members.  Introduced
+dnl in Solaris 12 for XPG7 compatibility.
+AC_EGREP_HEADER([timespec_t.*st_atim], [sys/stat.h],
+		[have_stat_timespec=yes], [have_stat_timespec=no])
+AM_CONDITIONAL(HAVE_STAT_TIMESPEC, test $have_stat_timespec = yes)
+
 dnl See if struct exception is defined in <math.h>.
 AC_CHECK_TYPE([struct exception],
 [libgo_has_struct_exception=yes],

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [libgo] Use stat_atim.go on Solaris 12+
  2015-08-26 11:16 [libgo] Use stat_atim.go on Solaris 12+ Rainer Orth
@ 2015-09-03  9:03 ` Rainer Orth
  2015-09-10 22:14 ` Ian Lance Taylor
  1 sibling, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2015-09-03  9:03 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor

Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Solaris 12 changes the stat_[amc]tim members of struct stat from
> timestruc_t to timespec_t for XPG7 compatiblity, thus breaking the libgo
> build.  The following patch checks for this change and uses the common
> stat_atim.go if appropriate.
>
> Btw., I noticed that go/os/stat_atim.go and stat_dragonfly.go are identical;
> no idea why that would be useful.
>
> Bootstrapped without regressions on i386-pc-solaris2.1[12] and
> sparc-sun-solaris2.1[12].
>
> I had to regenerate aclocal.m4 since for some reason it had been built
> with automake 1.11.1 instead of the common 1.11.6, thus inhibiting
> Makefile.in regeneration.
>
> Ok for mainline now and the gcc 5 branch after some soak time?
>
> 	Rainer
>
>
> 2015-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	* configure.ac (have_stat_timespec): Check for timespec_t st_atim
> 	in <sys/stat.h>.
> 	(HAVE_STAT_TIMESPEC): New conditional.
> 	* configure: Regenerate.
> 	* Makefile.am [LIBGO_IS_SOLARIS && HAVE_STAT_TIMESPEC]
> 	(go_os_stat_file): Use go/os/stat_atim.go.
> 	* aclocal.m4: Regenerate.
> 	* Makefile.in: Regenerate.

This patch has remained unreviewed for a week.

	Rainer

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [libgo] Use stat_atim.go on Solaris 12+
  2015-08-26 11:16 [libgo] Use stat_atim.go on Solaris 12+ Rainer Orth
  2015-09-03  9:03 ` Rainer Orth
@ 2015-09-10 22:14 ` Ian Lance Taylor
  2015-09-11  8:48   ` Rainer Orth
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2015-09-10 22:14 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

On Wed, Aug 26, 2015 at 4:14 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Solaris 12 changes the stat_[amc]tim members of struct stat from
> timestruc_t to timespec_t for XPG7 compatiblity, thus breaking the libgo
> build.  The following patch checks for this change and uses the common
> stat_atim.go if appropriate.
>
> Btw., I noticed that go/os/stat_atim.go and stat_dragonfly.go are identical;
> no idea why that would be useful.
>
> Bootstrapped without regressions on i386-pc-solaris2.1[12] and
> sparc-sun-solaris2.1[12].
>
> I had to regenerate aclocal.m4 since for some reason it had been built
> with automake 1.11.1 instead of the common 1.11.6, thus inhibiting
> Makefile.in regeneration.
>
> Ok for mainline now and the gcc 5 branch after some soak time?
>
>         Rainer
>
>
> 2015-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
>         * configure.ac (have_stat_timespec): Check for timespec_t st_atim
>         in <sys/stat.h>.
>         (HAVE_STAT_TIMESPEC): New conditional.
>         * configure: Regenerate.
>         * Makefile.am [LIBGO_IS_SOLARIS && HAVE_STAT_TIMESPEC]
>         (go_os_stat_file): Use go/os/stat_atim.go.
>         * aclocal.m4: Regenerate.
>         * Makefile.in: Regenerate.

Thanks.  Committed to mainline.

Sorry for the slow review.

This is fine to commit to GCC 5 branch.

stat_atim.go is a gccgo-specific file.  stat_dragonfly.go came in from
the master Go repository.  Just another thing to straighten out some
time.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [libgo] Use stat_atim.go on Solaris 12+
  2015-09-10 22:14 ` Ian Lance Taylor
@ 2015-09-11  8:48   ` Rainer Orth
  0 siblings, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2015-09-11  8:48 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

Ian Lance Taylor <iant@google.com> writes:

> On Wed, Aug 26, 2015 at 4:14 AM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>> Solaris 12 changes the stat_[amc]tim members of struct stat from
>> timestruc_t to timespec_t for XPG7 compatiblity, thus breaking the libgo
>> build.  The following patch checks for this change and uses the common
>> stat_atim.go if appropriate.
>>
>> Btw., I noticed that go/os/stat_atim.go and stat_dragonfly.go are identical;
>> no idea why that would be useful.
>>
>> Bootstrapped without regressions on i386-pc-solaris2.1[12] and
>> sparc-sun-solaris2.1[12].
>>
>> I had to regenerate aclocal.m4 since for some reason it had been built
>> with automake 1.11.1 instead of the common 1.11.6, thus inhibiting
>> Makefile.in regeneration.
>>
>> Ok for mainline now and the gcc 5 branch after some soak time?
>>
>>         Rainer
>>
>>
>> 2015-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>>
>>         * configure.ac (have_stat_timespec): Check for timespec_t st_atim
>>         in <sys/stat.h>.
>>         (HAVE_STAT_TIMESPEC): New conditional.
>>         * configure: Regenerate.
>>         * Makefile.am [LIBGO_IS_SOLARIS && HAVE_STAT_TIMESPEC]
>>         (go_os_stat_file): Use go/os/stat_atim.go.
>>         * aclocal.m4: Regenerate.
>>         * Makefile.in: Regenerate.
>
> Thanks.  Committed to mainline.
>
> Sorry for the slow review.

Thanks, and no worries: I just wanted to make sure it can make it into
GCC 5.3.

> This is fine to commit to GCC 5 branch.

I'll let it soak on mainline for a week or two and commit to the branch
then.

> stat_atim.go is a gccgo-specific file.  stat_dragonfly.go came in from
> the master Go repository.  Just another thing to straighten out some
> time.

I see: such differences can make things a bit confusing ;-)

	Rainer

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-11  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-26 11:16 [libgo] Use stat_atim.go on Solaris 12+ Rainer Orth
2015-09-03  9:03 ` Rainer Orth
2015-09-10 22:14 ` Ian Lance Taylor
2015-09-11  8:48   ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).