Hello @Tobias_Grosser1,
I think you’re talking about these lines in src/Makefile.
Without the ifeq ($(USE_SYSTEM_LLVM),1) barrier, these lines execute irrespective of whether Julia’s linked to an external build of LLVM. The LLVM_CONFIG_HOST could point to the llvm-config in an LLVM build in < julia_src >/deps/.
Here’s the output after rebuilding with BUILD_SHARED_LIBS,
$ ldd bin/opt
linux-vdso.so.1 => (0x00007ffcfcb2f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2f016b6000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2f014b1000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f2f01288000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2f0106f000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2f00d6a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2f00a64000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2f0084e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2f00488000)
/lib64/ld-linux-x86-64.so.2 (0x000055b40d89b000)
And before the rebuild,
$ldd bin/opt
linux-vdso.so.1 => (0x00007fff4467a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f917e700000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f917e4fb000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f917e2d2000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f917e0b9000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f917ddb4000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f917daae000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f917d898000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f917d4d2000)
/lib64/ld-linux-x86-64.so.2 (0x0000561535b65000)
I don’t think anything has changed, which is surprising.
Here’s the linker command that creates libjulia-debug.so,
g++ -m64 -shared -pipe -fPIC -fno-rtti -pedantic -O0 -ggdb2 -DJL_DEBUG_BUILD -fstack-protector-all -D_GNU_SOURCE -I. -I/home/sanjay/Software/polly_julia/julia_src/src -I/home/sanjay/Software/polly_julia/julia_src/src/flisp -I/home/sanjay/Software/polly_julia/julia_src/src/support -I/home/sanjay/Software/polly_julia/julia_src/usr/include -I/home/sanjay/Software/polly_julia/julia_src/usr/include -DLIBRARY_EXPORTS -I/home/sanjay/Software/polly_julia/julia_src/deps/valgrind -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden -fno-common -Wpointer-arith -Wundef -DJL_BUILD_ARCH='"x86_64"' -DJL_BUILD_UNAME='"Linux"' -I/home/sanjay/Software/polly_julia/llvm_src/include -I/home/sanjay/Software/polly_julia/llvm_src/tools/polly/include -I/home/sanjay/Software/polly_julia/llvm_build/tools/polly/include -DUSE_POLLY -fopenmp "-DJL_SYSTEM_IMAGE_PATH=\"../lib/julia/sys-debug.so\"" ./jltypes.dbg.obj ./gf.dbg.obj ./typemap.dbg.obj ./ast.dbg.obj ./builtins.dbg.obj ./module.dbg.obj ./interpreter.dbg.obj ./symbol.dbg.obj ./dlload.dbg.obj ./sys.dbg.obj ./init.dbg.obj ./task.dbg.obj ./array.dbg.obj ./dump.dbg.obj ./toplevel.dbg.obj ./jl_uv.dbg.obj ./datatype.dbg.obj ./simplevector.dbg.obj ./APInt-C.dbg.obj ./runtime_intrinsics.dbg.obj ./runtime_ccall.dbg.obj ./threadgroup.dbg.obj ./threading.dbg.obj ./stackwalk.dbg.obj ./gc.dbg.obj ./gc-debug.dbg.obj ./gc-pages.dbg.obj ./method.dbg.obj ./jlapi.dbg.obj ./signal-handling.dbg.obj ./safepoint.dbg.obj ./jloptions.dbg.obj ./timing.dbg.obj ./subtype.dbg.obj ./rtutils.dbg.obj ./codegen.dbg.obj ./jitlayers.dbg.obj ./disasm.dbg.obj ./debuginfo.dbg.obj ./llvm-simdloop.dbg.obj ./llvm-ptls.dbg.obj ./llvm-gcroot.dbg.obj ./cgmemmgr.dbg.obj -Wl,-rpath,'$ORIGIN' -Wl,-rpath,'$ORIGIN/julia' -Wl,-z,origin -o /home/sanjay/Software/polly_julia/julia_src/usr/lib/libjulia-debug.so.0.6.0 -Wl,-Bsymbolic-functions -Wl,--whole-archive ./flisp/libflisp-debug.a -Wl,--whole-archive ./support/libsupport-debug.a -L/home/sanjay/Software/polly_julia/julia_src/usr/lib -L/home/sanjay/Software/polly_julia/julia_src/usr/lib /home/sanjay/Software/polly_julia/julia_src/usr/lib/libuv.a /home/sanjay/Software/polly_julia/julia_src/usr/lib/libutf8proc.a -Wl,--no-whole-archive -lPolly -lPollyISL -lPollyPPCG -Wl,-rpath=/home/sanjay/Software/polly_julia/llvm_build/lib -lGPURuntime -L/home/sanjay/Software/polly_julia/llvm_build/lib -lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoDWARF -lLLVMCoverage -lLLVMTableGen -lLLVMLineEditor -lLLVMOrcJIT -lLLVMMIRParser -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMObjectYAML -lLLVMLibDriver -lLLVMOption -lgtest_main -lgtest -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMTarget -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMScalarOpts -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMProfileData -lLLVMCore -lLLVMSupport -lLLVMDemangle -L/home/sanjay/Software/polly_julia/llvm_build/lib -lrt -ldl -ltinfo -lpthread -lz -lm -Wl,--no-as-needed -ldl -lrt -lpthread -Wl,--export-dynamic,--as-needed,--no-whole-archive /home/sanjay/Software/polly_julia/julia_src/usr/lib/libunwind-generic.a /home/sanjay/Software/polly_julia/julia_src/usr/lib/libunwind.a -Wl,--version-script=/home/sanjay/Software/polly_julia/julia_src/src/julia.expmap -Wl,-soname=libjulia-debug.so.0.6
libjulia-debug.so is linked to NVPTX back-end through “-lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter” yet still doesn’t have any symbol that has “NVPTX” as a substring.
-Sanjay