Skip to content

Commit d2ff851

Browse files
Merge branch 'master' into 8311530-depr-jsobject
2 parents c3ee6ad + 63e611c commit d2ff851

File tree

1,166 files changed

+160802
-12371
lines changed

Some content is hidden

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

1,166 files changed

+160802
-12371
lines changed

.github/workflows/build-cross-compile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- target-cpu: riscv64
8585
gnu-arch: riscv64
8686
debian-arch: riscv64
87-
debian-repository: https://httpredir.debian.org/debian/
87+
debian-repository: https://snapshot.debian.org/archive/debian/20240228T034848Z/
8888
debian-version: sid
8989
tolerate-sysroot-errors: true
9090

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ jobs:
384384
- build-windows-aarch64
385385
- test-linux-x64
386386
- test-macos-x64
387+
- test-macos-aarch64
387388
- test-windows-x64
388389

389390
steps:

make/Main.gmk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,10 @@ $(eval $(call SetupTarget, update-build-docs, \
568568
MAKEFILE := UpdateBuildDocs, \
569569
))
570570

571+
$(eval $(call SetupTarget, update-sleef-source, \
572+
MAKEFILE := UpdateSleefSource, \
573+
))
574+
571575
$(eval $(call SetupTarget, update-x11wrappers, \
572576
MAKEFILE := UpdateX11Wrappers, \
573577
DEPS := java.base-copy buildtools-jdk, \

make/UpdateSleefSource.gmk

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
#
2+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation. Oracle designates this
8+
# particular file as subject to the "Classpath" exception as provided
9+
# by Oracle in the LICENSE file that accompanied this code.
10+
#
11+
# This code is distributed in the hope that it will be useful, but WITHOUT
12+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
# version 2 for more details (a copy is included in the LICENSE file that
15+
# accompanied this code).
16+
#
17+
# You should have received a copy of the GNU General Public License version
18+
# 2 along with this work; if not, write to the Free Software Foundation,
19+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
#
21+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
# or visit www.oracle.com if you need additional information or have any
23+
# questions.
24+
#
25+
26+
################################################################################
27+
28+
default: all
29+
30+
include $(SPEC)
31+
include MakeBase.gmk
32+
33+
include CopyFiles.gmk
34+
include Execute.gmk
35+
36+
################################################################################
37+
# This file is responsible for updating the generated sleef source code files
38+
# that are checked in to the JDK repo, and that are actually used when building.
39+
# This target needs to be re-run every time the source code of libsleef is
40+
# updated from upstream.
41+
################################################################################
42+
43+
ifneq ($(COMPILE_TYPE), cross)
44+
$(error Only cross-compilation of libsleef is currently supported)
45+
endif
46+
47+
ifeq ($(CMAKE), )
48+
$(error CMake not found. Please install cmake and rerun configure)
49+
endif
50+
51+
ifneq ($(OPENJDK_BUILD_OS), linux)
52+
$(error This target is only supported on linux)
53+
endif
54+
55+
SLEEF_SUPPORT_DIR := $(MAKESUPPORT_OUTPUTDIR)/sleef
56+
SLEEF_SOURCE_BASE_DIR := $(TOPDIR)/src/jdk.incubator.vector/linux/native/libsleef
57+
SLEEF_SOURCE_DIR := $(SLEEF_SOURCE_BASE_DIR)/upstream
58+
SLEEF_TARGET_DIR := $(SLEEF_SOURCE_BASE_DIR)/generated
59+
SLEEF_NATIVE_BUILD_DIR := $(SLEEF_SUPPORT_DIR)/native
60+
SLEEF_CROSS_BUILD_DIR := $(SLEEF_SUPPORT_DIR)/cross
61+
62+
ifeq ($(OPENJDK_TARGET_CPU), aarch64)
63+
CROSS_COMPILATION_FILENAMES := sleefinline_advsimd.h sleefinline_sve.h
64+
EXTRA_CROSS_OPTIONS := -DSLEEF_ENFORCE_SVE=TRUE
65+
else ifeq ($(OPENJDK_TARGET_CPU), riscv64)
66+
CROSS_COMPILATION_FILENAMES := sleefinline_rvvm1.h
67+
EXTRA_CROSS_OPTIONS := -DSLEEF_ENFORCE_RVVM1=TRUE
68+
else
69+
$(error Unsupported platform)
70+
endif
71+
CROSS_COMPILATION_SRC_FILES := $(addprefix $(SLEEF_CROSS_BUILD_DIR)/include/, \
72+
$(CROSS_COMPILATION_FILENAMES))
73+
74+
ifeq ($(TOOLCHAIN_TYPE), clang)
75+
SLEEF_TOOLCHAIN_TYPE := llvm
76+
else
77+
SLEEF_TOOLCHAIN_TYPE := $(TOOLCHAIN_TYPE)
78+
endif
79+
80+
SLEEF_CMAKE_FILE := toolchains/$(OPENJDK_TARGET_CPU)-$(SLEEF_TOOLCHAIN_TYPE).cmake
81+
82+
# We need to run CMake twice, first using it to configure the build, and then
83+
# to actually build; and we need to do this twice, once for a native build
84+
# and once for the cross-compilation build.
85+
86+
$(eval $(call SetupExecute, sleef_native_config, \
87+
INFO := Configuring native sleef build, \
88+
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
89+
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \
90+
$(SLEEF_NATIVE_BUILD_DIR), \
91+
))
92+
93+
TARGETS := $(sleef_native_config)
94+
95+
$(eval $(call SetupExecute, sleef_native_build, \
96+
INFO := Building native sleef, \
97+
DEPS := $(sleef_native_config), \
98+
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
99+
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \
100+
$(SLEEF_NATIVE_BUILD_DIR) -j, \
101+
))
102+
103+
TARGETS := $(sleef_native_build)
104+
105+
$(eval $(call SetupExecute, sleef_cross_config, \
106+
INFO := Configuring cross-compiling sleef build, \
107+
DEPS := $(sleef_native_build), \
108+
OUTPUT_DIR := $(SLEEF_CROSS_BUILD_DIR), \
109+
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \
110+
$(SLEEF_CROSS_BUILD_DIR) \
111+
-DCMAKE_C_COMPILER=$(CC) \
112+
-DCMAKE_TOOLCHAIN_FILE=$(SLEEF_CMAKE_FILE) \
113+
-DNATIVE_BUILD_DIR=$(SLEEF_NATIVE_BUILD_DIR) \
114+
-DSLEEF_BUILD_INLINE_HEADERS=TRUE \
115+
$(EXTRA_CROSS_OPTIONS), \
116+
))
117+
118+
TARGETS := $(sleef_cross_config)
119+
120+
$(eval $(call SetupExecute, sleef_cross_build, \
121+
INFO := Building cross-compiling sleef, \
122+
DEPS := $(sleef_cross_config), \
123+
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
124+
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \
125+
$(SLEEF_CROSS_BUILD_DIR) -j, \
126+
))
127+
128+
TARGETS := $(sleef_cross_build)
129+
130+
$(CROSS_COMPILATION_SRC_FILES): $(sleef_cross_build)
131+
132+
# Finally, copy the generated files (and one needed static file) into our
133+
# target directory.
134+
135+
$(eval $(call SetupCopyFiles, copy_static_sleef_source, \
136+
FILES := $(SLEEF_SOURCE_DIR)/src/common/misc.h, \
137+
DEST := $(SLEEF_TARGET_DIR), \
138+
))
139+
140+
TARGETS := $(copy_static_sleef_source)
141+
142+
$(eval $(call SetupCopyFiles, copy_generated_sleef_source, \
143+
FILES := $(CROSS_COMPILATION_SRC_FILES), \
144+
DEST := $(SLEEF_TARGET_DIR), \
145+
))
146+
147+
TARGETS := $(copy_generated_sleef_source)
148+
149+
################################################################################
150+
151+
all: $(TARGETS)
152+
153+
.PHONY: all default

make/autoconf/basic_tools.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
9999
UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
100100
101101
# Optional tools, we can do without them
102+
UTIL_LOOKUP_PROGS(CMAKE, cmake)
102103
UTIL_LOOKUP_PROGS(DF, df)
103104
UTIL_LOOKUP_PROGS(GIT, git)
104105
UTIL_LOOKUP_PROGS(NICE, nice)

make/autoconf/spec.gmk.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ CCACHE := @CCACHE@
719719
# CD is going away, but remains to cater for legacy makefiles.
720720
CD := cd
721721
CHMOD := @CHMOD@
722+
CMAKE := @CMAKE@
722723
CODESIGN := @CODESIGN@
723724
CP := @CP@
724725
CUT := @CUT@

make/common/modules/LauncherCommon.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ define SetupBuildLauncherBody
7474
endif
7575

7676
ifneq ($$($1_MAIN_CLASS), )
77-
$1_JAVA_ARGS += -ms8m
77+
$1_JAVA_ARGS += -Xms8m
7878
$1_LAUNCHER_CLASS := -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS)
7979
endif
8080

make/devkit/createAutoconfBundle.sh

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -e
22
#
3-
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -25,50 +25,70 @@
2525
#
2626

2727
# Create a bundle in the current directory, containing what's needed to run
28-
# the 'autoconf' program by the OpenJDK build.
28+
# the 'autoconf' program by the OpenJDK build. To override TARGET_PLATFORM
29+
# just set the variable before running this script.
2930

3031
# Autoconf depends on m4, so download and build that first.
3132
AUTOCONF_VERSION=2.69
3233
M4_VERSION=1.4.18
3334

3435
PACKAGE_VERSION=1.0.1
35-
TARGET_PLATFORM=linux_x86
36+
case `uname -s` in
37+
Darwin)
38+
os=macosx
39+
;;
40+
Linux)
41+
os=linux
42+
;;
43+
CYGWIN*)
44+
os=cygwin
45+
;;
46+
esac
47+
case `uname -m` in
48+
arm64|aarch64)
49+
arch=aarch64
50+
;;
51+
amd64|x86_64|x64)
52+
arch=x64
53+
;;
54+
esac
55+
TARGET_PLATFORM=${TARGET_PLATFORM:="${os}_${arch}"}
56+
3657
MODULE_NAME=autoconf-$TARGET_PLATFORM-$AUTOCONF_VERSION+$PACKAGE_VERSION
3758
BUNDLE_NAME=$MODULE_NAME.tar.gz
3859

39-
TMPDIR=`mktemp -d -t autoconfbundle-XXXX`
40-
trap "rm -rf \"$TMPDIR\"" EXIT
60+
SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
61+
OUTPUT_ROOT="${SCRIPT_DIR}/../../build/autoconf"
4162

42-
ORIG_DIR=`pwd`
43-
cd $TMPDIR
44-
OUTPUT_DIR=$TMPDIR/$MODULE_NAME
45-
mkdir -p $OUTPUT_DIR/usr
63+
cd $OUTPUT_ROOT
64+
IMAGE_DIR=$OUTPUT_ROOT/$MODULE_NAME
65+
mkdir -p $IMAGE_DIR/usr
4666

4767
# Download and build m4
4868

4969
if test "x$TARGET_PLATFORM" = xcygwin_x64; then
5070
# On cygwin 64-bit, just copy the cygwin .exe file
51-
mkdir -p $OUTPUT_DIR/usr/bin
52-
cp /usr/bin/m4 $OUTPUT_DIR/usr/bin
71+
mkdir -p $IMAGE_DIR/usr/bin
72+
cp /usr/bin/m4 $IMAGE_DIR/usr/bin
5373
elif test "x$TARGET_PLATFORM" = xcygwin_x86; then
5474
# On cygwin 32-bit, just copy the cygwin .exe file
55-
mkdir -p $OUTPUT_DIR/usr/bin
56-
cp /usr/bin/m4 $OUTPUT_DIR/usr/bin
75+
mkdir -p $IMAGE_DIR/usr/bin
76+
cp /usr/bin/m4 $IMAGE_DIR/usr/bin
5777
elif test "x$TARGET_PLATFORM" = xlinux_x64; then
5878
M4_VERSION=1.4.13-5
5979
wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm
60-
cd $OUTPUT_DIR
61-
rpm2cpio ../m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i
80+
cd $IMAGE_DIR
81+
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i
6282
elif test "x$TARGET_PLATFORM" = xlinux_x86; then
6383
M4_VERSION=1.4.13-5
6484
wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/i386/getPackage/m4-$M4_VERSION.el6.i686.rpm
65-
cd $OUTPUT_DIR
66-
rpm2cpio ../m4-$M4_VERSION.el6.i686.rpm | cpio -d -i
85+
cd $IMAGE_DIR
86+
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.i686.rpm | cpio -d -i
6787
else
6888
wget https://ftp.gnu.org/gnu/m4/m4-$M4_VERSION.tar.gz
6989
tar xzf m4-$M4_VERSION.tar.gz
7090
cd m4-$M4_VERSION
71-
./configure --prefix=$OUTPUT_DIR/usr
91+
./configure --prefix=$IMAGE_DIR/usr CFLAGS="-w -Wno-everything"
7292
make
7393
make install
7494
cd ..
@@ -79,15 +99,14 @@ fi
7999
wget https://ftp.gnu.org/gnu/autoconf/autoconf-$AUTOCONF_VERSION.tar.gz
80100
tar xzf autoconf-$AUTOCONF_VERSION.tar.gz
81101
cd autoconf-$AUTOCONF_VERSION
82-
./configure --prefix=$OUTPUT_DIR/usr M4=$OUTPUT_DIR/usr/bin/m4
102+
./configure --prefix=$IMAGE_DIR/usr M4=$IMAGE_DIR/usr/bin/m4
83103
make
84104
make install
85105
cd ..
86106

87-
perl -pi -e "s!$OUTPUT_DIR/!./!" $OUTPUT_DIR/usr/bin/auto* $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg
88-
cp $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg $OUTPUT_DIR/autom4te.cfg
107+
perl -pi -e "s!$IMAGE_DIR/!./!" $IMAGE_DIR/usr/bin/auto* $IMAGE_DIR/usr/share/autoconf/autom4te.cfg
89108

90-
cat > $OUTPUT_DIR/autoconf << EOF
109+
cat > $IMAGE_DIR/autoconf << EOF
91110
#!/bin/bash
92111
# Get an absolute path to this script
93112
this_script_dir=\`dirname \$0\`
@@ -100,17 +119,10 @@ export AUTOHEADER="\$this_script_dir/usr/bin/autoheader"
100119
export AC_MACRODIR="\$this_script_dir/usr/share/autoconf"
101120
export autom4te_perllibdir="\$this_script_dir/usr/share/autoconf"
102121
103-
autom4te_cfg=\$this_script_dir/usr/share/autoconf/autom4te.cfg
104-
cp \$this_script_dir/autom4te.cfg \$autom4te_cfg
105-
106-
echo 'begin-language: "M4sugar"' >> \$autom4te_cfg
107-
echo "args: --prepend-include '"\$this_script_dir/usr/share/autoconf"'" >> \$autom4te_cfg
108-
echo 'end-language: "M4sugar"' >> \$autom4te_cfg
122+
PREPEND_INCLUDE="--prepend-include \$this_script_dir/usr/share/autoconf"
109123
110-
exec \$this_script_dir/usr/bin/autoconf "\$@"
124+
exec \$this_script_dir/usr/bin/autoconf \$PREPEND_INCLUDE "\$@"
111125
EOF
112-
chmod +x $OUTPUT_DIR/autoconf
113-
cd $OUTPUT_DIR
114-
tar -cvzf ../$BUNDLE_NAME *
115-
cd ..
116-
cp $BUNDLE_NAME "$ORIG_DIR"
126+
chmod +x $IMAGE_DIR/autoconf
127+
cd $IMAGE_DIR
128+
tar -cvzf $OUTPUT_ROOT/$BUNDLE_NAME *

0 commit comments

Comments
 (0)