From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: bug#39941: Disk-image size increase on core-updates. Date: Tue, 17 Mar 2020 12:28:25 +0100 Message-ID: <87pndbb4py.fsf@gmail.com> References: <87sgimdjcj.fsf@gmail.com> <87eeu0h8d6.fsf@gmail.com> <87a74nhstf.fsf@gnu.org> <87zhcnympn.fsf@gmail.com> <87r1xyfx7o.fsf@gnu.org> <87a74jnr4f.fsf@gmail.com> <87y2s3ktkn.fsf@devup.no> <875zf5lv79.fsf@gmail.com> <87tv2pilrj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60180) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEAPG-0000eW-El for bug-guix@gnu.org; Tue, 17 Mar 2020 07:29:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEAP8-0000pC-Vd for bug-guix@gnu.org; Tue, 17 Mar 2020 07:29:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60491) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jEAP8-0000j1-JN for bug-guix@gnu.org; Tue, 17 Mar 2020 07:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jEAP8-0001Pu-Ec for bug-guix@gnu.org; Tue, 17 Mar 2020 07:29:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <87tv2pilrj.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 39941@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey, > Congrats on this, Mathieu! Thank you :) > Perhaps add =E2=80=9CFixes .=E2=80=9D Well I think it doesn't. In the bug report 39941, I reported a recent increase of the cross-compiled disk-image on core-updates (1.5 -> 2.0 GiB), over the last two months. It is not resolved, and this patch fixes something that has always been around I guess. >> + ;; TOOLDIR_BASE_PREFIX is erroneous when using a separate "lib" >> + ;; output. Specify it correctly, otherwise GCC won't find its shar= ed >> + ;; libraries installed in the "lib" output. > > How erroneous is it? Is there a bug report we could link to? I didn't find any bug report related. The issue is that in gcc/Makefile.in, when computing libsubdir_to_prefix: --8<---------------cut here---------------start------------->8--- libsubdir_to_prefix :=3D \ $(unlibsubdir)/$(shell echo "$(libdir)" | \ sed -e 's|^$(prefix)||' -e 's|/$$||' -e 's|^[^/]|/|' \ -e 's|/[^/]*|../|g') --8<---------------cut here---------------end--------------->8--- unlibsubdir is ../../../ libdir /gnu/store/xxx-gcc-cross-aarch64-linux-gnu-7.5.0-lib/lib prefix is /gnu/store/yyy-gcc-cross-aarch64-linux-gnu-7.5.0 then, libsubdir_to_prefix =3D ../../../../../.. Which then gives a search path that looks like: /gnu/store/5qh73asm77554wj43z2wjdrkl3fjxxbp-gcc-cross-aarch64-linux-gnu-7.5= .0-lib/lib/gcc/aarch64-linux-gnu/7.5.0/../../../../../../../aarch64-linux-g= nu/lib/aarch64-linux-gnu/7.5.0/ So its just that this hack is completely broken for non FHS compliant path I guess. Note that on our native toolchain, we have the same issue. If you run: --8<---------------cut here---------------start------------->8--- `guix build -e '(@@ (gnu packages gcc) gcc-9)'|tail -1`/bin/gcc -print-sea= rch-dirs --8<---------------cut here---------------end--------------->8--- You can see the same kind of wrong path: --8<---------------cut here---------------start------------->8--- /gnu/store/347y0zr1a9s2f5pkcncgi3gd0r33qq81-gcc-9.2.0-lib/lib/gcc/x86_64-un= known-linux-gnu/9.2.0/../../../../../../../x86_64-unknown-linux-gnu/lib/x86= _64-unknown-linux-gnu/9.2.0/ --8<---------------cut here---------------end--------------->8--- and it still works, because of this snippet in GCC, disabled when cross-compiling: --8<---------------cut here---------------start------------->8--- else if (*cross_compile =3D=3D '0') { add_prefix (&startfile_prefixes, concat (gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix, machine_suffix, standard_startfile_prefix, NULL), NULL, PREFIX_PRIORITY_LAST, 0, 1); } --8<---------------cut here---------------end--------------->8--- that produces an extra search-path that looks like: --8<---------------cut here---------------start------------->8--- /gnu/store/347y0zr1a9s2f5pkcncgi3gd0r33qq81-gcc-9.2.0-lib/lib/gcc/x86_64-un= known-linux-gnu/9.2.0/../../../ --8<---------------cut here---------------end--------------->8--- In short, quite a big mess... > Apologies for suggesting some more tedious work, but I think it=E2=80=99l= l be > helpful! :-) Hehe no worries, here's an updated patch :) Mathieu --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-cross-gcc-Add-a-lib-output.patch Content-Transfer-Encoding: quoted-printable >From 31402fc14126f04e175081ce851e9794cc3ab218 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sat, 14 Mar 2020 11:39:52 +0100 Subject: [PATCH] gnu: cross-gcc: Add a "lib" output. Add a "lib" output to cross-gcc. This requires an upstream GCC patch adding support for --with-toolexeclibdir configure option. This option allows to install cross-built GCC libraries in a specific location. This also fixes the computation of TOOLDIR_BASE_PREFIX, that fails when /gnu/store/... directories are involved. * gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/cross-base.scm (cross-gcc)[source]: Apply it, [outputs]: add a "lib" output, (cross-gcc-snippet): fix TOOLDIR_BASE_PREFIX. --- gnu/local.mk | 3 +- gnu/packages/cross-base.scm | 41 +- .../patches/gcc-7-cross-toolexeclibdir.patch | 1677 +++++++++++++++++ 3 files changed, 1707 insertions(+), 14 deletions(-) create mode 100644 gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch diff --git a/gnu/local.mk b/gnu/local.mk index 21a149c469..3af841efea 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -14,7 +14,7 @@ # Copyright =C2=A9 2016, 2017, 2018, 2019 Jan (janneke) Nieuwenhuizen # Copyright =C2=A9 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice # Copyright =C2=A9 2017, 2018 Cl=C3=A9ment Lassieur -# Copyright =C2=A9 2017 Mathieu Othacehe +# Copyright =C2=A9 2017, 2020 Mathieu Othacehe # Copyright =C2=A9 2017, 2018, 2019 G=C3=A1bor Boskovits # Copyright =C2=A9 2018 Amirouche Boubekki # Copyright =C2=A9 2018, 2019, 2020 Oleg Pykhalov @@ -911,6 +911,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/gcc-6-source-date-epoch-2.patch \ %D%/packages/patches/gcc-7-cross-mingw.patch \ %D%/packages/patches/gcc-7-cross-environment-variables.patch \ + %D%/packages/patches/gcc-7-cross-toolexeclibdir.patch \ %D%/packages/patches/gcc-8-cross-environment-variables.patch \ %D%/packages/patches/gcc-8-strmov-store-file-names.patch \ %D%/packages/patches/gcc-9-asan-fix-limits-include.patch \ diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 667d1f786a..d373e522d5 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -6,6 +6,7 @@ ;;; Copyright =C2=A9 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2019, 2020 Marius Bakke ;;; Copyright =C2=A9 2019 Carl Dong +;;; Copyright =C2=A9 2020 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -162,6 +163,13 @@ base compiler and using LIBC (which may be either a li= bc package or #f.)" "--disable-libsanitizer" )) =20 + ;; Install cross-built libraries such as libgcc_s.s= o in + ;; the "lib" output. + ,@(if libc + `((string-append "--with-toolexeclibdir=3D" + (assoc-ref %outputs "lib") + "/" ,target "/lib")) + '()) ;; For a newlib (non-glibc) target ,@(if (cross-newlib? target) '("--with-newlib") @@ -196,12 +204,18 @@ base compiler and using LIBC (which may be either a l= ibc package or #f.)" =20 (define (cross-gcc-snippet target) "Return GCC snippet needed for TARGET." - (cond ((target-mingw? target) - '(begin - (copy-recursively "libstdc++-v3/config/os/mingw32-w64" - "libstdc++-v3/config/os/newlib") - #t)) - (else #f))) + `(begin + ,@(if (target-mingw? target) + '((copy-recursively "libstdc++-v3/config/os/mingw32-w64" + "libstdc++-v3/config/os/newlib")) + '()) + ;; TOOLDIR_BASE_PREFIX is erroneous when using a separate "lib" + ;; output. Specify it correctly, otherwise GCC won't find its shared + ;; libraries installed in the "lib" output. + (substitute* "gcc/Makefile.in" + (("-DTOOLDIR_BASE_PREFIX=3D[^ ]*") + "-DTOOLDIR_BASE_PREFIX=3D\\\"../../../../\\\"")) + #t)) =20 (define* (cross-gcc target #:key @@ -220,18 +234,19 @@ target that libc." (patches (append (origin-patches (package-source xgcc)) - (cons (cond - ((version>=3D? (package-version xgcc) "8.0") (searc= h-patch "gcc-8-cross-environment-variables.patch")) - ((version>=3D? (package-version xgcc) "6.0") (searc= h-patch "gcc-6-cross-environment-variables.patch")) - (else (search-patch "gcc-cross-environment-variabl= es.patch"))) + (append (cond + ((version>=3D? (package-version xgcc) "8.0") + (search-patches "gcc-8-cross-environment-variables= .patch")) + ((version>=3D? (package-version xgcc) "6.0") + (search-patches "gcc-7-cross-toolexeclibdir.patch" + "gcc-6-cross-environment-variables= .patch")) + (else (search-patches "gcc-cross-environment-varia= bles.patch"))) (cross-gcc-patches xgcc target)))) (modules '((guix build utils))) (snippet (cross-gcc-snippet target)))) =20 - ;; For simplicity, use a single output. Otherwise libgcc_s & co. are = not - ;; found by default, etc. - (outputs '("out")) + (outputs '("out" "lib")) =20 (arguments `(#:implicit-inputs? #f diff --git a/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch b/gnu/pa= ckages/patches/gcc-7-cross-toolexeclibdir.patch new file mode 100644 index 0000000000..109e6f8b02 --- /dev/null +++ b/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch @@ -0,0 +1,1677 @@ +This patch taken from GCC upstream adds support for overriding cross-compi= led +shared libraries installation path. This is needed to have a separate "li= b" +output containing those shared libraries. + +See: +https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommit;h=3De8e66971cdc6d1390d47a2= 27899e2e340ff44d66 + +This commit has been stripped. Some modifications to Changelogs and +configure.ac scripts were removed. + +From fe6b5640a52a6e75dddea834e357974c205c737c Mon Sep 17 00:00:00 2001 +From: "Maciej W. Rozycki" +Date: Fri, 24 Jan 2020 11:24:25 +0000 +Subject: [PATCH] Add `--with-toolexeclibdir=3D' configuration option + +Provide means, in the form of a `--with-toolexeclibdir=3D' configuration +option, to override the default installation directory for target +libraries, otherwise known as $toolexeclibdir. This is so that it is +possible to get newly-built libraries, particularly the shared ones, +installed in a common place, so that they can be readily used by the +target system as their host libraries, possibly over NFS, without a need +to manually copy them over from the currently hardcoded location they +would otherwise be installed in. + +In the presence of the `--enable-version-specific-runtime-libs' option +and for configurations building native GCC the option is ignored. + +diff --git a/config/toolexeclibdir.m4 b/config/toolexeclibdir.m4 +new file mode 100644 +index 00000000000..5dd89786219 +--- /dev/null ++++ b/config/toolexeclibdir.m4 +@@ -0,0 +1,31 @@ ++dnl toolexeclibdir override support. ++dnl Copyright (C) 2020 Free Software Foundation, Inc. ++dnl ++dnl This program is free software; you can redistribute it and/or modify ++dnl it under the terms of the GNU General Public License as published by ++dnl the Free Software Foundation; either version 3, or (at your option) ++dnl any later version. ++dnl ++dnl This program is distributed in the hope that it will be useful, ++dnl but WITHOUT ANY WARRANTY; without even the implied warranty of ++dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++dnl GNU General Public License for more details. ++dnl ++dnl You should have received a copy of the GNU General Public License ++dnl along with this program; see the file COPYING3. If not see ++dnl . ++ ++AC_DEFUN([GCC_WITH_TOOLEXECLIBDIR], ++[AC_ARG_WITH(toolexeclibdir, ++ [AS_HELP_STRING([--with-toolexeclibdir=3DDIR], ++ [install libraries built with a cross compiler within DIR])], ++ [dnl ++case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac], ++ [with_toolexeclibdir=3Dno]) ++]) +diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi +index 77ba08d3f21..28cb6d88da8 100644 +--- a/gcc/doc/install.texi ++++ b/gcc/doc/install.texi +@@ -2083,6 +2083,10 @@ shorthand for + The following options only apply to building cross compilers. +=20 + @table @code ++@item --with-toolexeclibdir=3D@var{dir} ++Specify the installation directory for libraries built with a cross compi= ler. ++The default is @option{$@{gcc_tooldir@}/lib}. ++ + @item --with-sysroot + @itemx --with-sysroot=3D@var{dir} + Tells GCC to consider @var{dir} as the root of a tree that contains +diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in +index f6eeab312ea..86d7ba20c19 100644 +--- a/libatomic/Makefile.in ++++ b/libatomic/Makefile.in +@@ -72,6 +72,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libatomic/aclocal.m4 b/libatomic/aclocal.m4 +index 1363e7b9cbc..f1a3f1dda26 100644 +--- a/libatomic/aclocal.m4 ++++ b/libatomic/aclocal.m4 +@@ -1017,6 +1017,7 @@ m4_include([../config/lthostflags.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) + m4_include([../config/stdint.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) + m4_include([../ltversion.m4]) +diff --git a/libatomic/configure b/libatomic/configure +index 2ae9b8d40f3..0fa531ec4a3 100755 +--- a/libatomic/configure ++++ b/libatomic/configure +@@ -755,6 +755,7 @@ enable_option_checking + enable_version_specific_runtime_libs + enable_generated_files_in_srcdir + enable_multilib ++with_toolexeclibdir + enable_dependency_tracking + enable_shared + enable_static +@@ -1414,6 +1415,9 @@ Optional Features: + Optional Packages: + --with-PACKAGE[=3DARG] use PACKAGE [ARG=3Dyes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=3Dno) ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] +@@ -3185,6 +3189,22 @@ fi + ac_config_commands=3D"$ac_config_commands default-1" +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir + # Also toolexecdir, though it's only used in toolexeclibdir + case ${enable_version_specific_runtime_libs} in +@@ -3200,7 +3220,14 @@ case ${enable_version_specific_runtime_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +@@ -11115,7 +11142,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11118 "configure" ++#line 11145 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11221,7 +11248,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11224 "configure" ++#line 11251 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefil= e.in +index adfc231484a..a2a76e07502 100644 +--- a/libatomic/testsuite/Makefile.in ++++ b/libatomic/testsuite/Makefile.in +@@ -61,6 +61,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libffi/Makefile.in b/libffi/Makefile.in +index 8a99ee58b68..032dadf4c4a 100644 +--- a/libffi/Makefile.in ++++ b/libffi/Makefile.in +@@ -72,6 +72,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ +diff --git a/libffi/aclocal.m4 b/libffi/aclocal.m4 +index 6d6207eb897..9cd050aaaf5 100644 +--- a/libffi/aclocal.m4 ++++ b/libffi/aclocal.m4 +@@ -1051,6 +1051,7 @@ m4_include([../config/depstand.m4]) + m4_include([../config/lead-dot.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../libtool.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) +diff --git a/libffi/configure b/libffi/configure +index 790a291011f..6e37039e84c 100755 +--- a/libffi/configure ++++ b/libffi/configure +@@ -777,6 +777,7 @@ enable_debug + enable_structs + enable_raw_api + enable_purify_safety ++with_toolexeclibdir + enable_symvers + with_gcc_major_version_only + ' +@@ -1436,6 +1437,9 @@ Optional Packages: + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-gcc-major-version-only + use only GCC major number in filesystem paths +=20 +@@ -11390,7 +11394,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11393 "configure" ++#line 11397 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11496,7 +11500,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11499 "configure" ++#line 11507 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -16002,10 +16006,33 @@ $as_echo "#define USING_PURIFY 1" >>confdefs.h + fi +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + if test -n "$with_cross_host" && + test x"$with_cross_host" !=3D x"no"; then + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in +index e0c75992327..3762e6c9b68 100644 +--- a/libffi/include/Makefile.in ++++ b/libffi/include/Makefile.in +@@ -62,6 +62,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ +diff --git a/libffi/man/Makefile.in b/libffi/man/Makefile.in +index 0243bdbedfa..12e61e485eb 100644 +--- a/libffi/man/Makefile.in ++++ b/libffi/man/Makefile.in +@@ -60,6 +60,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ +diff --git a/libffi/testsuite/Makefile.in b/libffi/testsuite/Makefile.in +index b7da4b0b3e7..469b251b17f 100644 +--- a/libffi/testsuite/Makefile.in ++++ b/libffi/testsuite/Makefile.in +@@ -60,6 +60,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ +diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in +index a1a392de88d..3a94dab2fdd 100644 +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -163,6 +163,7 @@ AUTOCONF =3D autoconf + configure_deps =3D \ + $(srcdir)/../config/enable.m4 \ + $(srcdir)/../config/tls.m4 \ ++ $(srcdir)/../config/toolexeclibdir.m4 \ + $(srcdir)/../config/acx.m4 \ + $(srcdir)/../config/no-executables.m4 \ + $(srcdir)/../config/lib-ld.m4 \ +diff --git a/libgcc/configure b/libgcc/configure +index 441601a1f76..976827dc57e 100644 +--- a/libgcc/configure ++++ b/libgcc/configure +@@ -669,6 +669,7 @@ enable_shared + enable_vtable_verify + with_aix_soname + enable_version_specific_runtime_libs ++with_toolexeclibdir + with_slibdir + enable_maintainer_mode + with_build_libsubdir +@@ -1329,6 +1330,9 @@ Optional Packages: + --with-aix-soname=3Daix|svr4|both + shared library versioning (aka "SONAME") varian= t to + provide on AIX ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-slibdir=3DDIR shared libraries in DIR LIBDIR + --with-build-libsubdir=3DDIR Directory where to find libraries for bui= ld system + --with-system-libunwind use installed libunwind +@@ -2403,6 +2407,22 @@ fi + $as_echo "$version_specific_libs" >&6; } +=20 +=20 ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ ++ + # Check whether --with-slibdir was given. + if test "${with_slibdir+set}" =3D set; then : + withval=3D$with_slibdir; slibdir=3D"$with_slibdir" +@@ -2410,7 +2430,14 @@ else + if test "${version_specific_libs}" =3D yes; then + slibdir=3D'$(libsubdir)' + elif test -n "$with_cross_host" && test x"$with_cross_host" !=3D x"no"; t= hen +- slibdir=3D'$(exec_prefix)/$(host_noncanonical)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ slibdir=3D'$(exec_prefix)/$(host_noncanonical)/lib' ++ ;; ++ *) ++ slibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + slibdir=3D'$(libdir)' + fi +@@ -2640,7 +2667,14 @@ case ${version_specific_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_noncanonical)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_noncanonical)' + toolexeclibdir=3D'$(libdir)' +diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in +index 920d29d1c4c..9deafc4e0ce 100644 +--- a/libgomp/Makefile.in ++++ b/libgomp/Makefile.in +@@ -101,6 +101,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4= \ + $(top_srcdir)/../config/lthostflags.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/stdint.m4 \ + $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libgomp/aclocal.m4 b/libgomp/aclocal.m4 +index a1f51f27651..c244c2549e5 100644 +--- a/libgomp/aclocal.m4 ++++ b/libgomp/aclocal.m4 +@@ -998,6 +998,7 @@ m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) + m4_include([../config/stdint.m4]) + m4_include([../config/tls.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) + m4_include([../ltversion.m4]) +diff --git a/libgomp/configure b/libgomp/configure +index 06166c66120..6b3beae0f63 100755 +--- a/libgomp/configure ++++ b/libgomp/configure +@@ -782,6 +782,7 @@ enable_option_checking + enable_version_specific_runtime_libs + enable_generated_files_in_srcdir + enable_multilib ++with_toolexeclibdir + enable_dependency_tracking + enable_shared + enable_static +@@ -1455,6 +1456,9 @@ Optional Features: + Optional Packages: + --with-PACKAGE[=3DARG] use PACKAGE [ARG=3Dyes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=3Dno) ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] +@@ -3338,6 +3342,22 @@ fi + ac_config_commands=3D"$ac_config_commands default-1" +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir + # Also toolexecdir, though it's only used in toolexeclibdir + case ${enable_version_specific_runtime_libs} in +@@ -3353,7 +3373,14 @@ case ${enable_version_specific_runtime_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +@@ -11155,7 +11182,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11158 "configure" ++#line 11185 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11261,7 +11288,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11264 "configure" ++#line 11295 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in +index 6edb7ae7ade..0492e7788ab 100644 +--- a/libgomp/testsuite/Makefile.in ++++ b/libgomp/testsuite/Makefile.in +@@ -63,6 +63,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/lthostflags.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/stdint.m4 \ + $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libhsail-rt/Makefile.in b/libhsail-rt/Makefile.in +index 528cdb0b423..0b6596b79bc 100644 +--- a/libhsail-rt/Makefile.in ++++ b/libhsail-rt/Makefile.in +@@ -106,6 +106,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4= \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac +diff --git a/libhsail-rt/aclocal.m4 b/libhsail-rt/aclocal.m4 +index 505744c695a..05de587bda2 100644 +--- a/libhsail-rt/aclocal.m4 ++++ b/libhsail-rt/aclocal.m4 +@@ -992,6 +992,7 @@ m4_include([../config/acx.m4]) + m4_include([../config/depstand.m4]) + m4_include([../config/lead-dot.m4]) + m4_include([../config/override.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../libtool.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) +diff --git a/libhsail-rt/configure b/libhsail-rt/configure +index a4fcc10c1f9..1b4f2a953d0 100755 +--- a/libhsail-rt/configure ++++ b/libhsail-rt/configure +@@ -737,6 +737,7 @@ enable_option_checking + enable_maintainer_mode + enable_dependency_tracking + enable_version_specific_runtime_libs ++with_toolexeclibdir + enable_shared + enable_static + with_pic +@@ -1395,6 +1396,9 @@ Optional Features: + Optional Packages: + --with-PACKAGE[=3DARG] use PACKAGE [ARG=3Dyes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=3Dno) ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] +@@ -4418,6 +4422,22 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_version_specific= _runtime_libs" >&5 + $as_echo "$enable_version_specific_runtime_libs" >&6; } +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir + # Also toolexecdir, though it's only used in toolexeclibdir + case ${enable_version_specific_runtime_libs} in +@@ -4433,7 +4453,14 @@ case ${enable_version_specific_runtime_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +@@ -10973,7 +11000,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10976 "configure" ++#line 11003 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11079,7 +11106,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11082 "configure" ++#line 11113 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +diff --git a/libitm/Makefile.in b/libitm/Makefile.in +index bd16ce0cfb8..851c6b37f0b 100644 +--- a/libitm/Makefile.in ++++ b/libitm/Makefile.in +@@ -74,6 +74,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ + $(top_srcdir)/../config/tls.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/weakref.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ +diff --git a/libitm/aclocal.m4 b/libitm/aclocal.m4 +index 26de26b7808..3b67780342a 100644 +--- a/libitm/aclocal.m4 ++++ b/libitm/aclocal.m4 +@@ -1022,6 +1022,7 @@ m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) + m4_include([../config/stdint.m4]) + m4_include([../config/tls.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../config/weakref.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) +diff --git a/libitm/configure b/libitm/configure +index 96c494d4a3f..ed47fab3c83 100644 +--- a/libitm/configure ++++ b/libitm/configure +@@ -766,6 +766,7 @@ enable_option_checking + enable_version_specific_runtime_libs + enable_generated_files_in_srcdir + enable_multilib ++with_toolexeclibdir + enable_dependency_tracking + enable_shared + enable_static +@@ -1430,6 +1431,9 @@ Optional Features: + Optional Packages: + --with-PACKAGE[=3DARG] use PACKAGE [ARG=3Dyes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=3Dno) ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] +@@ -3371,6 +3375,22 @@ fi + ac_config_commands=3D"$ac_config_commands default-1" +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir + # Also toolexecdir, though it's only used in toolexeclibdir + case ${enable_version_specific_runtime_libs} in +@@ -3386,7 +3406,14 @@ case ${enable_version_specific_runtime_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +@@ -11794,7 +11821,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11797 "configure" ++#line 11824 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11900,7 +11927,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11903 "configure" ++#line 11934 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +diff --git a/libitm/testsuite/Makefile.in b/libitm/testsuite/Makefile.in +index eb9e992279d..88d2120c156 100644 +--- a/libitm/testsuite/Makefile.in ++++ b/libitm/testsuite/Makefile.in +@@ -66,6 +66,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ + $(top_srcdir)/../config/tls.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/weakref.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ +diff --git a/liboffloadmic/Makefile.in b/liboffloadmic/Makefile.in +index f4470c6e4d4..d42745a49e0 100644 +--- a/liboffloadmic/Makefile.in ++++ b/liboffloadmic/Makefile.in +@@ -94,6 +94,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac +diff --git a/liboffloadmic/aclocal.m4 b/liboffloadmic/aclocal.m4 +index 4bb1d43a5e5..c62ed26f6b1 100644 +--- a/liboffloadmic/aclocal.m4 ++++ b/liboffloadmic/aclocal.m4 +@@ -993,6 +993,7 @@ m4_include([../config/depstand.m4]) + m4_include([../config/lead-dot.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../libtool.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) +diff --git a/liboffloadmic/configure b/liboffloadmic/configure +index f873716991b..6dfe9e37642 100644 +--- a/liboffloadmic/configure ++++ b/liboffloadmic/configure +@@ -739,6 +739,7 @@ enable_maintainer_mode + enable_dependency_tracking + enable_multilib + enable_version_specific_runtime_libs ++with_toolexeclibdir + enable_shared + enable_static + with_pic +@@ -1397,6 +1398,9 @@ Optional Features: + Optional Packages: + --with-PACKAGE[=3DARG] use PACKAGE [ARG=3Dyes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=3Dno) ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] +@@ -5003,6 +5007,22 @@ else + fi +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir. + # Also toolexecdir, though it's only used in toolexeclibdir. + case ${enable_version_specific_runtime_libs} in +@@ -5018,7 +5038,14 @@ case ${enable_version_specific_runtime_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +@@ -11108,7 +11135,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11111 "configure" ++#line 11138 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11214,7 +11241,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11217 "configure" ++#line 11248 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +diff --git a/liboffloadmic/plugin/Makefile.in b/liboffloadmic/plugin/Makef= ile.in +index 2a7c8d2ec6c..6e180f6a23c 100644 +--- a/liboffloadmic/plugin/Makefile.in ++++ b/liboffloadmic/plugin/Makefile.in +@@ -90,6 +90,7 @@ DIST_COMMON =3D $(srcdir)/Makefile.in $(srcdir)/Makefile= .am \ + ACLOCAL_M4 =3D $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps =3D $(top_srcdir)/../../config/acx.m4 \ + $(top_srcdir)/../../config/depstand.m4 \ ++ $(top_srcdir)/../../config/toolexeclibdir.m4 \ + $(top_srcdir)/../../config/lead-dot.m4 \ + $(top_srcdir)/../../config/multi.m4 \ + $(top_srcdir)/../../config/override.m4 \ +diff --git a/liboffloadmic/plugin/aclocal.m4 b/liboffloadmic/plugin/acloca= l.m4 +index a4179ef40ac..6d90e5d6e16 100644 +--- a/liboffloadmic/plugin/aclocal.m4 ++++ b/liboffloadmic/plugin/aclocal.m4 +@@ -990,6 +990,7 @@ AC_SUBST([am__untar]) +=20 + m4_include([../../config/acx.m4]) + m4_include([../../config/depstand.m4]) ++m4_include([../../config/toolexeclibdir.m4]) + m4_include([../../config/lead-dot.m4]) + m4_include([../../config/multi.m4]) + m4_include([../../config/override.m4]) +diff --git a/liboffloadmic/plugin/configure b/liboffloadmic/plugin/configu= re +index c031eb3e7fa..570758344b4 100644 +--- a/liboffloadmic/plugin/configure ++++ b/liboffloadmic/plugin/configure +@@ -735,6 +735,7 @@ enable_maintainer_mode + enable_dependency_tracking + enable_multilib + enable_version_specific_runtime_libs ++with_toolexeclibdir + enable_shared + enable_static + with_pic +@@ -1394,6 +1395,9 @@ Optional Features: + Optional Packages: + --with-PACKAGE[=3DARG] use PACKAGE [ARG=3Dyes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=3Dno) ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] +@@ -4311,6 +4315,22 @@ fi + $as_echo "$enable_version_specific_runtime_libs" >&6; } +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir. + # Also toolexecdir, though it's only used in toolexeclibdir. + case ${enable_version_specific_runtime_libs} in +@@ -4326,7 +4346,14 @@ case ${enable_version_specific_runtime_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +@@ -10815,7 +10842,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10818 "configure" ++#line 10845 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -10921,7 +10948,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10924 "configure" ++#line 10955 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in +index 428e0158aca..e5c7aba84b7 100644 +--- a/libquadmath/Makefile.in ++++ b/libquadmath/Makefile.in +@@ -67,6 +67,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libquadmath/aclocal.m4 b/libquadmath/aclocal.m4 +index b9ebb8a9ed4..59009468a47 100644 +--- a/libquadmath/aclocal.m4 ++++ b/libquadmath/aclocal.m4 +@@ -1030,6 +1030,7 @@ m4_include([../config/lthostflags.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/no-executables.m4]) + m4_include([../config/override.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) + m4_include([../ltversion.m4]) +diff --git a/libquadmath/configure b/libquadmath/configure +index 76a2c20b7e1..e887071aeb2 100755 +--- a/libquadmath/configure ++++ b/libquadmath/configure +@@ -749,6 +749,7 @@ enable_fast_install + with_gnu_ld + enable_libtool_lock + enable_maintainer_mode ++with_toolexeclibdir + enable_symvers + enable_generated_files_in_srcdir + with_gcc_major_version_only +@@ -1408,6 +1409,9 @@ Optional Packages: + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-gcc-major-version-only + use only GCC major number in filesystem paths +=20 +@@ -10572,7 +10576,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10575 "configure" ++#line 10579 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -10678,7 +10682,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10681 "configure" ++#line 10689 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11917,6 +11921,22 @@ ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPP= FLAGS $LDFLAGS conftest.$ac_ext $ + ac_compiler_gnu=3D$ac_cv_c_compiler_gnu +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir + # Also toolexecdir, though it's only used in toolexeclibdir + case ${version_specific_libs} in +@@ -11932,7 +11952,14 @@ case ${version_specific_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in +index 1f4bb8cd6bb..fb533c253ea 100644 +--- a/libsanitizer/Makefile.in ++++ b/libsanitizer/Makefile.in +@@ -71,6 +71,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libsanitizer/aclocal.m4 b/libsanitizer/aclocal.m4 +index 55e063530f6..f51347671e3 100644 +--- a/libsanitizer/aclocal.m4 ++++ b/libsanitizer/aclocal.m4 +@@ -1017,6 +1017,7 @@ m4_include([../config/libstdc++-raw-cxx.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/override.m4]) + m4_include([../config/stdint.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) + m4_include([../ltversion.m4]) +diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in +index 4dad60ba1ae..f079e07f0da 100644 +--- a/libsanitizer/asan/Makefile.in ++++ b/libsanitizer/asan/Makefile.in +@@ -66,6 +66,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libsanitizer/configure b/libsanitizer/configure +index a3a08d635f4..5f4cdcad38d 100755 +--- a/libsanitizer/configure ++++ b/libsanitizer/configure +@@ -767,6 +767,7 @@ enable_multilib + enable_version_specific_runtime_libs + enable_dependency_tracking + enable_maintainer_mode ++with_toolexeclibdir + enable_shared + enable_static + with_pic +@@ -1425,6 +1426,9 @@ Optional Features: + Optional Packages: + --with-PACKAGE[=3DARG] use PACKAGE [ARG=3Dyes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=3Dno) ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] +@@ -4773,6 +4777,22 @@ fi +=20 +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir + # Also toolexecdir, though it's only used in toolexeclibdir + case ${version_specific_libs} in +@@ -4788,7 +4808,14 @@ case ${version_specific_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +@@ -12032,7 +12059,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 12035 "configure" ++#line 12062 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -12138,7 +12165,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 12141 "configure" ++#line 12168 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +diff --git a/libsanitizer/interception/Makefile.in b/libsanitizer/intercep= tion/Makefile.in +index c71fb57b8b8..ed9c996b5eb 100644 +--- a/libsanitizer/interception/Makefile.in ++++ b/libsanitizer/interception/Makefile.in +@@ -62,6 +62,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libsanitizer/libbacktrace/Makefile.in b/libsanitizer/libbackt= race/Makefile.in +index dff04cfa3ea..22655306594 100644 +--- a/libsanitizer/libbacktrace/Makefile.in ++++ b/libsanitizer/libbacktrace/Makefile.in +@@ -94,6 +94,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libsanitizer/lsan/Makefile.in b/libsanitizer/lsan/Makefile.in +index baa8367cd40..efae691d3ef 100644 +--- a/libsanitizer/lsan/Makefile.in ++++ b/libsanitizer/lsan/Makefile.in +@@ -63,6 +63,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libsanitizer/sanitizer_common/Makefile.in b/libsanitizer/sani= tizer_common/Makefile.in +index c375f63a380..27c8b410ef7 100644 +--- a/libsanitizer/sanitizer_common/Makefile.in ++++ b/libsanitizer/sanitizer_common/Makefile.in +@@ -68,6 +68,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in +index 770c053e64f..a77cda3d0f3 100644 +--- a/libsanitizer/tsan/Makefile.in ++++ b/libsanitizer/tsan/Makefile.in +@@ -65,6 +65,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libsanitizer/ubsan/Makefile.in b/libsanitizer/ubsan/Makefile.= in +index 1664ce9497e..108505c3c67 100644 +--- a/libsanitizer/ubsan/Makefile.in ++++ b/libsanitizer/ubsan/Makefile.in +@@ -64,6 +64,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ +diff --git a/libssp/Makefile.in b/libssp/Makefile.in +index 96b03ae1248..c119ef3e8a2 100644 +--- a/libssp/Makefile.in ++++ b/libssp/Makefile.in +@@ -67,6 +67,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/multi.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac +diff --git a/libssp/aclocal.m4 b/libssp/aclocal.m4 +index 927988e5814..46585360592 100644 +--- a/libssp/aclocal.m4 ++++ b/libssp/aclocal.m4 +@@ -995,6 +995,7 @@ m4_include([../config/lthostflags.m4]) + m4_include([../config/multi.m4]) + m4_include([../config/no-executables.m4]) + m4_include([../config/override.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../libtool.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) +diff --git a/libssp/configure b/libssp/configure +index ee1751d20db..3273cd40ab1 100755 +--- a/libssp/configure ++++ b/libssp/configure +@@ -743,6 +743,7 @@ with_pic + enable_fast_install + with_gnu_ld + enable_libtool_lock ++with_toolexeclibdir + with_gcc_major_version_only + ' + ac_precious_vars=3D'build_alias +@@ -1389,6 +1390,9 @@ Optional Packages: + --with-pic try to use only PIC/non-PIC objects [default=3D= use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=3Dno] ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-gcc-major-version-only + use only GCC major number in filesystem paths +=20 +@@ -10671,7 +10675,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10674 "configure" ++#line 10678 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -10777,7 +10781,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10780 "configure" ++#line 10784 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11039,6 +11043,22 @@ esac +=20 +=20 +=20 ++ ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ ++ ++ + # Calculate toolexeclibdir + # Also toolexecdir, though it's only used in toolexeclibdir + case ${version_specific_libs} in +@@ -11054,7 +11074,14 @@ case ${version_specific_libs} in + test x"$with_cross_host" !=3D x"no"; then + # Install a library built with a cross compiler in tooldir, not lib= dir. + toolexecdir=3D'$(exec_prefix)/$(target_alias)' +- toolexeclibdir=3D'$(toolexecdir)/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ toolexeclibdir=3D'$(toolexecdir)/lib' ++ ;; ++ *) ++ toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + toolexecdir=3D'$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir=3D'$(libdir)' +diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in +index 85d56fb6a04..a4242569962 100644 +--- a/libstdc++-v3/Makefile.in ++++ b/libstdc++-v3/Makefile.in +@@ -74,6 +74,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 +index 08319dc5549..b97ff8db335 100644 +--- a/libstdc++-v3/acinclude.m4 ++++ b/libstdc++-v3/acinclude.m4 +@@ -790,6 +790,8 @@ AC_DEFUN([GLIBCXX_EXPORT_INSTALL_INFO], [ + [version_specific_libs=3Dno]) + AC_MSG_RESULT($version_specific_libs) +=20 ++ GCC_WITH_TOOLEXECLIBDIR ++ + # Default case for install directory for include files. + if test $version_specific_libs =3D no && test $gxx_include_dir =3D no; = then + gxx_include_dir=3D'include/c++/${gcc_version}' +@@ -820,7 +822,14 @@ AC_DEFUN([GLIBCXX_EXPORT_INSTALL_INFO], [ + if test -n "$with_cross_host" && + test x"$with_cross_host" !=3D x"no"; then + glibcxx_toolexecdir=3D'${exec_prefix}/${host_alias}' +- glibcxx_toolexeclibdir=3D'${toolexecdir}/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ glibcxx_toolexeclibdir=3D'${toolexecdir}/lib' ++ ;; ++ *) ++ glibcxx_toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + glibcxx_toolexecdir=3D'${libdir}/gcc/${host_alias}' + glibcxx_toolexeclibdir=3D'${libdir}' +diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 +index 229d0354116..16c6e61cf7e 100644 +--- a/libstdc++-v3/aclocal.m4 ++++ b/libstdc++-v3/aclocal.m4 +@@ -684,6 +684,7 @@ m4_include([../config/multi.m4]) + m4_include([../config/no-executables.m4]) + m4_include([../config/override.m4]) + m4_include([../config/stdint.m4]) ++m4_include([../config/toolexeclibdir.m4]) + m4_include([../config/unwind_ipinfo.m4]) + m4_include([../libtool.m4]) + m4_include([../ltoptions.m4]) +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index de8390703e2..88de3f728d4 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -903,6 +903,7 @@ enable_libstdcxx_threads + enable_libstdcxx_filesystem_ts + with_gxx_include_dir + enable_version_specific_runtime_libs ++with_toolexeclibdir + with_gcc_major_version_only + ' + ac_precious_vars=3D'build_alias +@@ -1623,6 +1624,9 @@ Optional Packages: + set the std::string ABI to use by default + --with-gxx-include-dir=3DDIR + installation directory for include files ++ --with-toolexeclibdir=3DDIR ++ install libraries built with a cross compiler w= ithin ++ DIR + --with-gcc-major-version-only + use only GCC major number in filesystem paths +=20 +@@ -11606,7 +11610,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11609 "configure" ++#line 11613 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -11712,7 +11716,7 @@ else + lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 + lt_status=3D$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11715 "configure" ++#line 11723 "configure" + #include "confdefs.h" +=20 + #if HAVE_DLFCN_H +@@ -15398,7 +15402,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } + # Fake what AC_TRY_COMPILE does. +=20 + cat > conftest.$ac_ext << EOF +-#line 15401 "configure" ++#line 15409 "configure" + int main() + { + typedef bool atomic_type; +@@ -15433,7 +15437,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } + rm -f conftest* +=20 + cat > conftest.$ac_ext << EOF +-#line 15436 "configure" ++#line 15440 "configure" + int main() + { + typedef short atomic_type; +@@ -15468,7 +15472,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } + rm -f conftest* +=20 + cat > conftest.$ac_ext << EOF +-#line 15471 "configure" ++#line 15475 "configure" + int main() + { + // NB: _Atomic_word not necessarily int. +@@ -15504,7 +15508,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } + rm -f conftest* +=20 + cat > conftest.$ac_ext << EOF +-#line 15507 "configure" ++#line 15511 "configure" + int main() + { + typedef long long atomic_type; +@@ -15585,7 +15589,7 @@ $as_echo "$as_me: WARNING: Performance of certain = classes will degrade as a resu + # unnecessary for this test. +=20 + cat > conftest.$ac_ext << EOF +-#line 15588 "configure" ++#line 15592 "configure" + int main() + { + _Decimal32 d1; +@@ -15627,7 +15631,7 @@ ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu + # unnecessary for this test. +=20 + cat > conftest.$ac_ext << EOF +-#line 15630 "configure" ++#line 15634 "configure" + template + struct same + { typedef T2 type; }; +@@ -15661,7 +15665,7 @@ $as_echo "$enable_int128" >&6; } + rm -f conftest* +=20 + cat > conftest.$ac_ext << EOF +-#line 15664 "configure" ++#line 15668 "configure" + template + struct same + { typedef T2 type; }; +@@ -81674,6 +81678,19 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version_specific_libs= " >&5 + $as_echo "$version_specific_libs" >&6; } +=20 ++# Check whether --with-toolexeclibdir was given. ++if test "${with_toolexeclibdir+set}" =3D set; then : ++ withval=3D$with_toolexeclibdir; case ${with_toolexeclibdir} in ++ /) ++ ;; ++ */) ++ with_toolexeclibdir=3D`echo $with_toolexeclibdir | sed 's,/$,,'` ++ ;; ++esac ++else ++ with_toolexeclibdir=3Dno ++fi ++ + # Default case for install directory for include files. + if test $version_specific_libs =3D no && test $gxx_include_dir =3D no; = then + gxx_include_dir=3D'include/c++/${gcc_version}' +@@ -81704,7 +81721,14 @@ $as_echo "$version_specific_libs" >&6; } + if test -n "$with_cross_host" && + test x"$with_cross_host" !=3D x"no"; then + glibcxx_toolexecdir=3D'${exec_prefix}/${host_alias}' +- glibcxx_toolexeclibdir=3D'${toolexecdir}/lib' ++ case ${with_toolexeclibdir} in ++ no) ++ glibcxx_toolexeclibdir=3D'${toolexecdir}/lib' ++ ;; ++ *) ++ glibcxx_toolexeclibdir=3D${with_toolexeclibdir} ++ ;; ++ esac + else + glibcxx_toolexecdir=3D'${libdir}/gcc/${host_alias}' + glibcxx_toolexeclibdir=3D'${libdir}' +diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in +index c98c42fce98..c61f0dc1aa0 100644 +--- a/libstdc++-v3/doc/Makefile.in ++++ b/libstdc++-v3/doc/Makefile.in +@@ -69,6 +69,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makef= ile.in +index 980cabb80e2..e57652bbda0 100644 +--- a/libstdc++-v3/include/Makefile.in ++++ b/libstdc++-v3/include/Makefile.in +@@ -69,6 +69,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/M= akefile.in +index 7386771d475..c0296d0a342 100644 +--- a/libstdc++-v3/libsupc++/Makefile.in ++++ b/libstdc++-v3/libsupc++/Makefile.in +@@ -71,6 +71,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in +index d92d8b8ac6a..1166a4f55d1 100644 +--- a/libstdc++-v3/po/Makefile.in ++++ b/libstdc++-v3/po/Makefile.in +@@ -69,6 +69,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefil= e.in +index df8285226fa..188a3ab1a5d 100644 +--- a/libstdc++-v3/python/Makefile.in ++++ b/libstdc++-v3/python/Makefile.in +@@ -70,6 +70,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in +index f0755f015a1..b168f992be8 100644 +--- a/libstdc++-v3/src/Makefile.in ++++ b/libstdc++-v3/src/Makefile.in +@@ -70,6 +70,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/src/c++11/Makefile.in b/libstdc++-v3/src/c++11/M= akefile.in +index 73852e75c25..8dff9e75ab6 100644 +--- a/libstdc++-v3/src/c++11/Makefile.in ++++ b/libstdc++-v3/src/c++11/Makefile.in +@@ -70,6 +70,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/src/c++17/Makefile.in b/libstdc++-v3/src/c++17/M= akefile.in +index 26a4713831d..07a88759fb2 100644 +--- a/libstdc++-v3/src/c++17/Makefile.in ++++ b/libstdc++-v3/src/c++17/Makefile.in +@@ -105,6 +105,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4= \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/M= akefile.in +index c0a55171935..1e168815777 100644 +--- a/libstdc++-v3/src/c++98/Makefile.in ++++ b/libstdc++-v3/src/c++98/Makefile.in +@@ -70,6 +70,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/src/filesystem/Makefile.in b/libstdc++-v3/src/fi= lesystem/Makefile.in +index 3312d0306ca..bf32707c781 100644 +--- a/libstdc++-v3/src/filesystem/Makefile.in ++++ b/libstdc++-v3/src/filesystem/Makefile.in +@@ -70,6 +70,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/M= akefile.in +index 5797a55b728..61cd1317a16 100644 +--- a/libstdc++-v3/testsuite/Makefile.in ++++ b/libstdc++-v3/testsuite/Makefile.in +@@ -69,6 +69,7 @@ am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/no-executables.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/stdint.m4 \ ++ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ +--=20 +2.24.0 + --=20 2.24.0 --=-=-=--