Skip to content

Commit 22e786d

Browse files
committed
LOONGSON: LoongArch port
Merged by xtex <xtexchooser@duck.com> Squashed commit of the following: commit 5fb709bb664a1f3fcf81a34210d1118c2db56058 Merge: d6a27b929fc5 618917e Author: aoqi <aoqi@loongson.cn> Date: Thu Oct 17 16:09:31 2024 +0800 Merge commit d6a27b929fc59fce02ce7324f0f82237025853c9 Merge: 2e66c8f2be71 39221f8 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 16 18:15:33 2024 +0800 Merge commit 2e66c8f2be71d9a21ddac179a268f9bd4b3fceae Merge: b6d3132b56ee 89697c3 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 16 18:13:35 2024 +0800 Merge commit b6d3132b56ee6b8fb1ae8e4f487bccd6e8dc0f19 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Oct 16 18:13:19 2024 +0800 Update (2024.10.16) 34668: start of release updates for Loongson OpenJDK 8.1.21 commit 63ca8562fa119154f06afa5fbf421cbe35973f1f Merge: adb4c27c2564 18b3ca5 Author: aoqi <aoqi@loongson.cn> Date: Fri Jul 26 14:56:40 2024 +0800 Merge commit adb4c27c2564565e76b7f95db959eefaf466b29c Merge: 30363d770a7d 1050982 Author: aoqi <aoqi@loongson.cn> Date: Fri Jul 26 14:55:27 2024 +0800 Merge commit 30363d770a7d55b735f31323bac100896571aadb Merge: 91be217984ee 216b8cb Author: aoqi <aoqi@loongson.cn> Date: Fri Jul 26 14:52:21 2024 +0800 Merge commit 91be217984ee3636d7ab92a9e3419d3d4177d846 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jul 26 11:46:08 2024 +0800 Update (2024.07.26) 34273: start of release updates for Loongson OpenJDK 8.1.20 commit 11af84f8d06e4225a01826c55417f60e1c83e600 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Apr 26 19:15:09 2024 +0800 Update (2024.04.26, 2nd) 34058: LA port of 8322122: Enhance generation of addresses commit 0cae2014308d8e7f63b219bdd66af96c7cf6e828 Merge: f04e9761afc9 43cb875 Author: aoqi <aoqi@loongson.cn> Date: Fri Apr 26 18:56:35 2024 +0800 Merge commit f04e9761afc9b2abc509452dfab457dcb05ac66e Merge: ea8d738a9ad8 824dbfb Author: aoqi <aoqi@loongson.cn> Date: Fri Apr 26 18:56:01 2024 +0800 Merge commit ea8d738a9ad8c350b3169fb5806293f92d743454 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Apr 26 18:51:45 2024 +0800 Update (2024.04.26) 33747: start of release updates for Loongson OpenJDK 8.1.19 commit ead1d6f03ac1816d6db51e50c3fecd0201c5df87 Merge: 88a9d9bd868e d4b472f Author: aoqi <aoqi@loongson.cn> Date: Fri Jan 26 18:28:15 2024 +0800 Merge commit 88a9d9bd868e50e8462125c9cacd582ae934fac9 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 26 18:27:25 2024 +0800 Update (2024.01.26, 2nd) 33245: Fix string_comp out-of-bounds load when cnt1 is 0 33227: ppc64el build failed commit 33c606e5a5ebfd118b74e8fb033bc91ff3be1c41 Merge: a1066564f8fa b372b4b Author: aoqi <aoqi@loongson.cn> Date: Fri Jan 26 18:18:02 2024 +0800 Merge commit a1066564f8fa2c5d695ad9a5c1366ea60e8c4a5f Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 26 18:17:39 2024 +0800 Update (2024.01.26) 33189: start of release updates for Loongson OpenJDK 8.1.18 commit b163f9d814a747cd6b28791c98716b0035bfb87f Merge: 27819d416029 9499e54 Author: aoqi <aoqi@loongson.cn> Date: Fri Dec 8 13:19:21 2023 +0800 Merge commit 27819d41602923840f5675b15d42126763c42b81 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Dec 8 13:18:08 2023 +0800 Update (2023.12.08) 32653: start of release updates for Loongson OpenJDK 8.1.17 32163: The size of is_wide_vector should be greater than 8 bytes commit d572f97db06acd269269432725506db1111c8443 Merge: bb6268980d88 50e903b Author: aoqi <aoqi@loongson.cn> Date: Mon Aug 14 19:29:21 2023 +0800 Merge commit bb6268980d88b9cd0a7695cc5f2675c909aafcd7 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Aug 14 19:20:35 2023 +0800 Update (2023.08.14) 31482: StoreStore only be used for CMS with no conditional card marking 31484: Fix a typo StoreLoad to StoreStore 31447: start of release updates for Loongson OpenJDK 8.1.16 commit 6d24310bb81085c21711594b4909059d79475c31 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Jul 3 21:24:34 2023 +0800 Update (2023.07.03) 31215: start of release updates for Loongson OpenJDK 8.1.15 30358: Add support for ordering memory barriers commit 5a851f7f645be8e459d4695640432d0a0b1c8ac4 Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 13:45:03 2023 +0800 Update (2023.05.17, 2nd) 29453: Some cpu features use hwcap detect commit ef3596a168567e5615d5d50dc409f87a3eb6c9e7 Merge: 873d5bf34526 338acde Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 13:12:19 2023 +0800 Merge commit 873d5bf345266af40376c44eeef548117a4f3a2c Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 13:07:19 2023 +0800 Update (2023.05.17) 29901: runtime/Unsafe/RangeCheck.java fail with -Xcomp 30296: start of release updates for Loongson OpenJDK 8.1.14 commit ffbaa6e74c015ac21218a2acfca0fe7cc19f4e4c Author: loongson-jvm <jvm@loongson.cn> Date: Fri Feb 24 11:30:36 2023 +0800 Update (2023.02.23) 18662: Fixed - 'Disassembler' has not been declared 12751: [8u] compiler/criticalnatives/argumentcorruption/Test8167409.sh fail 29675: windows debug build failed 29680: 8299804: Fix non-portable code in hotspot shell tests in 8u 28682: [MIPS] Fix a typo in PosixSignals::pd_hotspot_signal_handler 28678: Fix a typo in PosixSignals::pd_hotspot_signal_handler 29646: LA/MIPS port of 8296959: Fix hotspot shell tests of 8u on multilib systems commit cbfee0d51bf1976c10b33b4a1640c531069953e1 Merge: bdc8ddb75147 36321be Author: aoqi <aoqi@loongson.cn> Date: Wed Feb 1 10:15:40 2023 +0800 Merge commit bdc8ddb75147a49ba6ea55db461f395e5cb28b2e Author: loongson-jvm <jvm@loongson.cn> Date: Tue Jan 31 11:18:12 2023 +0800 Update (2023.01.29) 29492: start of release updates for Loongson OpenJDK 8.1.13 commit ca609c1bf106feba42fb7b24bf64a29069af4739 Author: loongson-jvm <jvm@loongson.cn> Date: Sun Jan 29 15:02:45 2023 +0800 Update (2023.01.18) (openjdk#4) 28849: 8296480: java/security/cert/pkix/policyChanges/TestPolicy.java is failing 29145: 8296485: BuildEEBasicConstraints.java test fails with SunCertPathBuilderException commit 9e2004a5ce3e94c4ebd0ff54c6ae5d8e76b7e198 Author: loongson-jvm <jvm@loongson.cn> Date: Tue Nov 22 03:12:34 2022 +0800 Update (2022.11.22) 28846: Avoid multiple reloads of the mark oop in oopDesc::forward_to_atomic 28672: build failed with --disable-precompiled-headers on LA64 and MIPS64 28477: Fix misleading-indentation warnings commit 547f63aa7fa7babe97c0ac6abac38fea0c5580d0 Merge: caebbd7c6c48 dfa5f14 Author: aoqi <aoqi@loongson.cn> Date: Fri Oct 21 18:43:29 2022 +0800 Merge commit caebbd7c6c486455e834478ed6aa75d9b8bbfd26 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Oct 20 20:09:00 2022 +0800 Initial commit by Loongson A LoongArch64 port (template interpreter, C1 JIT compiler and C2 JIT compiler) and a MIPS64 port (template interpreter and C2 JIT compiler). Co-authored-by: Loongson JVM team
1 parent 129290d commit 22e786d

File tree

410 files changed

+111164
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

410 files changed

+111164
-206
lines changed

common/autoconf/build-aux/autoconf-config.guess

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,9 @@ EOF
977977
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
978978
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
979979
;;
980+
loongarch64:Linux:*:*)
981+
echo ${UNAME_MACHINE}-unknown-linux-gnu
982+
exit ;;
980983
or32:Linux:*:*)
981984
echo ${UNAME_MACHINE}-unknown-linux-gnu
982985
exit ;;

common/autoconf/build-aux/autoconf-config.sub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ case $basic_machine in
275275
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
276276
| i370 | i860 | i960 | ia64 \
277277
| ip2k | iq2000 \
278+
| loongarch | loongarch64 \
278279
| m32c | m32r | m32rle | m68000 | m68k | m88k \
279280
| maxq | mb | microblaze | mcore | mep \
280281
| mips | mipsbe | mipseb | mipsel | mipsle \

common/autoconf/build-aux/config.guess

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ if [ "x$OUT" = x ]; then
8686
fi
8787
fi
8888

89+
# Test and fix little endian MIPS.
90+
if [ "x$OUT" = x ]; then
91+
if [ `uname -s` = Linux ]; then
92+
if [ `uname -m` = mipsel ]; then
93+
OUT=mipsel-unknown-linux-gnu
94+
elif [ `uname -m` = mips64el ]; then
95+
OUT=mips64el-unknown-linux-gnu
96+
fi
97+
fi
98+
fi
99+
89100
# Test and fix LoongArch64.
90101
if [ "x$OUT" = x ]; then
91102
if [ `uname -s` = Linux ]; then

common/autoconf/configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
# questions.
2424
#
2525

26+
#
27+
# This file has been modified by Loongson Technology in 2018. These
28+
# modifications are Copyright (c) 2018 Loongson Technology, and are made
29+
# available on the same license terms set forth above.
30+
#
31+
2632
###############################################################################
2733
#
2834
# Includes and boilerplate
@@ -186,6 +192,7 @@ FLAGS_SETUP_INIT_FLAGS
186192
# Now we can test some aspects on the target using configure macros.
187193
PLATFORM_SETUP_OPENJDK_TARGET_BITS
188194
PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
195+
GET_BUILDER_AND_HOST_DATA
189196

190197
# Configure flags for the tools
191198
FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS

common/autoconf/generated-configure.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ SET_EXECUTABLE_ORIGIN
720720
SHARED_LIBRARY_FLAGS
721721
CXX_FLAG_REORDER
722722
C_FLAG_REORDER
723+
HOST_NAME
724+
BUILDER_NAME
725+
BUILDER_ID
723726
SYSROOT_LDFLAGS
724727
SYSROOT_CFLAGS
725728
RC_FLAGS
@@ -4073,6 +4076,12 @@ fi
40734076
# questions.
40744077
#
40754078

4079+
#
4080+
# This file has been modified by Loongson Technology in 2022. These
4081+
# modifications are Copyright (c) 2018, 2022, Loongson Technology, and are made
4082+
# available on the same license terms set forth above.
4083+
#
4084+
40764085
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
40774086
# Converts autoconf style CPU name to OpenJDK style, into
40784087
# VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN.
@@ -13922,6 +13931,12 @@ test -n "$target_alias" &&
1392213931
VAR_CPU_BITS=64
1392313932
VAR_CPU_ENDIAN=big
1392413933
;;
13934+
mips64el)
13935+
VAR_CPU=mips64
13936+
VAR_CPU_ARCH=mips
13937+
VAR_CPU_BITS=64
13938+
VAR_CPU_ENDIAN=little
13939+
;;
1392513940
loongarch64)
1392613941
VAR_CPU=loongarch64
1392713942
VAR_CPU_ARCH=loongarch
@@ -14066,6 +14081,12 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; }
1406614081
VAR_CPU_BITS=64
1406714082
VAR_CPU_ENDIAN=big
1406814083
;;
14084+
mips64el)
14085+
VAR_CPU=mips64
14086+
VAR_CPU_ARCH=mips
14087+
VAR_CPU_BITS=64
14088+
VAR_CPU_ENDIAN=little
14089+
;;
1406914090
loongarch64)
1407014091
VAR_CPU=loongarch64
1407114092
VAR_CPU_ARCH=loongarch
@@ -14194,6 +14215,8 @@ $as_echo "$COMPILE_TYPE" >&6; }
1419414215
OPENJDK_TARGET_CPU_LEGACY_LIB="i386"
1419514216
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
1419614217
OPENJDK_TARGET_CPU_LEGACY_LIB="amd64"
14218+
elif test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
14219+
OPENJDK_TARGET_CPU_LEGACY_LIB="mips64el"
1419714220
fi
1419814221

1419914222

@@ -14227,6 +14250,9 @@ $as_echo "$COMPILE_TYPE" >&6; }
1422714250
elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
1422814251
# On all platforms except macosx, we replace x86_64 with amd64.
1422914252
OPENJDK_TARGET_CPU_OSARCH="amd64"
14253+
elif test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
14254+
# System.getProperty("os.arch"): mips64 -> mips64el
14255+
OPENJDK_TARGET_CPU_OSARCH="mips64el"
1423014256
fi
1423114257

1423214258

@@ -14236,6 +14262,8 @@ $as_echo "$COMPILE_TYPE" >&6; }
1423614262
elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
1423714263
# On all platforms except macosx, we replace x86_64 with amd64.
1423814264
OPENJDK_TARGET_CPU_JLI="amd64"
14265+
elif test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
14266+
OPENJDK_TARGET_CPU_JLI="mips64el"
1423914267
fi
1424014268
# Now setup the -D flags for building libjli.
1424114269
OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'"
@@ -14248,6 +14276,9 @@ $as_echo "$COMPILE_TYPE" >&6; }
1424814276
elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then
1424914277
OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
1425014278
fi
14279+
if test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
14280+
OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"mips32el\"' -DLIBARCH64NAME='\"mips64el\"'"
14281+
fi
1425114282

1425214283

1425314284
# Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
@@ -42422,6 +42453,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
4242242453
fi
4242342454

4242442455

42456+
BUILDER_NAME="$build_os"
42457+
BUILDER_ID="Custom build ($(date))"
42458+
if test -f /etc/issue; then
42459+
etc_issue_info=`cat /etc/issue`
42460+
if test -n "$etc_issue_info"; then
42461+
BUILDER_NAME=`cat /etc/issue | head -n 1 | cut -d " " -f 1`
42462+
fi
42463+
fi
42464+
if test -f /etc/redhat-release; then
42465+
etc_issue_info=`cat /etc/redhat-release`
42466+
if test -n "$etc_issue_info"; then
42467+
BUILDER_NAME=`cat /etc/redhat-release | head -n 1 | cut -d " " -f 1`
42468+
fi
42469+
fi
42470+
if test -f /etc/neokylin-release; then
42471+
etc_issue_info=`cat /etc/neokylin-release`
42472+
if test -n "$etc_issue_info"; then
42473+
BUILDER_NAME=`cat /etc/neokylin-release | head -n 1 | cut -d " " -f 1`
42474+
fi
42475+
fi
42476+
if test -z "$BUILDER_NAME"; then
42477+
BUILDER_NAME="unknown"
42478+
fi
42479+
BUILDER_NAME=`echo $BUILDER_NAME | sed -r "s/-//g"`
42480+
if test -n "$OPENJDK_TARGET_CPU_OSARCH"; then
42481+
HOST_NAME="$OPENJDK_TARGET_CPU_OSARCH"
42482+
else
42483+
HOST_NAME="unknown"
42484+
fi
42485+
if test -f "/usr/bin/cpp"; then
42486+
# gcc_with_arch_info=`gcc -v 2>&1 | grep '\-\-with-arch=' | sed 's/.*--with-arch=//;s/ .*$//'`
42487+
gcc_with_arch_info=`cpp -dM /dev/null | grep '\<_MIPS_ARCH\>' | sed 's/^#define _MIPS_ARCH "//;s/"$//'`
42488+
if test -n "$gcc_with_arch_info"; then
42489+
HOST_NAME="$gcc_with_arch_info"
42490+
fi
42491+
fi
42492+
42493+
42494+
42495+
42496+
4242542497
# Configure flags for the tools
4242642498

4242742499
###############################################################################

common/autoconf/platform.m4

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
# questions.
2424
#
2525

26+
#
27+
# This file has been modified by Loongson Technology in 2022. These
28+
# modifications are Copyright (c) 2018, 2022, Loongson Technology, and are made
29+
# available on the same license terms set forth above.
30+
#
31+
2632
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
2733
# Converts autoconf style CPU name to OpenJDK style, into
2834
# VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN.
@@ -96,6 +102,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
96102
VAR_CPU_BITS=64
97103
VAR_CPU_ENDIAN=big
98104
;;
105+
mips64el)
106+
VAR_CPU=mips64
107+
VAR_CPU_ARCH=mips
108+
VAR_CPU_BITS=64
109+
VAR_CPU_ENDIAN=little
110+
;;
99111
loongarch64)
100112
VAR_CPU=loongarch64
101113
VAR_CPU_ARCH=loongarch
@@ -289,6 +301,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
289301
OPENJDK_TARGET_CPU_LEGACY_LIB="i386"
290302
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
291303
OPENJDK_TARGET_CPU_LEGACY_LIB="amd64"
304+
elif test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
305+
OPENJDK_TARGET_CPU_LEGACY_LIB="mips64el"
292306
fi
293307
AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB)
294308
@@ -322,6 +336,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
322336
elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
323337
# On all platforms except macosx, we replace x86_64 with amd64.
324338
OPENJDK_TARGET_CPU_OSARCH="amd64"
339+
elif test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
340+
# System.getProperty("os.arch"): mips64 -> mips64el
341+
OPENJDK_TARGET_CPU_OSARCH="mips64el"
325342
fi
326343
AC_SUBST(OPENJDK_TARGET_CPU_OSARCH)
327344
@@ -331,6 +348,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
331348
elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
332349
# On all platforms except macosx, we replace x86_64 with amd64.
333350
OPENJDK_TARGET_CPU_JLI="amd64"
351+
elif test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
352+
OPENJDK_TARGET_CPU_JLI="mips64el"
334353
fi
335354
# Now setup the -D flags for building libjli.
336355
OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'"
@@ -343,6 +362,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
343362
elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then
344363
OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
345364
fi
365+
if test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
366+
OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"mips32el\"' -DLIBARCH64NAME='\"mips64el\"'"
367+
fi
346368
AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS)
347369
348370
# Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
@@ -556,3 +578,46 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
556578
AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)])
557579
fi
558580
])
581+
582+
AC_DEFUN([GET_BUILDER_AND_HOST_DATA],
583+
[
584+
BUILDER_NAME="$build_os"
585+
BUILDER_ID="Custom build ($(date))"
586+
if test -f /etc/issue; then
587+
etc_issue_info=`cat /etc/issue`
588+
if test -n "$etc_issue_info"; then
589+
BUILDER_NAME=`cat /etc/issue | head -n 1 | cut -d " " -f 1`
590+
fi
591+
fi
592+
if test -f /etc/redhat-release; then
593+
etc_issue_info=`cat /etc/redhat-release`
594+
if test -n "$etc_issue_info"; then
595+
BUILDER_NAME=`cat /etc/redhat-release | head -n 1 | cut -d " " -f 1`
596+
fi
597+
fi
598+
if test -f /etc/neokylin-release; then
599+
etc_issue_info=`cat /etc/neokylin-release`
600+
if test -n "$etc_issue_info"; then
601+
BUILDER_NAME=`cat /etc/neokylin-release | head -n 1 | cut -d " " -f 1`
602+
fi
603+
fi
604+
if test -z "$BUILDER_NAME"; then
605+
BUILDER_NAME="unknown"
606+
fi
607+
BUILDER_NAME=`echo $BUILDER_NAME | sed -r "s/-//g"`
608+
if test -n "$OPENJDK_TARGET_CPU_OSARCH"; then
609+
HOST_NAME="$OPENJDK_TARGET_CPU_OSARCH"
610+
else
611+
HOST_NAME="unknown"
612+
fi
613+
if test -f "/usr/bin/cpp"; then
614+
# gcc_with_arch_info=`gcc -v 2>&1 | grep '\-\-with-arch=' | sed 's/.*--with-arch=//;s/ .*$//'`
615+
gcc_with_arch_info=`cpp -dM /dev/null | grep '\<_MIPS_ARCH\>' | sed 's/^#define _MIPS_ARCH "//;s/"$//'`
616+
if test -n "$gcc_with_arch_info"; then
617+
HOST_NAME="$gcc_with_arch_info"
618+
fi
619+
fi
620+
AC_SUBST(BUILDER_ID)
621+
AC_SUBST(BUILDER_NAME)
622+
AC_SUBST(HOST_NAME)
623+
])

common/autoconf/spec.gmk.in

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
# questions.
2424
#
2525

26+
#
27+
# This file has been modified by Loongson Technology in 2024. These
28+
# modifications are Copyright (c) 2018, 2024, Loongson Technology, and are made
29+
# available on the same license terms set forth above.
30+
#
31+
2632
# Configured @DATE_WHEN_CONFIGURED@ to build
2733
# for target system @OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU@
2834
# (called @OPENJDK_TARGET_AUTOCONF_NAME@ by autoconf)
@@ -219,6 +225,23 @@ else
219225
endif
220226
JRE_RELEASE_VERSION:=$(FULL_VERSION)
221227

228+
# Build OS and host values for use in Loongson OpenJDK release
229+
BUILDER_ID:=@BUILDER_ID@
230+
BUILDER_NAME:=@BUILDER_NAME@
231+
HOST_NAME:=@HOST_NAME@
232+
233+
# Loongson OpenJDK Version info
234+
VER=8.1.21
235+
ifeq ($(HOST_NAME), )
236+
HOST_NAME=unknown
237+
endif
238+
ifeq ($(BUILDER_NAME), )
239+
BUILDER_NAME=unknown
240+
endif
241+
HOST_NAME_STRING=-$(HOST_NAME)
242+
BUILDER_NAME_STRING=-$(BUILDER_NAME)
243+
LOONGSON_RUNTIME_NAME=Loongson $(VER)$(HOST_NAME_STRING)$(BUILDER_NAME_STRING)
244+
222245
# How to compile the code: release, fastdebug or slowdebug
223246
DEBUG_LEVEL:=@DEBUG_LEVEL@
224247

hotspot/agent/make/saenv.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
#
2424
#
2525

26+
#
27+
# This file has been modified by Loongson Technology in 2020. These
28+
# modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made
29+
# available on the same license terms set forth above.
30+
#
31+
2632
# This file sets common environment variables for all SA scripts
2733

2834
OS=`uname`
@@ -42,6 +48,14 @@ if [ "$OS" = "Linux" ]; then
4248
SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64
4349
OPTIONS="-Dsa.library.path=$SA_LIBPATH"
4450
CPU=amd64
51+
elif [ "$ARCH" = "mips64" ] ; then
52+
SA_LIBPATH=$STARTDIR/../src/os/linux/mips:$STARTDIR/linux/mips
53+
OPTIONS="-Dsa.library.path=$SA_LIBPATH"
54+
CPU=mips
55+
elif [ "$ARCH" = "loongarch64" ] ; then
56+
SA_LIBPATH=$STARTDIR/../src/os/linux/loongarch64:$STARTDIR/linux/loongarch64
57+
OPTIONS="-Dsa.library.path=$SA_LIBPATH"
58+
CPU=loongarch64
4559
else
4660
SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386
4761
OPTIONS="-Dsa.library.path=$SA_LIBPATH"

0 commit comments

Comments
 (0)