Skip to content

Commit 6b7b045

Browse files
committed
Add support for Linux aarch64
- add gcc target for linux-aarch64 - for linux, build only current architecture
1 parent a5a0aa0 commit 6b7b045

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ subprojects {
6262
}
6363
}
6464
}
65-
gcc(Gcc)
65+
gcc(Gcc) {
66+
target("linux_aarch64") {
67+
cppCompiler.executable = "/usr/bin/gcc"
68+
}
69+
}
6670
}
6771
}
6872
}

openjdk-uber/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description = 'Conscrypt: OpenJdk UberJAR'
33
ext {
44
buildUberJar = Boolean.parseBoolean(System.getProperty('org.conscrypt.openjdk.buildUberJar', 'false'))
55
uberJarClassifiers = (System.getProperty('org.conscrypt.openjdk.uberJarClassifiers',
6-
'osx-x86_64,osx-aarch_64,linux-x86_64,windows-x86_64')).split(',')
6+
'osx-x86_64,osx-aarch_64,linux-x86_64,linux-aarch_64,windows-x86_64')).split(',')
77
classesDir = "${buildDir}/classes"
88
resourcesDir = "${buildDir}/resources"
99
sourcesDir = "${buildDir}/sources"

openjdk/build.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ description = 'Conscrypt: OpenJdk'
2222
enum NativeBuildInfo {
2323
WINDOWS_X86_64("windows", "x86_64"),
2424
LINUX_X86_64("linux", "x86_64"),
25+
LINUX_AARCH64("linux", "aarch_64"),
2526
MAC_X86_64("osx", "x86_64") {
2627
String libDir() {
2728
"build.x86"
@@ -116,8 +117,14 @@ ext {
116117
jniSourceDir = "$rootDir/common/src/jni"
117118
assert file("$jniSourceDir").exists()
118119

119-
// Decide which targets we should build and test
120-
nativeBuilds = NativeBuildInfo.findAll("${osdetector.os}")
120+
// Decide which targets we should build and test:
121+
// - if osx, build both x86 and aarch64
122+
// - if linux, build current architecture because it doesn't support cross-compilation
123+
if ("${osdetector.os}" == "osx") {
124+
nativeBuilds = NativeBuildInfo.findAll("${osdetector.os}")
125+
} else {
126+
nativeBuilds = [NativeBuildInfo.find("${osdetector.os}", "${osdetector.arch}")]
127+
}
121128
buildToTest = NativeBuildInfo.find("${osdetector.os}", "${osdetector.arch}")
122129

123130
assert !nativeBuilds.isEmpty() : "No native builds selected."

0 commit comments

Comments
 (0)