From patchwork Mon Sep 29 18:13:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 394539 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 38B6714001A for ; Tue, 30 Sep 2014 04:14:35 +1000 (EST) 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:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=kc9ZDAy0EMLP5EqV 2OY1YfrCDbGen+lh1gMv4UDt/3PR/HTaYOkJiILfY3JrfQ69rCfX1/gZgUhdhQ48 r8k3eORIpRkcMDz+6zw7+fCg7dGMmuYSnndT9WigqAd8iBvOTjQmXq3h3NiAGbYl qoQZH8looxPhsdjPYBKprsN01r4= 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:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=iCNcSpvfTD8psuryTxdhLc RRka8=; b=tA1TvyVTkAY8TxZLJ6KcMyOwvsvuCP3p2F7fgE+8mvw4zCjHIl+B6A TvjU+YaZqwvRCcNf3VxGHUfRRLFXWNXzbPxeiXoEpULykVYVnFdt4NxAvgXYqpor yB6H9g6kO4iKJG7Ps5tCX8iSZVb4RcTm9Him+S/gszeUU8g47ECkk= Received: (qmail 8003 invoked by alias); 29 Sep 2014 18:14:01 -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 7879 invoked by uid 89); 29 Sep 2014 18:14:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL, BAYES_00, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Sep 2014 18:13:59 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XYfSN-0005ZW-Lt from Thomas_Schwinge@mentor.com ; Mon, 29 Sep 2014 11:13:56 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.3.181.6; Mon, 29 Sep 2014 19:13:54 +0100 From: Thomas Schwinge To: "Iyer, Balaji V" , , CC: Subject: libcilkrts: GNU toolchain, GNU linker scripts (was: Cilk Library) In-Reply-To: References: <525460A9.2040409@redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (i486-pc-linux-gnu) Date: Mon, 29 Sep 2014 20:13:49 +0200 Message-ID: <87zjdicn1e.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Wed, 9 Oct 2013 18:32:11 +0000, "Iyer, Balaji V" wrote: > [libcilkrts] As requested during patch review, symbol versioning infrastructure has been added to libcilkrts. However, this is currently described/implemented as "Linux-only", while in fact it's standard GNU linker scripts, generally supported with the GNU toolchain, so I'm proposing to change this as follows. This increases portability. Tested on x86 GNU/Hurd, and x86_64 GNU/Linux is in progress. OK for trunk once testing completed? commit 44e41129a59a4f69d26923a6fa6091902ae584b2 Author: Thomas Schwinge Date: Sat Sep 20 19:16:44 2014 +0200 libcilkrts: GNU toolchain, GNU linker scripts. libcilkrts/ * configure.ac (linux_linker_script): Rename to gnu_linker_script. Also set for *-*-gnu*. (LINUX_LINKER_SCRIPT): Rename to GNU_LINKER_SCRIPT. Adapt all users. * configure: Regenerate. * Makefile.in: Regenerate. * runtime/linux-symbols.ver: Rename to runtime/gnu-symbols.ver. --- libcilkrts/Makefile.am | 6 ++-- libcilkrts/Makefile.in | 4 +-- libcilkrts/configure | 32 ++++++++++++---------- libcilkrts/configure.ac | 12 ++++---- .../runtime/{linux-symbols.ver => gnu-symbols.ver} | 0 5 files changed, 29 insertions(+), 25 deletions(-) Grüße, Thomas diff --git libcilkrts/Makefile.am libcilkrts/Makefile.am index 70538a2..e77dfa6 100644 --- libcilkrts/Makefile.am +++ libcilkrts/Makefile.am @@ -95,9 +95,9 @@ libcilkrts_la_LDFLAGS = -version-info 5:0:0 libcilkrts_la_LDFLAGS += @lt_cv_dlopen_libs@ libcilkrts_la_LDFLAGS += $(AM_LDFLAGS) -# If we're building on Linux, use the Linux version script -if LINUX_LINKER_SCRIPT - libcilkrts_la_LDFLAGS += -Wl,--version-script,$(srcdir)/runtime/linux-symbols.ver +# If we're building with a GNU toolchain, use the GNU version script. +if GNU_LINKER_SCRIPT + libcilkrts_la_LDFLAGS += -Wl,--version-script,$(srcdir)/runtime/gnu-symbols.ver endif # If we're building on MacOS, use the Mac versioning diff --git libcilkrts/Makefile.in libcilkrts/Makefile.in index e1a54b5..dd482b4 100644 --- libcilkrts/Makefile.in +++ libcilkrts/Makefile.in @@ -115,8 +115,8 @@ DIST_COMMON = $(srcdir)/include/internal/rev.mk README ChangeLog \ $(srcdir)/../mkinstalldirs $(srcdir)/libcilkrts.spec.in \ $(srcdir)/../depcomp -# If we're building on Linux, use the Linux version script -@LINUX_LINKER_SCRIPT_TRUE@am__append_1 = -Wl,--version-script,$(srcdir)/runtime/linux-symbols.ver +# If we're building with a GNU toolchain, use the GNU version script. +@GNU_LINKER_SCRIPT_TRUE@am__append_1 = -Wl,--version-script,$(srcdir)/runtime/gnu-symbols.ver # If we're building on MacOS, use the Mac versioning @MAC_LINKER_SCRIPT_TRUE@am__append_2 = -Wl,-exported_symbols_list,$(srcdir)/runtime/mac-symbols.txt diff --git libcilkrts/configure libcilkrts/configure index be96533..b75533c 100644 --- libcilkrts/configure +++ libcilkrts/configure @@ -629,8 +629,8 @@ SED LIBTOOL MAC_LINKER_SCRIPT_FALSE MAC_LINKER_SCRIPT_TRUE -LINUX_LINKER_SCRIPT_FALSE -LINUX_LINKER_SCRIPT_TRUE +GNU_LINKER_SCRIPT_FALSE +GNU_LINKER_SCRIPT_TRUE config_dir ALLOCA multi_basedir @@ -5647,19 +5647,21 @@ case "${target}" in esac -# We have linker scripts for appropriate operating systems -linux_linker_script=no +# We have linker scripts for appropriate toolchains. + +gnu_linker_script=no case "${host}" in - *-*-linux*) - linux_linker_script=yes + *-*-gnu* | *-*-linux*) + # Assume a GNU toolchain. + gnu_linker_script=yes ;; esac - if test "$linux_linker_script" = "yes"; then - LINUX_LINKER_SCRIPT_TRUE= - LINUX_LINKER_SCRIPT_FALSE='#' + if test "$gnu_linker_script" = "yes"; then + GNU_LINKER_SCRIPT_TRUE= + GNU_LINKER_SCRIPT_FALSE='#' else - LINUX_LINKER_SCRIPT_TRUE='#' - LINUX_LINKER_SCRIPT_FALSE= + GNU_LINKER_SCRIPT_TRUE='#' + GNU_LINKER_SCRIPT_FALSE= fi @@ -11755,7 +11757,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11758 "configure" +#line 11760 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11861,7 +11863,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11864 "configure" +#line 11866 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15379,8 +15381,8 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${LINUX_LINKER_SCRIPT_TRUE}" && test -z "${LINUX_LINKER_SCRIPT_FALSE}"; then - as_fn_error "conditional \"LINUX_LINKER_SCRIPT\" was never defined. +if test -z "${GNU_LINKER_SCRIPT_TRUE}" && test -z "${GNU_LINKER_SCRIPT_FALSE}"; then + as_fn_error "conditional \"GNU_LINKER_SCRIPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAC_LINKER_SCRIPT_TRUE}" && test -z "${MAC_LINKER_SCRIPT_FALSE}"; then diff --git libcilkrts/configure.ac libcilkrts/configure.ac index afd09b8..9f47993 100644 --- libcilkrts/configure.ac +++ libcilkrts/configure.ac @@ -143,14 +143,16 @@ case "${target}" in esac AC_SUBST(config_dir) -# We have linker scripts for appropriate operating systems -linux_linker_script=no +# We have linker scripts for appropriate toolchains. + +gnu_linker_script=no case "${host}" in - *-*-linux*) - linux_linker_script=yes + *-*-gnu* | *-*-linux*) + # Assume a GNU toolchain. + gnu_linker_script=yes ;; esac -AM_CONDITIONAL(LINUX_LINKER_SCRIPT, test "$linux_linker_script" = "yes") +AM_CONDITIONAL(GNU_LINKER_SCRIPT, test "$gnu_linker_script" = "yes") mac_linker_script=no case "${host}" in diff --git libcilkrts/runtime/linux-symbols.ver libcilkrts/runtime/gnu-symbols.ver similarity index 100% rename from libcilkrts/runtime/linux-symbols.ver rename to libcilkrts/runtime/gnu-symbols.ver