diff --git a/Makefile.in b/Makefile.in index bb47aab804c..e8a6f4477c3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -982,6 +982,47 @@ stamps/build-llvm-linux: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) $(BINUTILS_SRCDIR) $(BIN -DLLVM_PARALLEL_LINK_JOBS=4 $(MAKE) -C $(notdir $@) $(MAKE) -C $(notdir $@) install + # Build shared/static OpenMP libraries on RV64. + if test $(XLEN) -eq 64; then \ + mkdir $(notdir $@)/openmp-shared; \ + cmake -S$(LLVM_SRCDIR)/openmp \ + -B$(notdir $@)/openmp-shared \ + -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \ + -DCMAKE_C_COMPILER=$(INSTALL_DIR)/bin/clang \ + -DCMAKE_CXX_COMPILER=$(INSTALL_DIR)/bin/clang++ \ + -DOPENMP_ENABLE_LIBOMPTARGET=Off \ + -DCMAKE_BUILD_TYPE=Release \ + -DLIBOMP_ARCH=riscv64 \ + -DLIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG=On \ + -DLIBOMP_HAVE_AS_NEEDED_FLAG=On \ + -DLIBOMP_HAVE_VERSION_SCRIPT_FLAG=On \ + -DLIBOMP_HAVE_STATIC_LIBGCC_FLAG=On \ + -DLIBOMP_HAVE_Z_NOEXECSTACK_FLAG=On \ + -DDISABLE_OMPD_GDB_PLUGIN=On \ + -DLIBOMP_OMPD_GDB_SUPPORT=Off \ + -DLIBOMP_ENABLE_SHARED=On; \ + $(MAKE) -C $(notdir $@)/openmp-shared; \ + $(MAKE) -C $(notdir $@)/openmp-shared install; \ + mkdir $(notdir $@)/openmp-static; \ + cmake -S$(LLVM_SRCDIR)/openmp \ + -B$(notdir $@)/openmp-static \ + -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \ + -DCMAKE_C_COMPILER=$(INSTALL_DIR)/bin/clang \ + -DCMAKE_CXX_COMPILER=$(INSTALL_DIR)/bin/clang++ \ + -DOPENMP_ENABLE_LIBOMPTARGET=Off \ + -DCMAKE_BUILD_TYPE=Release \ + -DLIBOMP_ARCH=riscv64 \ + -DLIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG=On \ + -DLIBOMP_HAVE_AS_NEEDED_FLAG=On \ + -DLIBOMP_HAVE_VERSION_SCRIPT_FLAG=On \ + -DLIBOMP_HAVE_STATIC_LIBGCC_FLAG=On \ + -DLIBOMP_HAVE_Z_NOEXECSTACK_FLAG=On \ + -DDISABLE_OMPD_GDB_PLUGIN=On \ + -DLIBOMP_OMPD_GDB_SUPPORT=Off \ + -DLIBOMP_ENABLE_SHARED=Off; \ + $(MAKE) -C $(notdir $@)/openmp-static; \ + $(MAKE) -C $(notdir $@)/openmp-static install; \ + fi cp $(notdir $@)/lib/riscv$(XLEN)-unknown-linux-gnu/libc++* $(SYSROOT)/lib cp $(notdir $@)/lib/LLVMgold.so $(INSTALL_DIR)/lib cd $(INSTALL_DIR)/bin && ln -s -f clang $(LINUX_TUPLE)-clang && ln -s -f clang++ $(LINUX_TUPLE)-clang++