added .usr/bin path to tools chain to take right variants of binutils from our system archieve

This commit is contained in:
Vasily Levchenko
2016-11-07 14:11:23 +03:00
parent f06aeef9ce
commit 147de5d3ad
4 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ kotlinNativeInterop {
llvm {
defFile '../backend.native/llvm.def'
compilerOpts "-I$llvmDir/include"
linkerOpts "-L$llvmDir/lib"
linkerOpts "-L$llvmDir/lib", "-B$sysrootDir/usr/bin"
}
}
+3 -2
View File
@@ -96,19 +96,20 @@ String[] linkerOpts1() {
+ ["-L$libffiDir/lib", "-lffi"])
ArrayList<String> strldflags = new ArrayList<>()
ldflags.forEach{strldflags.add(it.toString())}
strldflags.add("-B$sysrootDir/usr/bin".toString())
return strldflags.toArray(new String[0])
}
kotlinNativeInterop {
llvm {
defFile 'llvm.def'
compilerOpts "-fPIC", "-I$llvmDir/include"
compilerOpts "-fPIC", "-I$llvmDir/include", "-B$sysrootDir/usr/bin"
linkerOpts linkerOpts1()
}
hash { // TODO: copy-pasted from ':common:compileHash'
compilerOpts '-fPIC'
linkerOpts '-fPIC'
linkerOpts '-fPIC', "-B$sysrootDir/usr/bin"
linker 'clang++'
linkOutputs ':common:compileHash'
+2 -2
View File
@@ -101,7 +101,7 @@ class UnitKonanTest extends KonanTest {
void compileTest(File sourceS, File runtimeS, File exe) {
def testC = sourceS.absolutePath.replace(".kt.S", "-test.c")
project.exec {
commandLine "${llvmC}", "${testC}", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
commandLine "${llvmC}", "-B${project.sysrootDir}/usr/bin", "${testC}", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
"-o", "${exe.absolutePath}"
args llvmCAdditionalArgs
@@ -112,7 +112,7 @@ class UnitKonanTest extends KonanTest {
class RunKonanTest extends KonanTest {
void compileTest(File sourceS, File runtimeS, File exe) {
project.exec {
commandLine "${llvmC}", "-DRUN_TEST", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
commandLine "${llvmC}", "-DRUN_TEST", "-B${project.sysrootDir}/usr/bin", "${runtimeS.absolutePath}", "${sourceS.absolutePath}", "${mainC}", linkDl(),
"-o", "${exe.absolutePath}"
args llvmCAdditionalArgs
+3 -2
View File
@@ -16,11 +16,12 @@ allprojects {
toolChains {
clang(Clang) {
path "$llvmDir/bin"
eachPlatform { // TODO: will not work when cross-compiling
[cCompiler, cppCompiler, linker].each {
it.withArguments { it << "--sysroot=$sysrootDir" }
it.withArguments { it << "--sysroot=$sysrootDir"}
it.withArguments { it << "-B$sysrootDir/usr/bin"}
}
}
}
}