mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-23 06:32:23 +00:00
Michael ABBOTT reported that populate is not relocatable.
Fix this by determining both the cross-readelf and the sys-root at runtime, not at build time. /trunk/configure | 1 1 0 0 + /trunk/scripts/crosstool.sh | 14 6 8 0 ++++++-------- /trunk/tools/populate.in | 6 4 2 0 ++++-- 3 files changed, 11 insertions(+), 10 deletions(-)
This commit is contained in:
parent
4eeadf87e2
commit
379ea09dba
1
configure
vendored
1
configure
vendored
@ -23,6 +23,7 @@ patch
|
|||||||
tar
|
tar
|
||||||
gzip
|
gzip
|
||||||
bzip2
|
bzip2
|
||||||
|
readlink
|
||||||
'
|
'
|
||||||
|
|
||||||
PREFIX_DEFAULT=/usr/local
|
PREFIX_DEFAULT=/usr/local
|
||||||
|
@ -427,9 +427,9 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
|
|||||||
|
|
||||||
# Install the /populator/
|
# Install the /populator/
|
||||||
CT_DoLog EXTRA "Installing the populate helper"
|
CT_DoLog EXTRA "Installing the populate helper"
|
||||||
sed -r -e 's,@@CT_READELF@@,'"${CT_PREFIX_DIR}/bin/${CT_TARGET}-readelf"',g;' \
|
sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
|
||||||
-e 's,@@CT_SYSROOT_DIR@@,'"${CT_SYSROOT_DIR}"',g;' \
|
"${CT_LIB_DIR}/tools/populate.in" \
|
||||||
"${CT_LIB_DIR}/tools/populate.in" >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
|
>"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
|
||||||
chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
|
chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
|
||||||
|
|
||||||
# Create the aliases to the target tools
|
# Create the aliases to the target tools
|
||||||
@ -438,15 +438,13 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
|
|||||||
for t in "${CT_TARGET}-"*; do
|
for t in "${CT_TARGET}-"*; do
|
||||||
if [ -n "${CT_TARGET_ALIAS}" ]; then
|
if [ -n "${CT_TARGET_ALIAS}" ]; then
|
||||||
_t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
|
_t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
|
||||||
CT_DoLog DEBUG "Linking '${_t}' -> '${t}'"
|
ln -sv "${t}" "${_t}" 2>&1
|
||||||
ln -sv "${t}" "${_t}" 2>&1 |CT_DoLog ALL
|
|
||||||
fi
|
fi
|
||||||
if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
|
if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
|
||||||
_t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
|
_t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
|
||||||
CT_DoLog DEBUG "Linking '${_t}' -> '${t}'"
|
ln -sv "${t}" "${_t}" 2>&1
|
||||||
ln -sv "${t}" "${_t}" 2>&1 |CT_DoLog ALL
|
|
||||||
fi
|
fi
|
||||||
done
|
done |CT_DoLog ALL
|
||||||
CT_Popd
|
CT_Popd
|
||||||
CT_EndStep
|
CT_EndStep
|
||||||
|
|
||||||
|
@ -4,8 +4,10 @@
|
|||||||
# (C) 2007 Yann E. MORIN
|
# (C) 2007 Yann E. MORIN
|
||||||
# Licensed under the GPL v2
|
# Licensed under the GPL v2
|
||||||
|
|
||||||
CT_READELF="@@CT_READELF@@"
|
# Detect where the toolchain is:
|
||||||
CT_SYSROOT_DIR="@@CT_SYSROOT_DIR@@"
|
BIN_DIR="$(cd "$(dirname "$(readlink -fn "$0")")"; pwd)"
|
||||||
|
CT_READELF="${BIN_DIR}/@@CT_TARGET@@-readelf"
|
||||||
|
CT_SYSROOT_DIR="${BIN_DIR}/../@@CT_TARGET@@/sys-root"
|
||||||
|
|
||||||
myname=$(basename "$0")
|
myname=$(basename "$0")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user