From: Mathieu Othacehe <m.othacehe@gmail.com>
To: Marius Bakke <mbakke@fastmail.com>
Cc: 39941@debbugs.gnu.org
Subject: bug#39941: Disk-image size increase on core-updates.
Date: Sun, 15 Mar 2020 12:21:46 +0100 [thread overview]
Message-ID: <875zf5lv79.fsf@gmail.com> (raw)
In-Reply-To: <87y2s3ktkn.fsf@devup.no>
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
Hey Marius,
> Maybe file a different bug report for those so it does not get
> forgotten? One thing at the time...
Ok!
> FWIW I think the original problem with huge closure increase has been
> fixed with 8e98f750e63e8723db0361f4e3e960193278fa47 and
> 7688dbbdd7a7a091c9a0fc4850e70725e3ff64e3.
>
> I'm getting 1372 MiB for the cross-mini example at approximately commit
> d594963856690f1aacf228c8a83e406d33bc44ce (cross-built for
> arm-linux-gnueabihf).
What's cross-mini? On commit d594963856690f1aacf228c8a83e406d33bc44ce of
core-updates (both patches you mentionned included), I still have a
1.9GiB closure.
Note, that applying the "lib" output patch, it drops down to 1.6GiB,
which is good news :).
> The patch is almost 40k lines! Most of the changes are whitespace
> changes in the ChangeLog files, could you remove the commit log and
> ChangeLog entries altogether to make the patch easier to parse?
>
> Where did you find this patch?
You'll find a trimmed patch attached. I found the GCC patch upstream
(pushed in January), after finding the option in the online manual.
Thanks,
Mathieu
[-- Attachment #2: 0001-gnu-cross-gcc-Add-a-lib-output.patch --]
[-- Type: text/x-diff, Size: 103990 bytes --]
From d8c45710847b504912670ebccf319354746f06f9 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
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 | 2654 +++++++++++++++++
3 files changed, 2684 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 © 2016, 2017, 2018, 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
# Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
-# Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+# Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
# Copyright © 2017, 2018, 2019 Gábor Boskovits <boskovits@gmail.com>
# Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
# Copyright © 2018, 2019, 2020 Oleg Pykhalov <go.wigust@gmail.com>
@@ -911,6 +911,7 @@ dist_patch_DATA = \
%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 © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2019 Carl Dong <contact@carldong.me>
+;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -162,6 +163,13 @@ base compiler and using LIBC (which may be either a libc package or #f.)"
"--disable-libsanitizer"
))
+ ;; Install cross-built libraries such as libgcc_s.so in
+ ;; the "lib" output.
+ ,@(if libc
+ `((string-append "--with-toolexeclibdir="
+ (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 libc package or #f.)"
(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=[^ ]*")
+ "-DTOOLDIR_BASE_PREFIX=\\\"../../../../\\\""))
+ #t))
(define* (cross-gcc target
#:key
@@ -220,18 +234,19 @@ target that libc."
(patches
(append
(origin-patches (package-source xgcc))
- (cons (cond
- ((version>=? (package-version xgcc) "8.0") (search-patch "gcc-8-cross-environment-variables.patch"))
- ((version>=? (package-version xgcc) "6.0") (search-patch "gcc-6-cross-environment-variables.patch"))
- (else (search-patch "gcc-cross-environment-variables.patch")))
+ (append (cond
+ ((version>=? (package-version xgcc) "8.0")
+ (search-patches "gcc-8-cross-environment-variables.patch"))
+ ((version>=? (package-version xgcc) "6.0")
+ (search-patches "gcc-7-cross-toolexeclibdir.patch"
+ "gcc-6-cross-environment-variables.patch"))
+ (else (search-patches "gcc-cross-environment-variables.patch")))
(cross-gcc-patches xgcc target))))
(modules '((guix build utils)))
(snippet
(cross-gcc-snippet target))))
- ;; For simplicity, use a single output. Otherwise libgcc_s & co. are not
- ;; found by default, etc.
- (outputs '("out"))
+ (outputs '("out" "lib"))
(arguments
`(#:implicit-inputs? #f
diff --git a/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch b/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch
new file mode 100644
index 0000000000..3b90caba22
--- /dev/null
+++ b/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch
@@ -0,0 +1,2654 @@
+This patch taken from GCC upstream adds support for overriding cross-compiled
+shared libraries installation path. This is needed to have a separate "lib"
+output containing those shared libraries.
+
+From fe6b5640a52a6e75dddea834e357974c205c737c Mon Sep 17 00:00:00 2001
+From: "Maciej W. Rozycki" <macro@wdc.com>
+Date: Fri, 24 Jan 2020 11:24:25 +0000
+Subject: [PATCH] Add `--with-toolexeclibdir=' configuration option
+
+Provide means, in the form of a `--with-toolexeclibdir=' 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 <http://www.gnu.org/licenses/>.
++
++AC_DEFUN([GCC_WITH_TOOLEXECLIBDIR],
++[AC_ARG_WITH(toolexeclibdir,
++ [AS_HELP_STRING([--with-toolexeclibdir=DIR],
++ [install libraries built with a cross compiler within DIR])],
++ [dnl
++case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac],
++ [with_toolexeclibdir=no])
++])
+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.
+
+ @table @code
++@item --with-toolexeclibdir=@var{dir}
++Specify the installation directory for libraries built with a cross compiler.
++The default is @option{$@{gcc_tooldir@}/lib}.
++
+ @item --with-sysroot
+ @itemx --with-sysroot=@var{dir}
+ Tells GCC to consider @var{dir} as the root of a tree that contains
+diff --git a/libada/Makefile.in b/libada/Makefile.in
+index 328c067c4cd..004aaf8f993 100644
+--- a/libada/Makefile.in
++++ b/libada/Makefile.in
+@@ -192,6 +192,7 @@ configure_deps = \
+ $(srcdir)/../config/multi.m4 \
+ $(srcdir)/../config/override.m4 \
+ $(srcdir)/../config/picflag.m4 \
++ $(srcdir)/../config/toolexeclibdir.m4 \
+ $(srcdir)/../config/unwind_ipinfo.m4
+
+ $(srcdir)/configure: @MAINT@ $(configure_deps)
+diff --git a/libada/configure b/libada/configure
+index 13e267a7f4e..3135092a73b 100755
+--- a/libada/configure
++++ b/libada/configure
+@@ -631,6 +631,7 @@ ac_user_opts='
+ enable_option_checking
+ with_build_libsubdir
+ enable_maintainer_mode
++with_toolexeclibdir
+ enable_multilib
+ enable_shared
+ with_system_libunwind
+@@ -1262,6 +1263,9 @@ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-build-libsubdir=DIR Directory where to find libraries for build system
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-system-libunwind use installed libunwind
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+@@ -1952,6 +1956,22 @@ else
+ fi
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Default to --enable-multilib
+ # Check whether --enable-multilib was given.
+ if test "${enable_multilib+set}" = set; then :
+@@ -2004,7 +2024,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libada/configure.ac b/libada/configure.ac
+index 0020df9d463..a2a4a1f5049 100644
+--- a/libada/configure.ac
++++ b/libada/configure.ac
+@@ -19,6 +19,7 @@ sinclude(../config/acx.m4)
+ sinclude(../config/multi.m4)
+ sinclude(../config/override.m4)
+ sinclude(../config/picflag.m4)
++sinclude(../config/toolexeclibdir.m4)
+ sinclude(../config/unwind_ipinfo.m4)
+
+ AC_INIT
+@@ -53,6 +54,8 @@ AC_ARG_ENABLE([maintainer-mode],
+ [MAINT='#'])
+ AC_SUBST([MAINT])dnl
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ AM_ENABLE_MULTILIB(, ..)
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+@@ -69,7 +72,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+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 = $(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[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -3185,6 +3189,22 @@ fi
+ ac_config_commands="$ac_config_commands default-1"
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11115,7 +11142,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11118 "configure"
++#line 11145 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11221,7 +11248,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11224 "configure"
++#line 11251 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libatomic/configure.ac b/libatomic/configure.ac
+index 023f1727b1e..3c58801ae98 100644
+--- a/libatomic/configure.ac
++++ b/libatomic/configure.ac
+@@ -85,6 +85,8 @@ target_alias=${target_alias-$host_alias}
+ AM_INIT_AUTOMAKE([1.9.0 foreign no-dist -Wall -Wno-portability -Wno-override])
+ AM_ENABLE_MULTILIB(, ..)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -100,7 +102,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in
+index adfc231484a..a2a76e07502 100644
+--- a/libatomic/testsuite/Makefile.in
++++ b/libatomic/testsuite/Makefile.in
+@@ -61,6 +61,7 @@ am__aclocal_m4_deps = $(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 = $(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=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -11390,7 +11394,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11393 "configure"
++#line 11397 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11496,7 +11500,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11499 "configure"
++#line 11507 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -16002,10 +16006,33 @@ $as_echo "#define USING_PURIFY 1" >>confdefs.h
+ fi
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libffi/configure.ac b/libffi/configure.ac
+index a01d8ac16b0..f295d06ab58 100644
+--- a/libffi/configure.ac
++++ b/libffi/configure.ac
+@@ -333,10 +333,19 @@ AC_ARG_ENABLE(purify-safety,
+ AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
+ fi)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(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 = $(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 = $(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 = $(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 = autoconf
+ configure_deps = \
+ $(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=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-slibdir=DIR shared libraries in DIR LIBDIR
+ --with-build-libsubdir=DIR Directory where to find libraries for build system
+ --with-system-libunwind use installed libunwind
+@@ -2403,6 +2407,22 @@ fi
+ $as_echo "$version_specific_libs" >&6; }
+
+
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
++
+ # Check whether --with-slibdir was given.
+ if test "${with_slibdir+set}" = set; then :
+ withval=$with_slibdir; slibdir="$with_slibdir"
+@@ -2410,7 +2430,14 @@ else
+ if test "${version_specific_libs}" = yes; then
+ slibdir='$(libsubdir)'
+ elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
+- slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
++ ;;
++ *)
++ slibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ slibdir='$(libdir)'
+ fi
+@@ -2640,7 +2667,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index 99b8e15562f..ca833fdc5c1 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
+
+ sinclude(../config/enable.m4)
+ sinclude(../config/tls.m4)
++sinclude(../config/toolexeclibdir.m4)
+ sinclude(../config/acx.m4)
+ sinclude(../config/no-executables.m4)
+ sinclude(../config/lib-ld.m4)
+@@ -108,16 +109,25 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
+ [version_specific_libs=no])
+ AC_MSG_RESULT($version_specific_libs)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ AC_ARG_WITH(slibdir,
+ [ --with-slibdir=DIR shared libraries in DIR [LIBDIR]],
+ slibdir="$with_slibdir",
+-if test "${version_specific_libs}" = yes; then
++[if test "${version_specific_libs}" = yes; then
+ slibdir='$(libsubdir)'
+ elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
+- slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
++ ;;
++ *)
++ slibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ slibdir='$(libdir)'
+-fi)
++fi])
+ AC_SUBST(slibdir)
+
+ # Command-line options.
+@@ -163,7 +173,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
+index 4914a6f323f..ba700a8002c 100644
+--- a/libgfortran/Makefile.in
++++ b/libgfortran/Makefile.in
+@@ -133,6 +133,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.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)/../config/acx.m4 \
+diff --git a/libgfortran/aclocal.m4 b/libgfortran/aclocal.m4
+index 015537ef197..58f0687d7a5 100644
+--- a/libgfortran/aclocal.m4
++++ b/libgfortran/aclocal.m4
+@@ -1030,6 +1030,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/libgfortran/configure b/libgfortran/configure
+index 1db8f5f5224..e28fa82d8d5 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -771,6 +771,7 @@ enable_intermodule
+ enable_maintainer_mode
+ enable_multilib
+ enable_dependency_tracking
++with_toolexeclibdir
+ enable_symvers
+ with_gnu_ld
+ enable_shared
+@@ -1436,6 +1437,9 @@ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-build-libsubdir=DIR Directory where to find libraries for build system
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+@@ -4927,6 +4931,22 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -4942,7 +4962,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -12421,7 +12448,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12424 "configure"
++#line 12451 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -12527,7 +12554,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12530 "configure"
++#line 12557 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
+index 37b12d2998f..6dee8ef15b0 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -87,6 +87,8 @@ fi
+
+ AC_USE_SYSTEM_EXTENSIONS
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -102,7 +104,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(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 = $(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[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -3338,6 +3342,22 @@ fi
+ ac_config_commands="$ac_config_commands default-1"
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11155,7 +11182,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11158 "configure"
++#line 11185 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11261,7 +11288,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11264 "configure"
++#line 11295 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libgomp/configure.ac b/libgomp/configure.ac
+index a42d4f08b4b..a3500d71480 100644
+--- a/libgomp/configure.ac
++++ b/libgomp/configure.ac
+@@ -65,6 +65,8 @@ target_alias=${target_alias-$host_alias}
+ AM_INIT_AUTOMAKE([1.9.0 foreign no-dist -Wall -Wno-portability -Wno-override])
+ AM_ENABLE_MULTILIB(, ..)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -80,7 +82,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+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 = $(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 = $(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[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -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; }
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -10973,7 +11000,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10976 "configure"
++#line 11003 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11079,7 +11106,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11082 "configure"
++#line 11113 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libhsail-rt/configure.ac b/libhsail-rt/configure.ac
+index ed7e3041994..88afd5b56d6 100644
+--- a/libhsail-rt/configure.ac
++++ b/libhsail-rt/configure.ac
+@@ -70,6 +70,8 @@ ler-specific directory]),
+ [enable_version_specific_runtime_libs=no])
+ AC_MSG_RESULT($enable_version_specific_runtime_libs)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -85,7 +87,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+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 = $(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[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -3371,6 +3375,22 @@ fi
+ ac_config_commands="$ac_config_commands default-1"
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11794,7 +11821,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11797 "configure"
++#line 11824 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11900,7 +11927,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11903 "configure"
++#line 11934 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libitm/configure.ac b/libitm/configure.ac
+index c5ecd394a43..ebd888fbd42 100644
+--- a/libitm/configure.ac
++++ b/libitm/configure.ac
+@@ -79,6 +79,8 @@ target_alias=${target_alias-$host_alias}
+ AM_INIT_AUTOMAKE([1.9.0 foreign no-dist -Wall -Wno-portability -Wno-override])
+ AM_ENABLE_MULTILIB(, ..)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -94,7 +96,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+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 = $(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/libobjc/Makefile.in b/libobjc/Makefile.in
+index febc92d4b3c..1a12ebec592 100644
+--- a/libobjc/Makefile.in
++++ b/libobjc/Makefile.in
+@@ -291,6 +291,7 @@ aclocal_deps = \
+ $(srcdir)/../config/multi.m4 \
+ $(srcdir)/../config/override.m4 \
+ $(srcdir)/../config/proginstall.m4 \
++ $(srcdir)/../config/toolexeclibdir.m4 \
+ $(srcdir)/../ltoptions.m4 \
+ $(srcdir)/../ltsugar.m4 \
+ $(srcdir)/../ltversion.m4 \
+diff --git a/libobjc/aclocal.m4 b/libobjc/aclocal.m4
+index 174f9b7d0d8..58e4dfce6b6 100644
+--- a/libobjc/aclocal.m4
++++ b/libobjc/aclocal.m4
+@@ -204,4 +204,5 @@ m4_include([../ltoptions.m4])
+ m4_include([../ltsugar.m4])
+ m4_include([../ltversion.m4])
+ m4_include([../lt~obsolete.m4])
++m4_include([../config/toolexeclibdir.m4])
+ m4_include([acinclude.m4])
+diff --git a/libobjc/configure b/libobjc/configure
+index 84862a82864..b766980e0a5 100755
+--- a/libobjc/configure
++++ b/libobjc/configure
+@@ -714,6 +714,7 @@ with_target_subdir
+ with_cross_host
+ enable_version_specific_runtime_libs
+ enable_multilib
++with_toolexeclibdir
+ enable_maintainer_mode
+ enable_shared
+ enable_static
+@@ -1368,6 +1369,9 @@ Optional Packages:
+ --with-target-subdir=SUBDIR
+ configuring in a subdirectory
+ --with-cross-host=HOST configuring with a cross compiler
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -2461,6 +2465,22 @@ case $srcdir in
+ esac
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -2476,7 +2496,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+ toolexeclibdir='$(libdir)'
+@@ -10594,7 +10621,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10597 "configure"
++#line 10628 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10700,7 +10727,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10703 "configure"
++#line 10738 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libobjc/configure.ac b/libobjc/configure.ac
+index c6d48f787ae..79c31562e97 100644
+--- a/libobjc/configure.ac
++++ b/libobjc/configure.ac
+@@ -77,6 +77,8 @@ case $srcdir in
+ esac
+ AC_SUBST(glibcpp_srcdir)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -92,7 +94,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+ toolexeclibdir='$(libdir)'
+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 = $(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[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -5003,6 +5007,22 @@ else
+ fi
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11108,7 +11135,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11111 "configure"
++#line 11138 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11214,7 +11241,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11217 "configure"
++#line 11248 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/liboffloadmic/configure.ac b/liboffloadmic/configure.ac
+index 64728f1a1a7..14efcdd3290 100644
+--- a/liboffloadmic/configure.ac
++++ b/liboffloadmic/configure.ac
+@@ -80,6 +80,8 @@ case "$enable_liboffloadmic" in
+ esac
+ AM_CONDITIONAL(LIBOFFLOADMIC_HOST, [test x"$enable_liboffloadmic" = xhost])
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir.
+ # Also toolexecdir, though it's only used in toolexeclibdir.
+ case ${enable_version_specific_runtime_libs} in
+@@ -95,7 +97,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/liboffloadmic/plugin/Makefile.in b/liboffloadmic/plugin/Makefile.in
+index 2a7c8d2ec6c..6e180f6a23c 100644
+--- a/liboffloadmic/plugin/Makefile.in
++++ b/liboffloadmic/plugin/Makefile.in
+@@ -90,6 +90,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(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/aclocal.m4
+index a4179ef40ac..6d90e5d6e16 100644
+--- a/liboffloadmic/plugin/aclocal.m4
++++ b/liboffloadmic/plugin/aclocal.m4
+@@ -990,6 +990,7 @@ AC_SUBST([am__untar])
+
+ 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/configure
+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[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -4311,6 +4315,22 @@ fi
+ $as_echo "$enable_version_specific_runtime_libs" >&6; }
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -10815,7 +10842,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10818 "configure"
++#line 10845 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10921,7 +10948,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10924 "configure"
++#line 10955 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/liboffloadmic/plugin/configure.ac b/liboffloadmic/plugin/configure.ac
+index 9c48cafd38b..fdac290c5f1 100644
+--- a/liboffloadmic/plugin/configure.ac
++++ b/liboffloadmic/plugin/configure.ac
+@@ -96,6 +96,8 @@ AC_ARG_ENABLE([version-specific-runtime-libs],
+ AC_MSG_RESULT($enable_version_specific_runtime_libs)
+
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir.
+ # Also toolexecdir, though it's only used in toolexeclibdir.
+ case ${enable_version_specific_runtime_libs} in
+@@ -111,7 +113,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+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 = $(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=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -10572,7 +10576,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10575 "configure"
++#line 10579 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10678,7 +10682,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10681 "configure"
++#line 10689 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11917,6 +11921,22 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
+index 41fbe1259ee..e27aa8d0389 100644
+--- a/libquadmath/configure.ac
++++ b/libquadmath/configure.ac
+@@ -83,6 +83,8 @@ if test "x$GCC" != "xyes"; then
+ fi
+ AC_PROG_CPP
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -98,7 +100,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(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 = $(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 = $(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[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -4773,6 +4777,22 @@ fi
+
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -12032,7 +12059,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12035 "configure"
++#line 12062 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -12138,7 +12165,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12141 "configure"
++#line 12168 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
+index b0c485b0f7b..d69d5aa1c9a 100644
+--- a/libsanitizer/configure.ac
++++ b/libsanitizer/configure.ac
+@@ -30,6 +30,8 @@ GCC_LIBSTDCXX_RAW_CXX_FLAGS
+ AM_INIT_AUTOMAKE(foreign no-dist)
+ AM_MAINTAINER_MODE
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -45,7 +47,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libsanitizer/interception/Makefile.in b/libsanitizer/interception/Makefile.in
+index c71fb57b8b8..ed9c996b5eb 100644
+--- a/libsanitizer/interception/Makefile.in
++++ b/libsanitizer/interception/Makefile.in
+@@ -62,6 +62,7 @@ am__aclocal_m4_deps = $(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/libbacktrace/Makefile.in
+index dff04cfa3ea..22655306594 100644
+--- a/libsanitizer/libbacktrace/Makefile.in
++++ b/libsanitizer/libbacktrace/Makefile.in
+@@ -94,6 +94,7 @@ am__aclocal_m4_deps = $(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 = $(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/sanitizer_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 = $(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 = $(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 = $(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 = $(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='build_alias
+@@ -1389,6 +1390,9 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -10671,7 +10675,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10674 "configure"
++#line 10678 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10777,7 +10781,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10780 "configure"
++#line 10784 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11039,6 +11043,22 @@ esac
+
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++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" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libssp/configure.ac b/libssp/configure.ac
+index 9e4a22a24d4..63538cb8f4e 100644
+--- a/libssp/configure.ac
++++ b/libssp/configure.ac
+@@ -159,6 +159,8 @@ ACX_LT_HOST_FLAGS
+ AC_SUBST(enable_shared)
+ AC_SUBST(enable_static)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -174,7 +176,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(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 = $(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=no])
+ AC_MSG_RESULT($version_specific_libs)
+
++ GCC_WITH_TOOLEXECLIBDIR
++
+ # Default case for install directory for include files.
+ if test $version_specific_libs = no && test $gxx_include_dir = no; then
+ gxx_include_dir='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" != x"no"; then
+ glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
+- glibcxx_toolexeclibdir='${toolexecdir}/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ glibcxx_toolexeclibdir='${toolexecdir}/lib'
++ ;;
++ *)
++ glibcxx_toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
+ glibcxx_toolexeclibdir='${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='build_alias
+@@ -1623,6 +1624,9 @@ Optional Packages:
+ set the std::string ABI to use by default
+ --with-gxx-include-dir=DIR
+ installation directory for include files
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -11606,7 +11610,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11609 "configure"
++#line 11613 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11712,7 +11716,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11715 "configure"
++#line 11723 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -15398,7 +15402,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
+ # Fake what AC_TRY_COMPILE does.
+
+ 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*
+
+ 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*
+
+ 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*
+
+ 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.
+
+ cat > conftest.$ac_ext << EOF
+-#line 15588 "configure"
++#line 15592 "configure"
+ int main()
+ {
+ _Decimal32 d1;
+@@ -15627,7 +15631,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+-#line 15630 "configure"
++#line 15634 "configure"
+ template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+@@ -15661,7 +15665,7 @@ $as_echo "$enable_int128" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15664 "configure"
++#line 15668 "configure"
+ template<typename T1, typename T2>
+ 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; }
+
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
+ # Default case for install directory for include files.
+ if test $version_specific_libs = no && test $gxx_include_dir = no; then
+ gxx_include_dir='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" != x"no"; then
+ glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
+- glibcxx_toolexeclibdir='${toolexecdir}/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ glibcxx_toolexeclibdir='${toolexecdir}/lib'
++ ;;
++ *)
++ glibcxx_toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
+ glibcxx_toolexeclibdir='${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 = $(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/Makefile.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 = $(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++/Makefile.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 = $(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 = $(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/Makefile.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 = $(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 = $(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/Makefile.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 = $(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/Makefile.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 = $(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/Makefile.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 = $(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/filesystem/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 = $(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/Makefile.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 = $(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/libvtv/Makefile.in b/libvtv/Makefile.in
+index 59d0b11bdd0..3a529115879 100644
+--- a/libvtv/Makefile.in
++++ b/libvtv/Makefile.in
+@@ -68,6 +68,7 @@ am__aclocal_m4_deps = $(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)/../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/libvtv/aclocal.m4 b/libvtv/aclocal.m4
+index 1e73dcc4a24..b0a3872166f 100644
+--- a/libvtv/aclocal.m4
++++ b/libvtv/aclocal.m4
+@@ -1030,6 +1030,7 @@ m4_include([../config/libstdc++-raw-cxx.m4])
+ m4_include([../config/lthostflags.m4])
+ m4_include([../config/multi.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/libvtv/configure b/libvtv/configure
+index dfb9162c79f..74a728e7aba 100755
+--- a/libvtv/configure
++++ b/libvtv/configure
+@@ -754,6 +754,7 @@ enable_version_specific_runtime_libs
+ enable_vtable_verify
+ enable_dependency_tracking
+ enable_maintainer_mode
++with_toolexeclibdir
+ enable_shared
+ enable_static
+ with_pic
+@@ -1408,6 +1409,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -4575,6 +4579,22 @@ fi
+
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -4590,7 +4610,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -12066,7 +12093,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12069 "configure"
++#line 12096 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -12172,7 +12199,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12175 "configure"
++#line 12202 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libvtv/configure.ac b/libvtv/configure.ac
+index 33b1e7913c6..005e46e2386 100644
+--- a/libvtv/configure.ac
++++ b/libvtv/configure.ac
+@@ -79,6 +79,8 @@ AM_MAINTAINER_MODE
+
+ LIBVTV_CONFIGURE
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -94,7 +96,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libvtv/testsuite/Makefile.in b/libvtv/testsuite/Makefile.in
+index b5dfd29973c..c296f38f6cb 100644
+--- a/libvtv/testsuite/Makefile.in
++++ b/libvtv/testsuite/Makefile.in
+@@ -61,6 +61,7 @@ am__aclocal_m4_deps = $(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)/../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/zlib/Makefile.in b/zlib/Makefile.in
+index 82b72a16367..5ccc47b1173 100644
+--- a/zlib/Makefile.in
++++ b/zlib/Makefile.in
+@@ -62,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
+ $(top_srcdir)/../config/lead-dot.m4 \
+ $(top_srcdir)/../config/multi.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 \
+diff --git a/zlib/aclocal.m4 b/zlib/aclocal.m4
+index fab04ed5c47..8ce1dc9d31d 100644
+--- a/zlib/aclocal.m4
++++ b/zlib/aclocal.m4
+@@ -992,6 +992,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([../ltoptions.m4])
+ m4_include([../ltsugar.m4])
+ m4_include([../ltversion.m4])
+diff --git a/zlib/configure b/zlib/configure
+index ee5527c4a40..e8d7c00dbcf 100755
+--- a/zlib/configure
++++ b/zlib/configure
+@@ -738,6 +738,7 @@ with_pic
+ enable_fast_install
+ with_gnu_ld
+ enable_libtool_lock
++with_toolexeclibdir
+ enable_host_shared
+ '
+ ac_precious_vars='build_alias
+@@ -1385,6 +1386,9 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+
+ Some influential environment variables:
+ CC C compiler command
+@@ -10406,7 +10410,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10409 "configure"
++#line 10413 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10512,7 +10516,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10515 "configure"
++#line 10519 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11173,10 +11177,33 @@ fi
+ done
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/zlib/configure.ac b/zlib/configure.ac
+index fb8d943905e..c679b37e2a5 100644
+--- a/zlib/configure.ac
++++ b/zlib/configure.ac
+@@ -91,10 +91,19 @@ AC_SUBST(target_all)
+
+ AC_CHECK_HEADERS(unistd.h)
+
++GCC_WITH_TOOLEXECLIBDIR
++
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+--
+2.24.0
+
--
2.24.0
next prev parent reply other threads:[~2020-03-15 11:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 7:37 bug#39941: Disk-image size increase on core-updates Mathieu Othacehe
2020-03-10 9:22 ` Mathieu Othacehe
2020-03-11 14:25 ` Ludovic Courtès
2020-03-11 14:45 ` Mathieu Othacehe
2020-03-11 20:33 ` Ludovic Courtès
2020-03-12 8:06 ` Mathieu Othacehe
2020-03-14 10:54 ` Mathieu Othacehe
2020-03-14 12:30 ` Marius Bakke
2020-03-15 11:21 ` Mathieu Othacehe [this message]
2020-03-15 17:13 ` Ludovic Courtès
2020-03-17 11:28 ` Mathieu Othacehe
2020-03-24 10:54 ` Ludovic Courtès
2020-03-24 17:01 ` Mathieu Othacehe
2020-03-25 21:34 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875zf5lv79.fsf@gmail.com \
--to=m.othacehe@gmail.com \
--cc=39941@debbugs.gnu.org \
--cc=mbakke@fastmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.