From patchwork Wed Sep 25 21:23:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1167629 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-509586-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PFv+JC8X"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="VxdSeS3o"; 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 46drfF3b5Bz9sNw for ; Thu, 26 Sep 2019 07:24:05 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:in-reply-to:message-id:references:mime-version :content-type; q=dns; s=default; b=lrjmokGD5CbjWhJx/W8PqoXxuq2lG BShtzF//xVRsyeYapabMISnzIcylX/h/tmiFlZMNdqBDpl6PkY+jGhVXc3KLudIS a96g6+WwTWd086/bJ8CYmNh8kjc545F1ASwBOdrA0MWRvk8NmJmp9rgz+b03Epo7 bruPQ6TWnd7l2M= 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:date :from:to:subject:in-reply-to:message-id:references:mime-version :content-type; s=default; bh=X9Eu6swoBg7Izx0GUE7lSukolAc=; b=PFv +JC8XFjhSmfPj+GZROhIMV7lpBHCpTUB9M4BKAccyyPzEDMLnxhsqlwK91QDAkty nQYJao3yUxqyGTFWq//qmCTuNlSYadtw4fM5G5K+DYYpDD1CEuAHpX2M1TJk2ECm XjU7R/QjYCqKxj9hNnPCSmaqnhJCT3EPSy04UBdI= Received: (qmail 56460 invoked by alias); 25 Sep 2019 21:23:58 -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 56452 invoked by uid 89); 25 Sep 2019 21:23:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy=sk:cross-c, sk:crossc, sk:version X-HELO: esa2.hgst.iphmx.com Received: from esa2.hgst.iphmx.com (HELO esa2.hgst.iphmx.com) (68.232.143.124) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Sep 2019 21:23:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1569446719; x=1600982719; h=date:from:to:subject:in-reply-to:message-id:references: mime-version; bh=/202ffeW6ZdINgitGm+a5JcfzcU7oPrw0Yblfk2VPak=; b=VxdSeS3onMoDM9Qk/Dk50lauFFKfpC3h/A4KT/JDGm/tiIaideqWSmJM pf0+f413SmD5YuaMOfgQU0VPilHZU/SNTYg1WjW1UhIhziapSoudlE0DA kPYQ3DLD7Fc7eLGZulThmvZTqtFuidCATnR8rqYRknE1ZRGkSl1F4MiOl LHeIox5MHyjT+2uIj3azMhhyYMVJhPRKsPpKeBLL8F6ydgydrg8Efzwye 9v6pxowWV0cvO5X1ribFgmspbGvuHWghe/OiIp8JzN6yf0JpatpVeI/zm WXJ9X+wvy8sZKSlnigl5HD+hiuEem3g1AKTZdUFtOWlvOtd3RmL9Io/9h Q==; IronPort-SDR: weyPms2UFAGKfwOJkQyCOgE63wqnY7QFQh9Am7N9BH+4t2IAOxGQnL9CsJgh2ZYDBnJIsjlEds QREWNe12csvtWk7ugHY/umsrvzHr2cy1A+rnl/q/0aPKKaxTsGDXGh8Z4DgKKlS5v6S0cdMBRT GVkWmWqmnC/5ltfGspinLrnzO9D1ZgPYWu5ZTQOHvdp5KCJ4pEzoF9OLY41WzB+r0jUVw7va8p 0pvkdWiVa3yd3iKh3EcHUWP5/j1ndQ2OoG6r7Qo6AaryDdKmWHeqsfr2tYkHtpPqr/5Zck1Loa pU4= Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Sep 2019 05:25:18 +0800 IronPort-SDR: 98ye2Hj9Rj8XM4oNR1QxK233oBb/Ys69Z1lfGBKQX1ja9zpNMJOOM2JXqneQgmb4EjZS3NTwzG eFCV6s5yqXRb6vZSgisb8ctnwiQmfe2nPSjsjzElitnoUMEK/bTMyTfKLFBwPVZi3KAsHeipWf DwF+jF+Px7KS0940rrmGVGGZpEvFEUsNZX/w/Cu4DADEpd+MBfE3wiaTrqMAGXRlMH58KflMZJ VH/rbSNWpyEXSxFenbzA0cO9kJai5bzsMtbVE+HxnMKBdOFbe93VwlMIsXpsiIG1iqtSIJu2s2 xHQm2DW7xWDjtK9wM715cpHj Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 14:20:14 -0700 IronPort-SDR: J2wTIxfuof75esiMCLc6Zibn9+nVJ9IgYyQkbpvNB5DZ0kFTRbnKKtZHuvC8Vut2ngzHaQBjen OK6d3YBW1wnhQOvFLWz8gyOasyrhSgzg0fTYp7kUdS3dXeIUZbbY5UxHELl3TAlQ2//2dol5wP G0MWwDWYUXxLALwy3iwqGidcN7yWvPoBOecXNh3NpTQWYjV7aX9GnkSnpQ31cTtHRSHeL4jRWF GZxsLzglnLJ9n8OlPnOcEviYqwfmvBfHTJBLdtYvte6ALlp4uCwJ2tmnU9X2qcUn3tT6uMcZpe MPg= WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 14:23:52 -0700 Date: Wed, 25 Sep 2019 22:23:49 +0100 (BST) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2] libada: Respect `--enable-version-specific-runtime-libs' In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Respect the `--enable-version-specific-runtime-libs' configuration option in libada/, so that shared gnatlib libraries will be installed in non-version-specific $(toolexeclibdir) if requested. In a cross-compilation environment this helps setting up a consistent sysroot, which can then be shared between the host and the target system. Update the settings of $(toolexecdir) and $(toolexeclibdir), unused till now, to keep the current arrangement in the version-specific case and make the new option to be enabled by default, unlike with the other target libraries, so as to keep existing people's build infrastructure unaffected. Of course if someone does use `--disable-version-specific-runtime-libs' already, then the installation location of shared gnatlib libraries will change, but presumably this is what they do want anyway as the current situation where the option is ignored in libada/ only is an anomaly really rather than one that is expected or desired. gcc/ada/ * gcc-interface/Makefile.in (ADA_RTL_DSO_DIR): New variable. (install-gnatlib): Use it in place of ADA_RTL_OBJ_DIR for shared library installation. libada/ * Makefile.in (toolexecdir, toolexeclibdir): New variables. (LIBADA_FLAGS_TO_PASS): Add `toolexeclibdir'. * configure.ac: Add `--enable-version-specific-runtime-libs'. Update version-specific `toolexecdir' and `toolexeclibdir' from ADA_RTL_OBJ_DIR from gcc/ada/gcc-interface/Makefile.in. * configure: Regenerate. --- gcc/ada/gcc-interface/Makefile.in | 7 ++++--- libada/Makefile.in | 3 +++ libada/configure | 25 ++++++++++++++++++++++--- libada/configure.ac | 20 +++++++++++++++++--- 4 files changed, 46 insertions(+), 9 deletions(-) gcc-install-sysroot-gnatlib.diff Index: gcc/gcc/ada/gcc-interface/Makefile.in =================================================================== --- gcc.orig/gcc/ada/gcc-interface/Makefile.in +++ gcc/gcc/ada/gcc-interface/Makefile.in @@ -534,15 +534,15 @@ install-gnatlib: ../stamp-gnatlib-$(RTSD for file in gnat gnarl; do \ if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \ $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \ - $(DESTDIR)$(ADA_RTL_OBJ_DIR); \ + $(DESTDIR)$(ADA_RTL_DSO_DIR); \ fi; \ if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \ $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \ - $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \ + $(DESTDIR)$(ADA_RTL_DSO_DIR)/lib$${file}$(soext); \ fi; \ if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \ $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \ - $(DESTDIR)$(ADA_RTL_OBJ_DIR); \ + $(DESTDIR)$(ADA_RTL_DSO_DIR); \ fi; \ done # This copy must be done preserving the date on the original file. @@ -882,6 +882,7 @@ b_gnatm.o : b_gnatm.adb ADA_INCLUDE_DIR = $(libsubdir)/adainclude ADA_RTL_OBJ_DIR = $(libsubdir)/adalib +ADA_RTL_DSO_DIR = $(toolexeclibdir) # Special flags Index: gcc/libada/Makefile.in =================================================================== --- gcc.orig/libada/Makefile.in +++ gcc/libada/Makefile.in @@ -38,6 +38,8 @@ target = @target@ prefix = @prefix@ # Nonstandard autoconf-set variables. +toolexecdir = @toolexecdir@ +toolexeclibdir = @toolexeclibdir@ enable_shared = @enable_shared@ LN_S=@LN_S@ @@ -88,6 +90,7 @@ LIBADA_FLAGS_TO_PASS = \ "TRACE=$(TRACE)" \ "MULTISUBDIR=$(MULTISUBDIR)" \ "libsubdir=$(libsubdir)" \ + "toolexeclibdir=$(toolexeclibdir)" \ "objext=$(objext)" \ "prefix=$(prefix)" \ "exeext=.exeext.should.not.be.used " \ Index: gcc/libada/configure =================================================================== --- gcc.orig/libada/configure +++ gcc/libada/configure @@ -702,6 +702,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_build_libsubdir +enable_version_specific_runtime_libs enable_maintainer_mode enable_multilib enable_shared @@ -1325,6 +1326,9 @@ if test -n "$ac_init_help"; then --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-version-specific-runtime-libs + specify that runtime libraries should be installed + in a compiler-specific directory --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer @@ -2215,6 +2219,22 @@ target_subdir=${target_noncanonical} # Command-line options. + +# Check whether --enable-version-specific-runtime-libs was given. +if test "${enable_version_specific_runtime_libs+set}" = set; then : + enableval=$enable_version_specific_runtime_libs; case "$enableval" in + yes|no) + ;; + *) + as_fn_error $? "--enable-version-specific-runtime-libs must be yes or no" "$LINENO" 5 + ;; + esac +else + enable_version_specific_runtime_libs=yes + +fi + + # Very limited version of AC_MAINTAINER_MODE. # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : @@ -2273,8 +2293,8 @@ case ${enable_version_specific_runtime_l # Need the gcc compiler version to know where to install libraries # and header files if --enable-version-specific-runtime-libs option # is selected. - toolexecdir='$(libdir)/gcc/$(target_alias)' - toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' + toolexecdir='$(libdir)/gcc/$(target_noncanonical)' + toolexeclibdir='$(toolexecdir)/$(version)$(MULTISUBDIR)/adalib' ;; no) if test -n "$with_cross_host" && @@ -2295,7 +2315,6 @@ case ${enable_version_specific_runtime_l esac -#TODO: toolexeclibdir is currently disregarded # Check the compiler. # The same as in boehm-gc and libstdc++. Have to borrow it from there. Index: gcc/libada/configure.ac =================================================================== --- gcc.orig/libada/configure.ac +++ gcc/libada/configure.ac @@ -38,6 +38,21 @@ ACX_NONCANONICAL_TARGET GCC_TOPLEV_SUBDIRS # Command-line options. + +AC_ARG_ENABLE(version-specific-runtime-libs, + [AS_HELP_STRING([--enable-version-specific-runtime-libs], + [specify that runtime libraries should be + installed in a compiler-specific directory])], + [case "$enableval" in + yes|no) + ;; + *) + AC_MSG_ERROR([--enable-version-specific-runtime-libs must be yes or no]) + ;; + esac], + [enable_version_specific_runtime_libs=yes] +) + # Very limited version of AC_MAINTAINER_MODE. AC_ARG_ENABLE([maintainer-mode], [AC_HELP_STRING([--enable-maintainer-mode], @@ -60,8 +75,8 @@ case ${enable_version_specific_runtime_l # Need the gcc compiler version to know where to install libraries # and header files if --enable-version-specific-runtime-libs option # is selected. - toolexecdir='$(libdir)/gcc/$(target_alias)' - toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' + toolexecdir='$(libdir)/gcc/$(target_noncanonical)' + toolexeclibdir='$(toolexecdir)/$(version)$(MULTISUBDIR)/adalib' ;; no) if test -n "$with_cross_host" && @@ -82,7 +97,6 @@ case ${enable_version_specific_runtime_l esac AC_SUBST(toolexecdir) AC_SUBST(toolexeclibdir) -#TODO: toolexeclibdir is currently disregarded # Check the compiler. # The same as in boehm-gc and libstdc++. Have to borrow it from there.