commit:     8aa4df8e784b96b336a82abc383bba7c60426cdf
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 19:53:24 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 19:57:52 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=8aa4df8e

scripts/bootstrap-prefix: ensure temp libgcc_s remains available

On Solaris 64-bit, ensure libgcc_s remains available to stage2-built
objects, by copying and referencing a temp location.  gcc-config will
remove the libgcc_s from usr/lib, so we need to ensure it's in a place
where it won't get wiped (after installing the compiler)

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 6703edcc33..ff5132ae7e 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1536,8 +1536,16 @@ bootstrap_stage2() {
        # on Solaris 64-bits, (at least up to 10) libgcc_s resides in a
        # non-standard location, and the compiler doesn't seem to record
        # this in rpath while it does find it, resulting in a runtime trap
-       [[ ${CHOST} == x86_64-*-solaris* || ${CHOST} == sparcv9-*-solaris* ]] 
&& \
-               cp /usr/sfw/lib/64/libgcc_s.so.1 "${ROOT}"/tmp/usr/lib/ >& 
/dev/null
+       if [[ ${CHOST} == x86_64-*-solaris* || ${CHOST} == sparcv9-*-solaris* 
]] ;
+       then
+               [[ -e ${ROOT}/tmp/usr/bin/gcc ]] || \
+                       cp /usr/sfw/lib/64/libgcc_s.so.1 "${ROOT}"/tmp/usr/lib/ 
>& /dev/null
+               # save another copy for after gcc-config gets run and removes
+               # usr/lib/libgcc_s.* because new links should use the compiler
+               # specific libgcc_s.
+               LDFLAGS="${LDFLAGS} -R${ROOT}/tmp/tmp"
+               cp /usr/sfw/lib/64/libgcc_s.so.1 "${ROOT}"/tmp/tmp/ >& /dev/null
+       fi
 
        # Disable RAP directory hacks of binutils and gcc.  If libc.so
        # linker script provides no hint of ld-linux*.so*, ld should

Reply via email to