1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-05 19:34:52 +00:00

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.
This commit is contained in:
EWouters 2022-12-31 19:40:19 +01:00 committed by Andrew Kaster
parent 401bc13776
commit 5f87c3022c
2 changed files with 4 additions and 0 deletions

View File

@ -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"

View File

@ -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}"