From 54576d6ea7c690bdc45feae93fd4b0bb9c639a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kohlschu=CC=88tter?= Date: Thu, 5 Sep 2024 14:14:45 +0200 Subject: [PATCH] Build for loongarch64-Linux We currently use openEuler-24.03-LTS for release builds. Also see commit 3d4553e96ca8f4499a7ab643fa4838c429fa2914 for a workaround necessary at the C language level. https://github.com/kohlschutter/junixsocket/issues/161 --- junixsocket-native-common/pom.xml | 9 ++++ junixsocket-native-cross/pom.xml | 50 +++++++++++++++++++ .../src/main/nar/aol.properties | 22 ++++++++ 3 files changed, 81 insertions(+) diff --git a/junixsocket-native-common/pom.xml b/junixsocket-native-common/pom.xml index ff6a18bd3..20f6d05d2 100644 --- a/junixsocket-native-common/pom.xml +++ b/junixsocket-native-common/pom.xml @@ -248,6 +248,15 @@ runtime true + + com.kohlschutter.junixsocket + junixsocket-native + ${project.version} + nar + loongarch64-Linux-clang-llvm-jni + runtime + true + com.kohlschutter.junixsocket junixsocket-native diff --git a/junixsocket-native-cross/pom.xml b/junixsocket-native-cross/pom.xml index 4ecb66a32..e3d5c6389 100644 --- a/junixsocket-native-cross/pom.xml +++ b/junixsocket-native-cross/pom.xml @@ -791,6 +791,40 @@ + + crosscompile-loongarch64-Linux-clang + + run + + + ${junixsocket.cross.disabled} + true + true + + clean + install + + ${project.basedir}/../ + + junixsocket-native + + + llvm + + + loongarch64-Linux-clang + true + ${project.build.directory}/junixsocket-native-loongarch64-Linux-clang-llvm + loongarch64-openEuler-linux + so + loongarch64-Linux-clang-llvm-jni + ${ignorant} + ${gpgkeyname} + ${gpg.executable} + ${retrolambda} + + + crosscompile-riscv64-Linux-clang @@ -1202,6 +1236,22 @@ false + + install-loongarch64-Linux-clang + ${junixsocket.cross.install-phase} + + install-file + + + ${project.build.directory}/junixsocket-native-loongarch64-Linux-clang-llvm/junixsocket-native-${project.version}-loongarch64-Linux-clang-jni.nar + ${project.groupId} + junixsocket-native + ${project.version} + nar + loongarch64-Linux-clang-llvm-jni + false + + install-riscv64-Linux-clang ${junixsocket.cross.install-phase} diff --git a/junixsocket-native/src/main/nar/aol.properties b/junixsocket-native/src/main/nar/aol.properties index 4f57de61b..6f82f8c61 100644 --- a/junixsocket-native/src/main/nar/aol.properties +++ b/junixsocket-native/src/main/nar/aol.properties @@ -292,6 +292,28 @@ s390x.Linux.clang.cpp.options=${junixsocket.native.clang.cpp.options} -target ${ s390x.Linux.clang.cpp.includes=${junixsocket.native.default.cpp.includes} s390x.Linux.clang.cpp.excludes= +loongarch64.Linux.clang.linker.name=clang +loongarch64.Linux.clang.linker.options=${junixsocket.native.default.linker.options} -Xcrossclang-with-and-without-lc -target ${junixsocket.native.llvm.target} +loongarch64.Linux.clang.c.compiler=clang +loongarch64.Linux.clang.c.defines=_GNU_SOURCE +loongarch64.Linux.clang.c.options=${junixsocket.native.clang.c.options} -Xcrossclang-with-and-without-lc -I${project.basedir}/src/main/c/jni -target ${junixsocket.native.llvm.target} +loongarch64.Linux.clang.c.includes=${junixsocket.native.default.c.includes} +loongarch64.Linux.clang.c.excludes= +loongarch64.Linux.clang.java.include= +loongarch64.Linux.clang.java.runtimeDirectory=IGNORED +loongarch64.Linux.clang.lib.prefix=lib +loongarch64.Linux.clang.shared.prefix=lib +loongarch64.Linux.clang.static.extension=a +loongarch64.Linux.clang.shared.extension=so +loongarch64.Linux.clang.plugin.extension=so +loongarch64.Linux.clang.jni.extension=so +loongarch64.Linux.clang.executable.extension= +loongarch64.Linux.clang.cpp.compiler=clang++ +loongarch64.Linux.clang.cpp.defines=_GNU_SOURCE +loongarch64.Linux.clang.cpp.options=${junixsocket.native.clang.cpp.options} -target ${junixsocket.native.llvm.target} +loongarch64.Linux.clang.cpp.includes=${junixsocket.native.default.cpp.includes} +loongarch64.Linux.clang.cpp.excludes= + riscv64.Linux.clang.linker.name=clang riscv64.Linux.clang.linker.options=${junixsocket.native.default.linker.options} -Xcrossclang-with-and-without-lc -target ${junixsocket.native.llvm.target} -Xcrossclang-llvm-name llvm riscv64.Linux.clang.c.compiler=clang