mirror of
https://github.com/flatcar/scripts.git
synced 2026-02-27 02:21:37 +01:00
bootstrap_sdk: fix issues around lib->lib64 symlink
The arm64 profiles don't specify SYMLINK_LIB=yes, which makes sense since arm64 systems don't support multilib in the way that we are used to from x86. What this means is that build artifacts are installed into separate lib and lib64 directories. The root overlay installed in stage4 needs to check for SYMLINK_LIB before trying to create a symlink, otherwise it fails to be applied because it collides with the directory in the rootfs. This uncovered a second minor issues - the rust toolchain bootstrap scripts checked for /usr/lib64/rust*, but the ebuild installs to /usr/lib/rust. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
dbbdb32250
commit
e4f57bea82
@ -92,7 +92,11 @@ if [[ "$STAGES" =~ stage4 ]]; then
|
||||
libdir=$(get_sdk_libdir)
|
||||
mkdir -p "${ROOT_OVERLAY}/usr/${libdir}"
|
||||
if [[ "${libdir}" != lib ]]; then
|
||||
ln -s "${libdir}" "${ROOT_OVERLAY}/usr/lib"
|
||||
if [[ "$(get_sdk_symlink_lib)" == "yes" ]]; then
|
||||
ln -s "${libdir}" "${ROOT_OVERLAY}/usr/lib"
|
||||
else
|
||||
mkdir -p "${ROOT_OVERLAY}/usr/lib"
|
||||
fi
|
||||
fi
|
||||
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
|
||||
--root "${ROOT_OVERLAY}"
|
||||
|
||||
@ -167,6 +167,10 @@ get_sdk_libdir() {
|
||||
portageq envvar "LIBDIR_$(get_sdk_arch)"
|
||||
}
|
||||
|
||||
get_sdk_symlink_lib() {
|
||||
portageq envvar "SYMLINK_LIB"
|
||||
}
|
||||
|
||||
# Usage: get_sdk_binhost [version...]
|
||||
# If no versions are specified the current and SDK versions are used.
|
||||
get_sdk_binhost() {
|
||||
@ -333,7 +337,7 @@ install_cross_toolchain() {
|
||||
$sudo emerge "${emerge_flags[@]}" \
|
||||
"cross-${cross_chost}/gdb" "${cross_pkgs[@]}"
|
||||
if [ "${cross_chost}" = aarch64-cros-linux-gnu ] && \
|
||||
[ ! -d /usr/lib64/rust-*/rustlib/aarch64-unknown-linux-gnu ] && [ ! -d /usr/lib64/rustlib/aarch64-unknown-linux-gnu ]; then
|
||||
[ ! -d /usr/lib/rust-*/rustlib/aarch64-unknown-linux-gnu ] && [ ! -d /usr/lib/rustlib/aarch64-unknown-linux-gnu ]; then
|
||||
# If no aarch64 folder exists, warn about the situation but don't compile Rust here or download it as binary package
|
||||
echo "WARNING: No aarch64 cross-compilation Rust libraries found!"
|
||||
echo "In case building fails, make sure the old Rust version is deleted with: sudo emerge -C virtual/rust dev-lang/rust"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user