From 5f87c3022c8347e1b6edd5e2d3aa807269f00b8a Mon Sep 17 00:00:00 2001 From: EWouters <6179932+EWouters@users.noreply.github.com> Date: Sat, 31 Dec 2022 19:40:19 +0100 Subject: [PATCH] Ports: Set `$LD` for Clang, GCC and host in `.hosted_defs.sh` Sets `$LD` to `$HOST_LD` in `.port_include.sh` if it is defined as well, else it will be set to `ld`. Makes libiconv build with the Clang toolchain. This also impacts other ports when building them with the Clang toolchain, and might result in more ports building correctly. --- Ports/.hosted_defs.sh | 3 +++ Ports/.port_include.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/Ports/.hosted_defs.sh b/Ports/.hosted_defs.sh index 121800c5e8..a1ce692d7a 100644 --- a/Ports/.hosted_defs.sh +++ b/Ports/.hosted_defs.sh @@ -8,6 +8,7 @@ export SERENITY_TOOLCHAIN="${SERENITY_TOOLCHAIN:-GNU}" if [ -z "${HOST_CC:=}" ]; then export HOST_CC="${CC:=cc}" export HOST_CXX="${CXX:=c++}" + export HOST_LD="${LD:=ld}" export HOST_AR="${AR:=ar}" export HOST_RANLIB="${RANLIB:=ranlib}" export HOST_PATH="${PATH:=}" @@ -27,6 +28,7 @@ if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin" export CC="${SERENITY_ARCH}-pc-serenity-clang" export CXX="${SERENITY_ARCH}-pc-serenity-clang++" + export LD="${SERENITY_TOOLCHAIN_BINDIR}/ld.lld" export AR="llvm-ar" export RANLIB="llvm-ranlib" export READELF="llvm-readelf" @@ -38,6 +40,7 @@ else export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin" export CC="${SERENITY_ARCH}-pc-serenity-gcc" export CXX="${SERENITY_ARCH}-pc-serenity-g++" + export LD="${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-ld" export AR="${SERENITY_ARCH}-pc-serenity-ar" export RANLIB="${SERENITY_ARCH}-pc-serenity-ranlib" export READELF="${SERENITY_ARCH}-pc-serenity-readelf" diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 50ae6973ce..b4c02cc210 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -64,6 +64,7 @@ enable_ccache host_env() { export CC="${HOST_CC}" export CXX="${HOST_CXX}" + export LD="${HOST_LD}" export AR="${HOST_AR}" export RANLIB="${HOST_RANLIB}" export PATH="${HOST_PATH}"