From 498d3d853731a8ee848fb60bdc976627038ecd34 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sat, 8 Jan 2022 05:50:11 -0700 Subject: [PATCH] Ports: Add $READELF and $HOST_READELF variables to include scripts Ports such as python require a distinction between host readelf and target readelf. Set a toolchain-specific varaible for these, but be sure save off the host readelf binary in case anyone needs it later. This is part of allowing python to build with the Clang toolchain. --- Ports/.hosted_defs.sh | 2 ++ Ports/.port_include.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Ports/.hosted_defs.sh b/Ports/.hosted_defs.sh index c430da4012..c966e538d8 100644 --- a/Ports/.hosted_defs.sh +++ b/Ports/.hosted_defs.sh @@ -8,6 +8,7 @@ if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then export CXX="clang++ --target=${SERENITY_ARCH}-pc-serenity --sysroot=${SERENITY_BUILD_DIR}/Root" export AR="llvm-ar" export RANLIB="llvm-ranlib" + export READELF="llvm-readelf" export PATH="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin:${HOST_PATH}" else export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}" @@ -15,6 +16,7 @@ else export CXX="${SERENITY_ARCH}-pc-serenity-g++" export AR="${SERENITY_ARCH}-pc-serenity-ar" export RANLIB="${SERENITY_ARCH}-pc-serenity-ranlib" + export READELF="${SERENITY_ARCH}-pc-serenity-readelf" export PATH="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin:${HOST_PATH}" fi diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 880b388498..0bfa494d1d 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -11,6 +11,7 @@ if [ -z "${HOST_CC:=}" ]; then export HOST_AR="${AR:=ar}" export HOST_RANLIB="${RANLIB:=ranlib}" export HOST_PATH="${PATH:=}" + export HOST_READELF="${READELF:=readelf}" 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:=}" @@ -47,6 +48,7 @@ host_env() { export AR="${HOST_AR}" export RANLIB="${HOST_RANLIB}" export PATH="${HOST_PATH}" + export READELF="${HOST_READELF}" 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}"