From patchwork Wed Aug 26 11:14:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 510805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8E43E1401DA for ; Wed, 26 Aug 2015 21:14:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=n4adEH23; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=aGdIlGkrdmVny/klTk0y+JZQ2Kb4vDrLaKsC1Y/FKy0TT62qcp fNd59zU3ax5ViFAA9uOAxANSbdV22cgYBphk+mRXDYXP5RJ+QWL7wJ77JNHTP6gy 0W7ntIHeKGsk4TjM3Zd93hU8tf0oZ8z5uR6xBatGkOTaChcH9FVGccAHA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=bCk6qLMBoSuYWXsPfPGEjuvuG30=; b=n4adEH23UBwcXfzL0mg1 Gb0Ukrl2LN5q1yFMnWeDSDWDyHLxwC9W+SPnRbuLc1WkQaZYdU1kTQuq/8U8Cxtb gHnDDE4CiEAbcWSEpYzYNMhrbKXZwq7/QYQAaljo3PCW1QbCGI6t235AjrG+p5/a RBLP2//CnqZE1ovnxcYvWJY= Received: (qmail 94349 invoked by alias); 26 Aug 2015 11:14:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 94340 invoked by uid 89); 26 Aug 2015 11:14:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp-relay.CeBiTec.Uni-Bielefeld.DE Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Aug 2015 11:14:30 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 739794E3; Wed, 26 Aug 2015 13:14:28 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id e-zLFskwQNkb; Wed, 26 Aug 2015 13:14:26 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 132FD4E2; Wed, 26 Aug 2015 13:14:26 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.1+Sun/8.15.1/Submit) id t7QBEPUj017853; Wed, 26 Aug 2015 13:14:25 +0200 (CEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor Subject: [libgo] Use stat_atim.go on Solaris 12+ Date: Wed, 26 Aug 2015 13:14:25 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes 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 * configure.ac (have_stat_timespec): Check for timespec_t st_atim in . (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. # 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 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 . AC_CHECK_TYPE([struct exception], [libgo_has_struct_exception=yes],