Skip to content

Commit 2101e68

Browse files
authored
Merge pull request #250 from ibmruntimes/openj9
Merge jdk-17.0.9+5 to 0.41
2 parents 74e31f4 + 1af4b9b commit 2101e68

File tree

32 files changed

+1371
-96
lines changed

32 files changed

+1371
-96
lines changed

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

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ on:
3131
gcc-major-version:
3232
required: true
3333
type: string
34-
apt-gcc-version:
35-
required: true
36-
type: string
37-
apt-gcc-cross-version:
38-
required: true
39-
type: string
4034
extra-conf-options:
4135
required: false
4236
type: string
@@ -66,27 +60,27 @@ jobs:
6660
gnu-arch: aarch64
6761
debian-arch: arm64
6862
debian-repository: https://httpredir.debian.org/debian/
69-
debian-version: buster
63+
debian-version: bullseye
7064
- target-cpu: arm
7165
gnu-arch: arm
7266
debian-arch: armhf
7367
debian-repository: https://httpredir.debian.org/debian/
74-
debian-version: buster
68+
debian-version: bullseye
7569
gnu-abi: eabihf
7670
- target-cpu: s390x
7771
gnu-arch: s390x
7872
debian-arch: s390x
7973
debian-repository: https://httpredir.debian.org/debian/
80-
debian-version: buster
74+
debian-version: bullseye
8175
- target-cpu: ppc64le
8276
gnu-arch: powerpc64le
8377
debian-arch: ppc64el
8478
debian-repository: https://httpredir.debian.org/debian/
85-
debian-version: buster
79+
debian-version: bullseye
8680
- target-cpu: riscv64
8781
gnu-arch: riscv64
8882
debian-arch: riscv64
89-
debian-repository: https://deb.debian.org/debian-ports
83+
debian-repository: https://httpredir.debian.org/debian/
9084
debian-version: sid
9185

9286
steps:
@@ -113,10 +107,10 @@ jobs:
113107
sudo apt-get update
114108
sudo apt-get install --only-upgrade apt
115109
sudo apt-get install \
116-
gcc-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
117-
g++-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
118-
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
119-
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
110+
gcc-${{ inputs.gcc-major-version }} \
111+
g++-${{ inputs.gcc-major-version }} \
112+
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
113+
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
120114
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
121115
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
122116
@@ -136,7 +130,7 @@ jobs:
136130
sudo debootstrap
137131
--arch=${{ matrix.debian-arch }}
138132
--verbose
139-
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev
133+
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
140134
--resolve-deps
141135
--variant=minbase
142136
${{ matrix.debian-version }}

.github/workflows/build-linux.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ on:
4949
required: false
5050
type: string
5151
default: ''
52-
apt-gcc-version:
53-
required: true
54-
type: string
5552
apt-architecture:
5653
required: false
5754
type: string
@@ -114,7 +111,7 @@ jobs:
114111
fi
115112
sudo apt-get update
116113
sudo apt-get install --only-upgrade apt
117-
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
114+
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
118115
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
119116
120117
- name: 'Configure'

.github/workflows/main.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ jobs:
128128
with:
129129
platform: linux-x64
130130
gcc-major-version: '10'
131-
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
132131
configure-arguments: ${{ github.event.inputs.configure-arguments }}
133132
make-arguments: ${{ github.event.inputs.make-arguments }}
134133
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
@@ -142,11 +141,10 @@ jobs:
142141
platform: linux-x86
143142
gcc-major-version: '10'
144143
gcc-package-suffix: '-multilib'
145-
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
146144
apt-architecture: 'i386'
147145
# Some multilib libraries do not have proper inter-dependencies, so we have to
148146
# install their dependencies manually.
149-
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386'
147+
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386'
150148
extra-conf-options: '--with-target-bits=32'
151149
configure-arguments: ${{ github.event.inputs.configure-arguments }}
152150
make-arguments: ${{ github.event.inputs.make-arguments }}
@@ -161,7 +159,6 @@ jobs:
161159
make-target: 'hotspot'
162160
debug-levels: '[ "debug" ]'
163161
gcc-major-version: '10'
164-
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
165162
extra-conf-options: '--disable-precompiled-headers'
166163
configure-arguments: ${{ github.event.inputs.configure-arguments }}
167164
make-arguments: ${{ github.event.inputs.make-arguments }}
@@ -176,7 +173,6 @@ jobs:
176173
make-target: 'hotspot'
177174
debug-levels: '[ "debug" ]'
178175
gcc-major-version: '10'
179-
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
180176
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
181177
configure-arguments: ${{ github.event.inputs.configure-arguments }}
182178
make-arguments: ${{ github.event.inputs.make-arguments }}
@@ -191,7 +187,6 @@ jobs:
191187
make-target: 'hotspot'
192188
debug-levels: '[ "debug" ]'
193189
gcc-major-version: '10'
194-
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
195190
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
196191
configure-arguments: ${{ github.event.inputs.configure-arguments }}
197192
make-arguments: ${{ github.event.inputs.make-arguments }}
@@ -207,7 +202,6 @@ jobs:
207202
# Technically this is not the "debug" level, but we can't inject a new matrix state for just this job
208203
debug-levels: '[ "debug" ]'
209204
gcc-major-version: '10'
210-
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
211205
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
212206
configure-arguments: ${{ github.event.inputs.configure-arguments }}
213207
make-arguments: ${{ github.event.inputs.make-arguments }}
@@ -221,8 +215,6 @@ jobs:
221215
uses: ./.github/workflows/build-cross-compile.yml
222216
with:
223217
gcc-major-version: '10'
224-
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
225-
apt-gcc-cross-version: '10.5.0-1ubuntu1~22.04cross1'
226218
configure-arguments: ${{ github.event.inputs.configure-arguments }}
227219
make-arguments: ${{ github.event.inputs.make-arguments }}
228220
if: needs.select.outputs.linux-cross-compile == 'true'

closed/openjdk-tag.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
OPENJDK_TAG := jdk-17.0.9+4
1+
OPENJDK_TAG := jdk-17.0.9+5

make/autoconf/jdk-options.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
508508
[
509509
UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto,
510510
RESULT: BUILD_FAILURE_HANDLER,
511-
DESC: [enable keeping of packaged modules in jdk image],
511+
DESC: [enable building of the jtreg failure handler],
512512
DEFAULT_DESC: [enabled if jtreg is present],
513513
CHECKING_MSG: [if the jtreg failure handler should be built],
514514
CHECK_AVAILABLE: [

src/java.base/macosx/native/libjava/ProcessHandleImpl_macosx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
272272
mib[2] = pid;
273273
size = (size_t) maxargs;
274274
if (sysctl(mib, 3, args, &size, NULL, 0) == -1) {
275-
if (errno != EINVAL) {
275+
if (errno != EINVAL && errno != EIO) {
276+
// If the pid is invalid, the information returned is empty and no exception
276277
JNU_ThrowByNameWithLastError(env,
277278
"java/lang/RuntimeException", "sysctl failed");
278279
}
@@ -300,4 +301,3 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
300301
// Free the arg buffer
301302
free(args);
302303
}
303-

src/java.base/share/classes/sun/net/util/SocketExceptions.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -67,16 +67,7 @@ public static IOException of(IOException e, SocketAddress addr) {
6767
}
6868

6969
private static IOException ofInet(IOException e, InetSocketAddress addr) {
70-
int port = addr.getPort();
71-
String host = addr.getHostString();
72-
StringBuilder sb = new StringBuilder();
73-
sb.append(e.getMessage());
74-
sb.append(": ");
75-
sb.append(host);
76-
sb.append(':');
77-
sb.append(Integer.toString(port));
78-
String enhancedMsg = sb.toString();
79-
return create(e, enhancedMsg);
70+
return create(e, String.join(": ", e.getMessage(), addr.toString()));
8071
}
8172

8273
private static IOException ofUnixDomain(IOException e, UnixDomainSocketAddress addr) {

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import javax.print.attribute.standard.MediaSize;
4646
import javax.print.attribute.standard.MediaSizeName;
4747
import javax.print.attribute.standard.PageRanges;
48+
import javax.print.attribute.standard.Sides;
4849
import javax.print.attribute.Attribute;
4950

5051
import sun.java2d.*;
@@ -631,7 +632,8 @@ private PageFormat getPageFormat(int pageIndex) {
631632
} catch (Exception e) {
632633
return null;
633634
}
634-
return page;
635+
636+
return FlipPageFormat.flipPage(page);
635637
}
636638

637639
private Printable getPrintable(int pageIndex) {
@@ -683,6 +685,24 @@ private Rectangle2D getPageFormatArea(PageFormat page) {
683685
return pageFormatArea;
684686
}
685687

688+
private int getSides() {
689+
return (this.sidesAttr == null) ? -1 : this.sidesAttr.getValue();
690+
}
691+
692+
private void setSides(int sides) {
693+
if (attributes == null) {
694+
return;
695+
}
696+
697+
final Sides[] sidesTable = new Sides[] {Sides.ONE_SIDED, Sides.TWO_SIDED_LONG_EDGE, Sides.TWO_SIDED_SHORT_EDGE};
698+
699+
if (sides >= 0 && sides < sidesTable.length) {
700+
Sides s = sidesTable[sides];
701+
attributes.add(s);
702+
this.sidesAttr = s;
703+
}
704+
}
705+
686706
private boolean cancelCheck() {
687707
// This is called from the native side.
688708

@@ -731,7 +751,7 @@ private void printToPathGraphics( final PeekGraphics graphics, // Always an a
731751
Graphics2D pathGraphics = new CPrinterGraphics(delegate, printerJob); // Just stores delegate into an ivar
732752
Rectangle2D pageFormatArea = getPageFormatArea(page);
733753
initPrinterGraphics(pathGraphics, pageFormatArea);
734-
painter.print(pathGraphics, page, pageIndex);
754+
painter.print(pathGraphics, FlipPageFormat.getOriginal(page), pageIndex);
735755
delegate.dispose();
736756
delegate = null;
737757
} catch (PrinterException pe) { throw new java.lang.reflect.UndeclaredThrowableException(pe); }
@@ -758,7 +778,7 @@ private Object[] getPageformatPrintablePeekgraphics(final int pageIndex) {
758778
Runnable r = new Runnable() { public void run() { synchronized(ret) {
759779
try {
760780
Pageable pageable = getPageable();
761-
PageFormat pageFormat = pageable.getPageFormat(pageIndex);
781+
PageFormat pageFormat = getPageFormat(pageIndex);
762782
if (pageFormat != null) {
763783
Printable printable = pageable.getPrintable(pageIndex);
764784
if (printable != null) {
@@ -871,4 +891,75 @@ protected MediaPrintableArea getDefaultPrintableArea(PageFormat page, double w,
871891
(float) (paper.getImageableHeight() / dpi),
872892
MediaPrintableArea.INCH);
873893
}
894+
895+
// MacOS NSPrintInfo class has one to one correspondence
896+
// between a paper size and its orientation.
897+
// NSPrintInfo with paper width less than height
898+
// has portrait orientation.
899+
// NSPrintInfo with paper width greater than height
900+
// has landscape orientation.
901+
// (w < h) <-> portrait
902+
// (w > h) <-> landscape
903+
//
904+
// Java PageFormat class has the following relation with NSPrintInfo:
905+
// 1. PageFormat:
906+
// page size: width < height
907+
// orientation: portrait
908+
// NSPrintInfo: width < height (portrait orientation)
909+
// 2. PageFormat:
910+
// page size: width < height
911+
// orientation: landscape
912+
// NSPrintInfo: width > height (landscape orientation)
913+
//
914+
// FlipPageFormat class establishes correspondence between
915+
// Java PageFormat class which page width is greater than height
916+
// with NSPrintInfo in the following way:
917+
// 3. PageFormat:
918+
// page size: width > height
919+
// orientation: portrait
920+
// FlipPageFormat
921+
// page size: width < height
922+
// orientation: landscape
923+
// NSPrintInfo: width > height (landscape orientation)
924+
// 4. PageFormat:
925+
// page size: width > height
926+
// orientation: landscape
927+
// FlipPageFormat
928+
// page size: width < height
929+
// orientation: portrait
930+
// NSPrintInfo: width < height (portrait orientation)
931+
//
932+
// FlipPageFormat preserves the original PageFormat class
933+
// to pass it to Printable.print(Graphics, PageFormat, int)
934+
// method overridden by a user.
935+
private static class FlipPageFormat extends PageFormat {
936+
937+
private final PageFormat original;
938+
939+
private FlipPageFormat(PageFormat original) {
940+
this.original = original;
941+
Paper paper = original.getPaper();
942+
Paper copyPaper = this.getPaper();
943+
copyPaper.setSize(paper.getHeight(), paper.getWidth());
944+
copyPaper.setImageableArea(
945+
paper.getImageableY(), paper.getImageableX(),
946+
paper.getImageableHeight(), paper.getImageableWidth());
947+
this.setPaper(copyPaper);
948+
this.setOrientation((original.getOrientation() == PageFormat.PORTRAIT)
949+
? PageFormat.LANDSCAPE
950+
: PageFormat.PORTRAIT);
951+
}
952+
953+
private static PageFormat getOriginal(PageFormat page) {
954+
return (page instanceof FlipPageFormat) ? ((FlipPageFormat) page).original : page;
955+
}
956+
957+
private static PageFormat flipPage(PageFormat page) {
958+
if (page == null) {
959+
return null;
960+
}
961+
Paper paper = page.getPaper();
962+
return (paper.getWidth() > paper.getHeight()) ? new FlipPageFormat(page) : page;
963+
}
964+
}
874965
}

0 commit comments

Comments
 (0)