Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #648 #649

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions software/mk/Makefile.llvminstall
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ ifndef GENERATOR
endif
endif

llvm-install:


llvm-install: $(LLVM_DIR)/llvm-src
mkdir -p $(LLVM_DIR)/llvm-build && mkdir -p $(LLVM_DIR)/llvm-install
# Get LLVM sources
cd $(LLVM_DIR) && \
git clone https://github.com/bespoke-silicon-group/llvm-project.git ./llvm-src && \
cd ./llvm-src && git fetch && git checkout hb-dev
cd $(LLVM_DIR)/llvm-src && git stash && git fetch && git checkout hb-dev && git apply $(PATCH_DIR)/llvm-gcc11.patch
# Install only X86 and RISCV targets
cd $(LLVM_DIR)/llvm-build \
&& $(CMAKE) -G $(GENERATOR) -DCMAKE_BUILD_TYPE="Debug" \
Expand All @@ -51,3 +51,7 @@ llvm-install:
-DLLVM_OPTIMIZED_TABLEGEN=True \
../llvm-src/llvm
cd $(LLVM_DIR)/llvm-build && $(CMAKE) --build . --target install -- -j 12

$(LLVM_DIR)/llvm-src:
cd $(LLVM_DIR) && \
git clone https://github.com/bespoke-silicon-group/llvm-project.git ./llvm-src
2 changes: 1 addition & 1 deletion software/riscv-tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ build-llvm:
@echo "====================================="
@echo "Building $(LLVM_DIR)..."
@echo "====================================="
$(MAKE) -C ../mk/ -f Makefile.llvminstall LLVM_DIR=$(LLVM_DIR) RISCV_INSTALL_DIR=$(RISCV)
$(MAKE) -C ../mk/ -f Makefile.llvminstall PATCH_DIR=$(CURDIR) LLVM_DIR=$(LLVM_DIR) RISCV_INSTALL_DIR=$(RISCV)

build-all:
$(MAKE) build-deps
Expand Down
12 changes: 12 additions & 0 deletions software/riscv-tools/llvm-gcc11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/llvm/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h
index 0705e219f2fa..6001fb8e0e48 100644
--- a/llvm/utils/benchmark/src/benchmark_register.h
+++ b/llvm/utils/benchmark/src/benchmark_register.h
@@ -2,6 +2,7 @@
#define BENCHMARK_REGISTER_H

#include <vector>
+#include <limits>

#include "check.h"