1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-30 13:17:45 +00:00

Ports: Use the objcopy built as part of the toolchain

Relying on host tools working correctly is not a good idea, as they may
be outdated (and therefore not support features like RELR relocations)
or may not exist at all (like objcopy on macOS).
This commit is contained in:
Daniel Bertalan 2022-02-20 22:58:26 +01:00 committed by Linus Groh
parent b3591d28df
commit 0be67ef12c
3 changed files with 8 additions and 4 deletions

View file

@ -12,6 +12,7 @@ if [ -z "${HOST_CC:=}" ]; then
export HOST_RANLIB="${RANLIB:=ranlib}"
export HOST_PATH="${PATH:=}"
export HOST_READELF="${READELF:=readelf}"
export HOST_OBJCOPY="${OBJCOPY:=objcopy}"
export HOST_PKG_CONFIG_DIR="${PKG_CONFIG_DIR:=}"
export HOST_PKG_CONFIG_SYSROOT_DIR="${PKG_CONFIG_SYSROOT_DIR:=}"
export HOST_PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:=}"
@ -49,6 +50,7 @@ host_env() {
export RANLIB="${HOST_RANLIB}"
export PATH="${HOST_PATH}"
export READELF="${HOST_READELF}"
export OBJCOPY="${HOST_OBJCOPY}"
export PKG_CONFIG_DIR="${HOST_PKG_CONFIG_DIR}"
export PKG_CONFIG_SYSROOT_DIR="${HOST_PKG_CONFIG_SYSROOT_DIR}"
export PKG_CONFIG_LIBDIR="${HOST_PKG_CONFIG_LIBDIR}"
@ -164,8 +166,8 @@ install_icon() {
run convert "$icon[0]" -resize $icon_size "app-${icon_size}.png"
fi
done
run objcopy --add-section serenity_icon_s="app-16x16.png" "${DESTDIR}${launcher}"
run objcopy --add-section serenity_icon_m="app-32x32.png" "${DESTDIR}${launcher}"
run $OBJCOPY --add-section serenity_icon_s="app-16x16.png" "${DESTDIR}${launcher}"
run $OBJCOPY --add-section serenity_icon_m="app-32x32.png" "${DESTDIR}${launcher}"
}
install_main_launcher() {