mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 13:06:59 +02:00
build_packages, build_image_util.sh: fix up liblto symlink
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
This commit is contained in:
parent
5201aee4a3
commit
22b08b0ae4
@ -153,6 +153,8 @@ emerge_to_image() {
|
||||
# Make sure profile.env has been generated
|
||||
sudo -E ROOT="${root_fs_dir}" env-update --no-ldconfig
|
||||
|
||||
fixup_liblto_softlinks "$root_fs_dir"
|
||||
|
||||
# TODO(marineam): just call ${BUILD_LIBRARY_DIR}/check_root directly once
|
||||
# all tests are fatal, for now let the old function skip soname errors.
|
||||
ROOT="${root_fs_dir}" PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
|
||||
|
@ -252,6 +252,8 @@ fi
|
||||
|
||||
eclean-$BOARD -d packages
|
||||
|
||||
fixup_liblto_softlinks "${BOARD_ROOT}"
|
||||
|
||||
info "Checking build root"
|
||||
test_image_content "${BOARD_ROOT}"
|
||||
|
||||
|
20
common.sh
20
common.sh
@ -966,3 +966,23 @@ clean_qemu_static() {
|
||||
*) die "Unsupported arch" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Fix up liblto softlink created by gcc-config
|
||||
fixup_liblto_softlinks() {
|
||||
local root="$1"
|
||||
|
||||
info "fixup_liblto_softlinks: Looking for broken softlinks in '${root}'"
|
||||
|
||||
local link
|
||||
local target
|
||||
# check both native (/usr/CHOST/) as well as cross compile (/usr/CHOST/CTARGET) paths
|
||||
{ ls -l "${root}/"usr/*/binutils-bin/lib/bfd-plugins/liblto_plugin.so 2>/dev/null;
|
||||
ls -l "${root}/"usr/*/*/binutils-bin/lib/bfd-plugins/liblto_plugin.so 2>/dev/null; } \
|
||||
| sed 's:.* \([^[:space:]]\+\) -> \([^[:space:]]\+\):\1 \2:' \
|
||||
| while read link target; do
|
||||
local newtarget=$(echo "$target" | sed "s:${root}:/:")
|
||||
info " Fixing up broken $link -> $target"
|
||||
info " sudo ln -sf $newtarget $link"
|
||||
sudo ln -sf $newtarget $link
|
||||
done
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user