Skip to content

Commit

Permalink
Add support for Linux aarch64
Browse files Browse the repository at this point in the history
- add gcc target for linux-aarch64

- for linux, build only current architecture
  • Loading branch information
jasonstack committed Apr 15, 2024
1 parent a5a0aa0 commit 6b7b045
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ subprojects {
}
}
}
gcc(Gcc)
gcc(Gcc) {
target("linux_aarch64") {
cppCompiler.executable = "/usr/bin/gcc"
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion openjdk-uber/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = 'Conscrypt: OpenJdk UberJAR'
ext {
buildUberJar = Boolean.parseBoolean(System.getProperty('org.conscrypt.openjdk.buildUberJar', 'false'))
uberJarClassifiers = (System.getProperty('org.conscrypt.openjdk.uberJarClassifiers',
'osx-x86_64,osx-aarch_64,linux-x86_64,windows-x86_64')).split(',')
'osx-x86_64,osx-aarch_64,linux-x86_64,linux-aarch_64,windows-x86_64')).split(',')
classesDir = "${buildDir}/classes"
resourcesDir = "${buildDir}/resources"
sourcesDir = "${buildDir}/sources"
Expand Down
11 changes: 9 additions & 2 deletions openjdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ description = 'Conscrypt: OpenJdk'
enum NativeBuildInfo {
WINDOWS_X86_64("windows", "x86_64"),
LINUX_X86_64("linux", "x86_64"),
LINUX_AARCH64("linux", "aarch_64"),
MAC_X86_64("osx", "x86_64") {
String libDir() {
"build.x86"
Expand Down Expand Up @@ -116,8 +117,14 @@ ext {
jniSourceDir = "$rootDir/common/src/jni"
assert file("$jniSourceDir").exists()

// Decide which targets we should build and test
nativeBuilds = NativeBuildInfo.findAll("${osdetector.os}")
// Decide which targets we should build and test:
// - if osx, build both x86 and aarch64
// - if linux, build current architecture because it doesn't support cross-compilation
if ("${osdetector.os}" == "osx") {
nativeBuilds = NativeBuildInfo.findAll("${osdetector.os}")
} else {
nativeBuilds = [NativeBuildInfo.find("${osdetector.os}", "${osdetector.arch}")]
}
buildToTest = NativeBuildInfo.find("${osdetector.os}", "${osdetector.arch}")

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

0 comments on commit 6b7b045

Please sign in to comment.