Lines 1-5
Link Here
|
1 |
#!/bin/bash |
1 |
#!/bin/bash |
2 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
# Copyright 2002-2019 Gentoo Authors |
3 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
|
4 |
|
5 |
# Format of /etc/env.d/gcc/: |
5 |
# Format of /etc/env.d/gcc/: |
Lines 281-320
mv_if_diff() {
Link Here
|
281 |
} |
281 |
} |
282 |
|
282 |
|
283 |
handle_split_usr() { |
283 |
handle_split_usr() { |
284 |
# We need to make sure that libgcc_s.so / libunwind.so make it into /lib. |
284 |
# We need to make sure that libgcc_s.so makes it into /lib. |
285 |
# On many systems (x86/amd64/etc...), this will probably never matter, |
285 |
# On many systems (x86/amd64/etc...), this will probably never matter, |
286 |
# but on other systems (arm/mips/etc...), this is quite critical. |
286 |
# but on other systems (arm/mips/etc...), this is quite critical. |
287 |
# http://bugs.gentoo.org/60190 |
287 |
# http://bugs.gentoo.org/60190 |
288 |
# |
288 |
# |
289 |
# The funky move magic is required for proper updating of in-use files. |
289 |
# The funky move magic is required for proper updating of in-use files. |
290 |
# |
290 |
|
|
|
291 |
# Gentoo Prefix systems don't "boot", so no need to handle split-/usr. |
292 |
[[ -n ${EPREFIX} ]] && return 0 |
293 |
|
291 |
# We use the same ordering logic as mentioned in the MY_LDPATH setup. |
294 |
# We use the same ordering logic as mentioned in the MY_LDPATH setup. |
292 |
# We get the libs from the latest version available. |
295 |
# We get the libs from the latest version available. |
293 |
local LDPATH |
296 |
local LDPATH |
294 |
|
|
|
295 |
eval $(grep -h '^LDPATH=' "${GCC_ENV_D}"/${CHOST}-* | tail -1) |
297 |
eval $(grep -h '^LDPATH=' "${GCC_ENV_D}"/${CHOST}-* | tail -1) |
296 |
LDPATH=${LDPATH%%:*} |
298 |
LDPATH=${LDPATH%%:*} |
297 |
|
299 |
|
298 |
# If /usr isn't a sep mount, then don't bother with linking stuff. |
300 |
# If /usr isn't a sep mount, then don't bother with linking stuff. |
299 |
if ln "${ROOT}/${LDPATH}/libgcc.a" "${EROOT}"/lib/.gcc.config.$$ 2>/dev/null ; then |
301 |
if ln "${ROOT}/${LDPATH}/libgcc.a" "${EROOT}"/lib/.gcc.config.$$ 2>/dev/null ; then |
300 |
rm -f "${EROOT}"/lib/.gcc.config.$$ |
302 |
rm -f "${EROOT}"/lib/.gcc.config.$$ |
301 |
if [[ -n $(find "${EROOT}"/lib*/lib{gcc_s,unwind}{.so*,*dylib} 2>/dev/null) ]] ; then |
303 |
if [[ -n $(find "${EROOT}"/lib*/libgcc_s{.so*,*dylib} 2>/dev/null) ]] ; then |
302 |
# If we previously had stuff in /, make sure ldconfig gets re-run. |
304 |
# If we previously had stuff in /, make sure ldconfig gets re-run. |
303 |
rm -f "${EROOT}"/lib*/lib{gcc_s,unwind}{.so*,*dylib} |
305 |
rm -f "${EROOT}"/lib*/libgcc_s{.so*,*dylib} |
304 |
return 1 |
306 |
return 1 |
305 |
fi |
307 |
fi |
306 |
return 0 |
308 |
return 0 |
307 |
fi |
309 |
fi |
308 |
|
310 |
|
309 |
# Gentoo Prefix systems don't "boot", so no need to handle split-/usr |
|
|
310 |
[[ -n ${EPREFIX} ]] && return 0 |
311 |
|
312 |
# Only bother with this stuff for the native ABI. We assume the user |
311 |
# Only bother with this stuff for the native ABI. We assume the user |
313 |
# doesn't have critical binaries for non-native ABIs which is fair. |
312 |
# doesn't have critical binaries for non-native ABIs which is fair. |
314 |
local gcclib |
313 |
local gcclib |
315 |
local libdir="${EROOT}${GENTOO_LIBDIR}" |
314 |
local libdir="${EROOT}${GENTOO_LIBDIR}" |
316 |
mkdir -p "${libdir}"/.gcc.config.new || return 0 # !?!?! |
315 |
mkdir -p "${libdir}"/.gcc.config.new || return 0 # !?!?! |
317 |
for gcclib in gcc_s unwind ; do |
316 |
for gcclib in gcc_s ; do |
318 |
# This assumes that we always have the .so symlink, |
317 |
# This assumes that we always have the .so symlink, |
319 |
# but for now, that should be safe ... |
318 |
# but for now, that should be safe ... |
320 |
for gcclib in "${ROOT}${LDPATH}"/lib${gcclib}.so.* ; do |
319 |
for gcclib in "${ROOT}${LDPATH}"/lib${gcclib}.so.* ; do |
321 |
- |
|
|