]> rtime.felk.cvut.cz Git - hercules2020/hercules-compiler.git/commitdiff
Add and compile LLVM linker (LLD)
authorMichal Sojka <michal.sojka@cvut.cz>
Fri, 23 Nov 2018 07:41:39 +0000 (08:41 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Fri, 23 Nov 2018 07:41:39 +0000 (08:41 +0100)
This linker can cross-link for different architecure. Unfortunately, I
haven't found a way how to tell clang to use this linker by default so
one has to link manually by using the ld.lld command.

.gitmodules
Makefile
lld [new submodule]

index 30730ea6f79ab7eba4c9650423e30362d2b0eba7..115792bcc34ac9d371228d37589043f60b2656d2 100644 (file)
@@ -10,3 +10,6 @@
 [submodule "HerculesCompiler"]
        path = HerculesCompiler
        url = https://iis-git.ee.ethz.ch/H2020-Compiler/HerculesCompiler-public
+[submodule "lld"]
+       path = lld
+       url = https://github.com/llvm-mirror/lld
index 7cf318ef326e497ce3071fcc8ee970ac0700a2be..96794c3c89fe242355aa39cff22c930fa01f1b9d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,9 @@ build/bin/opt: build/build.ninja
 llvm/tools/clang:
        ln -s ../../clang $@
 
+llvm/tools/lld:
+       ln -s ../../lld $@
+
 llvm/projects/openmp:
        ln -s ../../openmp $@
 
@@ -60,11 +63,11 @@ libpremnotify: export CC=$(DEB_HOST_GNU_TYPE)-gcc-5
 endif
 
 
-build/build.ninja: | build llvm/tools/clang llvm/projects/openmp
+build/build.ninja: | build llvm/tools/clang llvm/tools/lld llvm/projects/openmp
        cd $(@D) && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(PREFIX)" \
                -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_BACKTRACES=ON -DLLVM_ENABLE_WERROR=OFF \
                -DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_RTTI=ON $(LLVM_CROSS_FLAGS) \
-               -DLLVM_ENABLE_LLD=ON \
+               -DLLVM_ENABLE_LLD=ON -DLLVM_TOOL_LLD_BUILD=ON \
                -DCMAKE_CXX_FLAGS='-DHERCULES_PASS_ROOT=\"$(PREFIX)/lib/hercules/src/passes/\" -DOPENMP_NVPTX_COMPUTE_CAPABILITY=62 $(if $(USE_GPUGUARD),-DUSE_GPUGUARD)' \
                -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITY="62" \
                -G"Ninja" $(CURDIR)/llvm
diff --git a/lld b/lld
new file mode 160000 (submodule)
index 0000000..c97a502
--- /dev/null
+++ b/lld
@@ -0,0 +1 @@
+Subproject commit c97a5023afb2fe46956bc95818d924831ed1400f