From 0702da85befdf71a91e4790cfa42b968507121d4 Mon Sep 17 00:00:00 2001 From: Dakkshesh Date: Wed, 20 Mar 2024 19:27:44 +0530 Subject: [PATCH] build-lld: Fix lld install dir path Since https://github.com/mvaisakh/gcc-build/commit/15ee64ea5ef1262e281ccf4932c50cc4ade0a20a the gcc-arm64 build dir path got changed and the lld install path wasn't updated for it. Fix it and to avoid similar problems in future update all bits to use explicit path in terms of WORK_DIR var. Signed-off-by: Dakkshesh --- build-lld.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build-lld.sh b/build-lld.sh index d7b588b..af37229 100755 --- a/build-lld.sh +++ b/build-lld.sh @@ -22,12 +22,12 @@ while getopts a: flag; do done # Let's keep this as is -export WORK_DIR="$PWD" -export PREFIX="./gcc-${arch}" +export WORK_DIR="$(pwd)" +export PREFIX="${WORK_DIR}/gcc-${arch}" export PATH="$PREFIX/bin:$PATH" echo "Cleaning up previously cloned repos..." -rm -rf $WORK_DIR/llvm-project +rm -rf "${WORK_DIR}"/llvm-project echo "Building Integrated lld for ${arch} with ${TARGET_CLANG} as target" @@ -35,8 +35,8 @@ download_resources() { echo ">" echo "> Downloading LLVM for LLD" echo ">" - git clone https://github.com/llvm/llvm-project -b main llvm --depth=1 cd "${WORK_DIR}" + git clone https://github.com/llvm/llvm-project.git -b main "${WORK_DIR}/llvm-project" --depth=1 } build_lld() { @@ -44,9 +44,9 @@ build_lld() { echo ">" echo "> Building LLD" echo ">" - mkdir -p llvm/build - cd llvm/build - export INSTALL_LLD_DIR="../../../gcc-${arch}" + mkdir -p "${WORK_DIR}/llvm-project/build" + cd "${WORK_DIR}/llvm-project/build" + export INSTALL_LLD_DIR="${WORK_DIR}/gcc-${arch}" cmake -G "Ninja" \ -DLLVM_ENABLE_PROJECTS=lld \ -DCMAKE_INSTALL_PREFIX="$INSTALL_LLD_DIR" \ @@ -72,7 +72,7 @@ build_lld() { -DCMAKE_C_FLAGS="-O3" \ -DCMAKE_CXX_FLAGS="-O3" \ -DLLVM_ENABLE_PIC=False \ - ../llvm + "${WORK_DIR}"/llvm-project/llvm ninja -j$(nproc --all) ninja -j$(nproc --all) install # Create proper symlinks