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

Convert shared build of LLVM OpenMP to in-tree #1558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 6 additions & 22 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ EXTRA_MULTILIB_TEST := @extra_multilib_test@
XLEN := $(shell echo $(WITH_ARCH) | tr A-Z a-z | sed 's/.*rv\([0-9]*\).*/\1/')
ifneq ($(XLEN),32)
XLEN := 64
LLVM_OPENMP := openmp
LLVM_OPENMP_CMAKE_FLAGS := -DRUNTIMES_CMAKE_ARGS="-DLIBOMP_OMPD_SUPPORT=OFF;-DLIBOMP_ARCHER_SUPPORT=OFF;-DOPENMP_ENABLE_LIBOMPTARGET=OFF"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we turn off these for static build as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We disable LIBOMPTARGGET already. Archer and OMPD are related to debugging, if out of tree build locates them it might be one more argument in favor of that 😄

endif

make_tuple = riscv$(1)-unknown-$(2)
Expand Down Expand Up @@ -1148,36 +1150,18 @@ stamps/build-llvm-linux: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) $(BINUTILS_SRCDIR) $(BIN
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="RISCV" \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind;$(LLVM_OPENMP)" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If LLVM_OPENMP is empty, the build system of LLVM will complain Runtime "" is not a supported runtime..

$(LLVM_OPENMP_CMAKE_FLAGS) \
-DLLVM_DEFAULT_TARGET_TRIPLE="$(LINUX_TUPLE)" \
-DDEFAULT_SYSROOT="../sysroot" \
-DLLVM_RUNTIME_TARGETS=$(call make_tuple,$(XLEN),linux-gnu) \
-DLLVM_RUNTIME_TARGETS=default \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=On \
-DLLVM_BINUTILS_INCDIR=$(BINUTILS_SRCDIR)/include \
-DLLVM_PARALLEL_LINK_JOBS=4
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
# Build shared/static OpenMP libraries on RV64.
# Build 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=$(SYSROOT) \
-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 \
Expand Down
Loading