From patchwork Thu Nov 2 10:42:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 833290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465725-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ga4WgS4a"; dkim-atps=neutral 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 3ySMBD1xYjz9sRW for ; Thu, 2 Nov 2017 21:43:15 +1100 (AEDT) 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=QiAqiHB/K2+g2Hynj4eOsfQ24fEUj0fvkyCOIgUiPLv/PxEmXTXn2 g3MzrgKo9T1GEON+ztWi27QRlup0SeZ3FG/DeE1DbB5IYFeN/x7y4REhDpaHBM5O ftXdJC/lVhDsbX/JtK/3hySd/04tqa7BzK0f9n/DSbqMtgBSM00bHw= 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:subject:date:message-id:mime-version:content-type; s= default; bh=fnqHZlnVPGBiV+3hZLtOLEBn7T8=; b=ga4WgS4aPfx376pSgETS iN71tXrejDAtG/W+45AqXiWXtpCAfTipAeq42pEIbil043pIHlUUBbAvKvePbfwE QvhI20HisYC4RG1GgCu8cBnuhGPnAax9vJA4oRYUr9uFdpin5x+kMRy1HjpFu8IF hRxADSSo7M57HQCTHu5KzQE= Received: (qmail 40987 invoked by alias); 2 Nov 2017 10:43:02 -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 39940 invoked by uid 89); 2 Nov 2017 10:43:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-18.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=1p, Generation X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Nov 2017 10:42:54 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 2370389F for ; Thu, 2 Nov 2017 11:42:46 +0100 (CET) Received: from smtp.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 eBcBhU3nrh-Q for ; Thu, 2 Nov 2017 11:42:42 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id C85DC89E for ; Thu, 2 Nov 2017 11:42:42 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id vA2Agg7G010868; Thu, 2 Nov 2017 11:42:42 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: [build] Cleanup Solaris linker version checks Date: Thu, 02 Nov 2017 11:42:42 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes There's some potential to cleanup Solaris linker version checks: * gcc_AC_INITFINI_ARRAY in acinclude.m4 is unused, but still serves as documentation for the various variants of ld version strings. This is now moved to configure.ac. * Solaris 11.4 has (or shortly will have) some changes to the version numbering: until now this is something like ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2560 but will become ld: Solaris ELF Utilities: 11.4-1.3123 like the rest of Solaris binutils (ar, nm, ...) already have. The patch below accomodates both formats. Bootstrapped without regressions on i386-pc-solaris2.11.4, i386-pc-solaris2.10, to be installed on mainline shortly. Rainer # HG changeset patch # Parent d45c8c8a41993c685d1de58840fc675b4cb7b5c0 Cleanup Solaris linker version checks diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4 --- a/gcc/acinclude.m4 +++ b/gcc/acinclude.m4 @@ -277,8 +277,7 @@ fi fi]) AC_DEFUN([gcc_AC_INITFINI_ARRAY], -[AC_REQUIRE([gcc_SUN_LD_VERSION])dnl -AC_ARG_ENABLE(initfini-array, +[AC_ARG_ENABLE(initfini-array, [ --enable-initfini-array use .init_array/.fini_array sections], [], [ AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, @@ -556,43 +555,6 @@ if test $[$2] != yes; then $8 fi])]) -dnl gcc_SUN_LD_VERSION -dnl -dnl Determines Sun linker version numbers, setting gcc_cv_sun_ld_vers to -dnl the complete version number and gcc_cv_sun_ld_vers_{major, minor} to -dnl the corresponding fields. -dnl -dnl ld and ld.so.1 are guaranteed to be updated in lockstep, so ld version -dnl numbers can be used in ld.so.1 feature checks even if a different -dnl linker is configured. -dnl -AC_DEFUN([gcc_SUN_LD_VERSION], -[changequote(,)dnl -if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then - case "${target}" in - *-*-solaris2*) - # - # Solaris 2 ld -V output looks like this for a regular version: - # - # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1699 - # - # but test versions add stuff at the end: - # - # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10 - # - gcc_cv_sun_ld_ver=`/usr/ccs/bin/ld -V 2>&1` - if echo "$gcc_cv_sun_ld_ver" | grep 'Solaris Link Editors' > /dev/null; then - gcc_cv_sun_ld_vers=`echo $gcc_cv_sun_ld_ver | sed -n \ - -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'` - gcc_cv_sun_ld_vers_major=`expr "$gcc_cv_sun_ld_vers" : '\([0-9]*\)'` - gcc_cv_sun_ld_vers_minor=`expr "$gcc_cv_sun_ld_vers" : '[0-9]*\.\([0-9]*\)'` - fi - ;; - esac -fi -changequote([,])dnl -]) - dnl GCC_TARGET_TEMPLATE(KEY) dnl ------------------------ dnl Define KEY as a valid configure key on the target machine. diff --git a/gcc/configure.ac b/gcc/configure.ac --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2587,15 +2587,25 @@ if test $in_tree_ld != yes ; then else case "${target}" in *-*-solaris2*) - # See acinclude.m4 (gcc_SUN_LD_VERSION) for the version number - # format. + # Solaris 2 ld -V output looks like this for a regular version: # - # Don't reuse gcc_gv_sun_ld_vers_* in case a linker other than - # /usr/ccs/bin/ld has been configured. + # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1699 + # + # but test versions add stuff at the end: + # + # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10 + # + # In Solaris 11.4, this was changed to + # + # ld: Solaris ELF Utilities: 11.4-1.3123 + # + # ld and ld.so.1 are guaranteed to be updated in lockstep, so ld version + # numbers can be used in ld.so.1 feature checks even if a different + # linker is configured. ld_ver=`$gcc_cv_ld -V 2>&1` - if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then + if echo "$ld_ver" | $EGREP 'Solaris Link Editors|Solaris ELF Utilities' > /dev/null; then ld_vers=`echo $ld_ver | sed -n \ - -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'` + -e 's,^.*: \(5\|1[0-9]\)\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\2,p'` ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` fi