diff --git a/backend.native/build.gradle b/backend.native/build.gradle index d7a3ecba40a..3631e1ab505 100644 --- a/backend.native/build.gradle +++ b/backend.native/build.gradle @@ -128,12 +128,11 @@ List llvmLinkerOpts() { '-lLLVMCore', '-lLLVMSupport', '-lLLVMDebugInfoCodeView', - '-lLLVMLinker' + '-lLLVMLinker', + "-ldebugInfo" ] - final List res = new ArrayList<>() - - res << "-L$llvmDir/lib" + final List res = ["-L$llvmDir/lib", "-L${project(':llvmDebugInfoC').buildDir}/libs/debugInfo/static"] if (isLinux()) { res.addAll(["-Wl,-Bstatic", "-Wl,--whole-archive"] @@ -146,20 +145,13 @@ List llvmLinkerOpts() { return res } + kotlinNativeInterop { llvm { - defFile 'llvm.def' - compilerOpts "-fPIC", "-I$llvmDir/include" - linkerOpts llvmLinkerOpts() - } - - debugInfo { dependsOn ":llvmDebugInfoC:debugInfoStaticLibrary" - defFile '../llvmDebugInfoC/debugInfo.def' + defFile 'llvm.def' compilerOpts "-fPIC", "-I$llvmDir/include", "-I${project(':llvmDebugInfoC').projectDir}/src/main/include" - if (isLinux()) { - linker 'clang++' - } + linkerOpts llvmLinkerOpts() } hash { // TODO: copy-pasted from ':common:compileHash' @@ -193,7 +185,6 @@ dependencies { compilerCompile kotlinCompilerModule compilerCompile kotlinNativeInterop['llvm'].configuration compilerCompile kotlinNativeInterop['hash'].configuration - compilerCompile kotlinNativeInterop['debugInfo'].configuration cli_bcCompile "org.jetbrains.kotlin:kotlin-runtime:$kotlin_version" cli_bcCompile sourceSets.compiler.output @@ -274,8 +265,7 @@ task jars(type: Jar) { from 'build/classes/cli_bc', 'build/classes/compiler', 'build/classes/hashInteropStubs', - 'build/classes/llvmInteropStubs', - 'build/classes/debugInfoInteropStubs' + 'build/classes/llvmInteropStubs' dependsOn 'build', ':runtime:hostRuntime', 'external_jars' } diff --git a/backend.native/llvm.def b/backend.native/llvm.def index c169ff03256..fddac298595 100644 --- a/backend.native/llvm.def +++ b/backend.native/llvm.def @@ -1,5 +1,5 @@ headers = llvm-c/Core.h llvm-c/ExecutionEngine.h llvm-c/Target.h llvm-c/Analysis.h llvm-c/BitWriter.h \ - llvm-c/BitReader.h llvm-c/Linker.h + llvm-c/BitReader.h llvm-c/Linker.h DebugInfoC.h compilerOpts = -std=c99 -fPIC \ -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers \ diff --git a/build.gradle b/build.gradle index 8756d0e92b9..fa2fd84ce63 100644 --- a/build.gradle +++ b/build.gradle @@ -239,11 +239,6 @@ task dist_compiler(type: Copy) { args '-add_rpath', '@loader_path/', 'dist/konan/nativelib/libclangstubs.dylib' } - exec { - commandLine "install_name_tool" - args '-add_rpath', '@loader_path/', - 'dist/konan/nativelib/libdebugInfostubs.dylib' - } } } } diff --git a/llvmDebugInfoC/debugInfo.def b/llvmDebugInfoC/debugInfo.def deleted file mode 100644 index ac579c04cdf..00000000000 --- a/llvmDebugInfoC/debugInfo.def +++ /dev/null @@ -1,7 +0,0 @@ -headers = DebugInfoC.h - -compilerOpts=-fPIC -linkerOpts.osx = -Wl,-all_load -L../llvmDebugInfoC/build/libs/debugInfo/static -ldebugInfo -linkerOpts.linux = --Wl,--whole-archive -L../llvmDebugInfoC/build/libs/debugInfo/static -ldebugInfo --Wl,--no-whole-archive -lLLVMCore -lLLVMSupport -compilerOpts.osx = -IllvmDebugInfoC/include -Idependencies/all/clang+llvm-3.9.0-darwin-macos/include -compilerOpts.linux = -IllvmDebugInfoC/include -Idependencies/all/clang+llvm-3.9.0-linux-x86-64/include \ No newline at end of file