Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loongarch64 support #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion leveldbjni-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@
<version>99-master-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni-linux64-loongarch64</artifactId>
<version>99-master-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

</dependencies>

Expand Down Expand Up @@ -156,6 +161,7 @@
META-INF/native/freebsd64/libleveldbjni.so;osname=FreeBSD;processor=x86-64,
META-INF/native/linux64/ppc64le/libleveldbjni.so;osname=Linux;processor=ppc64le,
META-INF/native/linux64/aarch64/libleveldbjni.so;osname=Linux;processor=aarch64
META-INF/native/linux64/loongarch64/libleveldbjni.so;osname=Linux;processor=loongarch64
</Bundle-NativeCode>
</instructions>
</configuration>
Expand Down
111 changes: 111 additions & 0 deletions leveldbjni-linux64-loongarch64/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2011, FuseSource Corp. All rights reserved.
http://fusesource.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of FuseSource Corp. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni-project</artifactId>
<version>99-master-SNAPSHOT</version>
</parent>

<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni-linux64-loongarch64</artifactId>
<version>99-master-SNAPSHOT</version>

<name>${project.artifactId}</name>
<description>The leveldbjni linux 64 native libraries on loongarch64 machines</description>

<dependencies>
<dependency>
<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni</artifactId>
<version>99-master-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
<testSourceDirectory>${basedir}/../leveldbjni/src/test/java</testSourceDirectory>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<classesDirectory>${basedir}/target/generated-sources/hawtjni/lib</classesDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>maven-hawtjni-plugin</artifactId>
<version>${hawtjni-version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<platform>linux64/loongarch64</platform>
<name>leveldbjni</name>
<classified>false</classified>
<nativeSrcDependency>
<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni</artifactId>
<version>${project.version}</version>
<classifier>native-src</classifier>
<type>zip</type>
</nativeSrcDependency>
<configureArgs>
<arg>--with-leveldb=${env.LEVELDB_HOME}</arg>
<arg>--with-snappy=${env.SNAPPY_HOME}</arg>
</configureArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkMode>once</forkMode>
<argLine>-d64 -ea</argLine>
<failIfNoTests>false</failIfNoTests>
<workingDirectory>${project.build.directory}</workingDirectory>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>

</project>
10 changes: 5 additions & 5 deletions leveldbjni/src/main/native-package/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.14 from Makefile.am.
# Makefile.in generated by automake 1.16 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2013 Free Software Foundation, Inc.
Expand Down Expand Up @@ -400,15 +400,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps --add-missing'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps --add-missing \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps --add-missing Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign --ignore-deps Makefile
$(AUTOMAKE) --foreign --ignore-deps --add-missing Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
Expand Down
8 changes: 4 additions & 4 deletions leveldbjni/src/main/native-package/aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# generated automatically by aclocal 1.14 -*- Autoconf -*-
# generated automatically by aclocal 1.16 -*- Autoconf -*-

# Copyright (C) 1996-2013 Free Software Foundation, Inc.

Expand Down Expand Up @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.14'
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.14], [],
m4_if([$1], [1.16], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])

Expand All @@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.14])dnl
[AM_AUTOMAKE_VERSION([1.16])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
Expand Down
3 changes: 3 additions & 0 deletions leveldbjni/src/main/native-package/autotools/config.guess
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,9 @@ EOF
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
loongarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
Expand Down
8 changes: 7 additions & 1 deletion leveldbjni/src/main/native-package/configure
Original file line number Diff line number Diff line change
Expand Up @@ -6274,6 +6274,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
aarch64-*linux*)
LD="${LD-ld} -m aarch64elf"
;;
loongarch64-*linux*)
LD="${LD-ld} -m elf64loongarch"
;;
esac
;;
*64-bit*)
Expand All @@ -6299,6 +6302,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
aarch64-*linux*)
LD="${LD-ld} -m aarch64elf"
;;
loongarch64-*linux*)
LD="${LD-ld} -m elf64loongarch"
;;
esac
;;
esac
Expand Down Expand Up @@ -15289,7 +15295,7 @@ LDFLAGS="$LDFLAGS $JNI_EXTRA_LDFLAGS -release 99-master-SNAPSHOT"
## -----------------------------------------------------
## Generate the files
## -----------------------------------------------------
am__api_version='1.14'
am__api_version='1.16'

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
Expand Down
8 changes: 7 additions & 1 deletion leveldbjni/src/main/native-package/m4/libtool.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ ia64-*-hpux*)
;;

x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*|aarch64-*linux*)
s390*-*linux*|s390*-*tpf*|sparc*-*linux*|aarch64-*linux*|loongarch64-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
Expand Down Expand Up @@ -1341,6 +1341,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|aarch64-*linux*)
aarch64-*linux*)
LD="${LD-ld} -m aarch64elf"
;;
loongarch64-*linux*)
LD="${LD-ld} -m elf64loongarch"
;;
esac
;;
*64-bit*)
Expand All @@ -1366,6 +1369,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|aarch64-*linux*)
aarch64-*linux*)
LD="${LD-ld} -m aarch64elf"
;;
loongarch64-*linux*)
LD="${LD-ld} -m elf64loongarch"
;;
esac
;;
esac
Expand Down
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<module>leveldbjni-sunos64-sparcv9</module>
<module>leveldbjni-linux64-ppc64le</module>
<module>leveldbjni-linux64-aarch64</module>
<module>leveldbjni-linux64-loongarch64</module>
<module>leveldbjni-all</module>
</modules>
</profile>
Expand Down Expand Up @@ -325,6 +326,7 @@
</modules>
</profile>


<profile>
<id>linux64-ppc64le</id>
<modules>
Expand All @@ -337,6 +339,12 @@
<module>leveldbjni-linux64-aarch64</module>
</modules>
</profile>
<profile>
<id>linux64-loongarch64</id>
<modules>
<module>leveldbjni-linux64-loongarch64</module>
</modules>
</profile>


</profiles>
Expand Down