fix build: mac and linux should take llvm libraries from dependencies/all/clang+llvm..., instead from system path
This commit is contained in:
@@ -39,7 +39,38 @@ kotlinNativeInterop {
|
|||||||
llvm {
|
llvm {
|
||||||
defFile 'llvm.def'
|
defFile 'llvm.def'
|
||||||
compilerOpts "-I$llvmDir/include"
|
compilerOpts "-I$llvmDir/include"
|
||||||
linkerOpts "-L$llvmDir/lib -L$libffiDir/lib -lffi"
|
linkerOpts "-L$llvmDir/lib -lc++ ",
|
||||||
|
"-Wl,--whole-archive",
|
||||||
|
"-lLLVMX86Disassembler",
|
||||||
|
"-lLLVMX86AsmParser",
|
||||||
|
"-lLLVMX86CodeGen",
|
||||||
|
"-lLLVMSelectionDAG",
|
||||||
|
"-lLLVMAsmPrinter",
|
||||||
|
"-lLLVMX86Desc",
|
||||||
|
"-lLLVMMCDisassembler",
|
||||||
|
"-lLLVMX86Info",
|
||||||
|
"-lLLVMX86AsmPrinter",
|
||||||
|
"-lLLVMX86Utils",
|
||||||
|
"-lLLVMInterpreter",
|
||||||
|
"-lLLVMCodeGen",
|
||||||
|
"-lLLVMScalarOpts",
|
||||||
|
"-lLLVMInstCombine",
|
||||||
|
"-lLLVMInstrumentation",
|
||||||
|
"-lLLVMProfileData",
|
||||||
|
"-lLLVMTransformUtils",
|
||||||
|
"-lLLVMBitWriter",
|
||||||
|
"-lLLVMExecutionEngine",
|
||||||
|
"-lLLVMTarget",
|
||||||
|
"-lLLVMAnalysis",
|
||||||
|
"-lLLVMRuntimeDyld",
|
||||||
|
"-lLLVMObject",
|
||||||
|
"-lLLVMMCParser",
|
||||||
|
"-lLLVMBitReader",
|
||||||
|
"-lLLVMMC",
|
||||||
|
"-lLLVMCore",
|
||||||
|
"-lLLVMSupport",
|
||||||
|
"-Wl,--no-whole-archive",
|
||||||
|
"-L$libffiDir/lib -lffi"
|
||||||
}
|
}
|
||||||
|
|
||||||
hash { // TODO: copy-pasted from ':common:compileHash'
|
hash { // TODO: copy-pasted from ':common:compileHash'
|
||||||
@@ -92,6 +123,8 @@ task run(type: JavaExec) {
|
|||||||
doFirst {
|
doFirst {
|
||||||
args '-runtime', project(':runtime').build.outputs.files.singleFile
|
args '-runtime', project(':runtime').build.outputs.files.singleFile
|
||||||
}
|
}
|
||||||
|
environment 'LD_LIBRARY_PATH' : "${llvmDir}/lib:${project.buildDir}/nativelibs"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-13
@@ -12,24 +12,12 @@ linkerOpts = -stdlib=libc++ -fPIC -fvisibility-inlines-hidden \
|
|||||||
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers \
|
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers \
|
||||||
-pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor \
|
-pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor \
|
||||||
-std=c++11 \
|
-std=c++11 \
|
||||||
-DNDEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS \
|
-DNDEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
|
||||||
|
|
||||||
linkerOpts.osx = \
|
linkerOpts.osx = \
|
||||||
-Wl,-search_paths_first -Wl,-headerpad_max_install_names \
|
-Wl,-search_paths_first -Wl,-headerpad_max_install_names \
|
||||||
-lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter \
|
|
||||||
-lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMInterpreter \
|
|
||||||
-lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation -lLLVMProfileData -lLLVMTransformUtils \
|
|
||||||
-lLLVMBitWriter -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser \
|
|
||||||
-lLLVMBitReader -lLLVMMC -lLLVMCore -lLLVMSupport \
|
|
||||||
-lpthread -lz -lm -lcurses
|
-lpthread -lz -lm -lcurses
|
||||||
|
|
||||||
linkerOpts.linux=\
|
linkerOpts.linux=\
|
||||||
-Wl,--whole-archive \
|
|
||||||
-lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter \
|
|
||||||
-lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMInterpreter \
|
|
||||||
-lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation -lLLVMProfileData -lLLVMTransformUtils \
|
|
||||||
-lLLVMBitWriter -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser \
|
|
||||||
-lLLVMBitReader -lLLVMMC -lLLVMCore -lLLVMSupport \
|
|
||||||
-Wl,--no-whole-archive \
|
|
||||||
-lrt -ldl -lpthread -lz -lm \
|
-lrt -ldl -lpthread -lz -lm \
|
||||||
-Wl,-z,noexecstack
|
-Wl,-z,noexecstack
|
||||||
|
|||||||
Reference in New Issue
Block a user