Skip to content

Commit

Permalink
build-lld: Fix lld install dir path
Browse files Browse the repository at this point in the history
Since 15ee64e 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 <[email protected]>
  • Loading branch information
dakkshesh07 committed Mar 20, 2024
1 parent 01b4ca4 commit 0702da8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build-lld.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ 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"

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() {
cd "${WORK_DIR}"
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" \
Expand All @@ -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
Expand Down

0 comments on commit 0702da8

Please sign in to comment.