mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 21:46:58 +02:00
Merge pull request #286 from flatcar-linux/jepio/run-binutils-config
build_library/toolchain_util: set binutils to the latest version
This commit is contained in:
commit
2937db11e5
@ -363,6 +363,7 @@ install_cross_toolchain() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup environment and wrappers for our shiny new toolchain
|
# Setup environment and wrappers for our shiny new toolchain
|
||||||
|
binutils_set_latest_profile "${cross_chost}"
|
||||||
gcc_set_latest_profile "${cross_chost}"
|
gcc_set_latest_profile "${cross_chost}"
|
||||||
$sudo CC_QUIET=1 sysroot-config --install-links "${cross_chost}"
|
$sudo CC_QUIET=1 sysroot-config --install-links "${cross_chost}"
|
||||||
}
|
}
|
||||||
@ -431,6 +432,23 @@ install_cross_rust() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Update to the latest binutils profile for a given CHOST if required
|
||||||
|
# Usage: binutils_set_latest_profile chost
|
||||||
|
binutils_set_latest_profile() {
|
||||||
|
local latest="$@-latest"
|
||||||
|
if [[ -z "${latest}" ]]; then
|
||||||
|
echo "Failed to detect latest binutils profile for $1" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# may be called from either catalyst (root) or upgrade_chroot (user)
|
||||||
|
local sudo="env"
|
||||||
|
if [[ $(id -u) -ne 0 ]]; then
|
||||||
|
sudo="sudo -E"
|
||||||
|
fi
|
||||||
|
|
||||||
|
$sudo binutils-config "${latest}"
|
||||||
|
}
|
||||||
|
|
||||||
# Get the latest GCC profile for a given CHOST
|
# Get the latest GCC profile for a given CHOST
|
||||||
# The extra flag can be blank, hardenednopie, and so on. See gcc-config -l
|
# The extra flag can be blank, hardenednopie, and so on. See gcc-config -l
|
||||||
|
Loading…
Reference in New Issue
Block a user