Skip to content

Commit

Permalink
Merge pull request #250 from ibmruntimes/openj9
Browse files Browse the repository at this point in the history
Merge jdk-17.0.9+5 to 0.41
  • Loading branch information
JasonFengJ9 authored Sep 5, 2023
2 parents 74e31f4 + 1af4b9b commit 2101e68
Show file tree
Hide file tree
Showing 32 changed files with 1,371 additions and 96 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ on:
gcc-major-version:
required: true
type: string
apt-gcc-version:
required: true
type: string
apt-gcc-cross-version:
required: true
type: string
extra-conf-options:
required: false
type: string
Expand Down Expand Up @@ -66,27 +60,27 @@ jobs:
gnu-arch: aarch64
debian-arch: arm64
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
debian-version: bullseye
- target-cpu: arm
gnu-arch: arm
debian-arch: armhf
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
debian-version: bullseye
gnu-abi: eabihf
- target-cpu: s390x
gnu-arch: s390x
debian-arch: s390x
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
debian-version: bullseye
- target-cpu: ppc64le
gnu-arch: powerpc64le
debian-arch: ppc64el
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
debian-version: bullseye
- target-cpu: riscv64
gnu-arch: riscv64
debian-arch: riscv64
debian-repository: https://deb.debian.org/debian-ports
debian-repository: https://httpredir.debian.org/debian/
debian-version: sid

steps:
Expand All @@ -113,10 +107,10 @@ jobs:
sudo apt-get update
sudo apt-get install --only-upgrade apt
sudo apt-get install \
gcc-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
g++-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
gcc-${{ inputs.gcc-major-version }} \
g++-${{ inputs.gcc-major-version }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
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 }}
Expand All @@ -136,7 +130,7 @@ jobs:
sudo debootstrap
--arch=${{ matrix.debian-arch }}
--verbose
--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
--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
--resolve-deps
--variant=minbase
${{ matrix.debian-version }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ on:
required: false
type: string
default: ''
apt-gcc-version:
required: true
type: string
apt-architecture:
required: false
type: string
Expand Down Expand Up @@ -114,7 +111,7 @@ jobs:
fi
sudo apt-get update
sudo apt-get install --only-upgrade apt
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 }}
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 }}
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 }}
- name: 'Configure'
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ jobs:
with:
platform: linux-x64
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
Expand All @@ -142,11 +141,10 @@ jobs:
platform: linux-x86
gcc-major-version: '10'
gcc-package-suffix: '-multilib'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
apt-architecture: 'i386'
# Some multilib libraries do not have proper inter-dependencies, so we have to
# install their dependencies manually.
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386'
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386'
extra-conf-options: '--with-target-bits=32'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand All @@ -161,7 +159,6 @@ jobs:
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand All @@ -176,7 +173,6 @@ jobs:
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand All @@ -191,7 +187,6 @@ jobs:
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand All @@ -207,7 +202,6 @@ jobs:
# Technically this is not the "debug" level, but we can't inject a new matrix state for just this job
debug-levels: '[ "debug" ]'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand All @@ -221,8 +215,6 @@ jobs:
uses: ./.github/workflows/build-cross-compile.yml
with:
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
apt-gcc-cross-version: '10.5.0-1ubuntu1~22.04cross1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-cross-compile == 'true'
Expand Down
2 changes: 1 addition & 1 deletion closed/openjdk-tag.gmk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OPENJDK_TAG := jdk-17.0.9+4
OPENJDK_TAG := jdk-17.0.9+5
2 changes: 1 addition & 1 deletion make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
[
UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto,
RESULT: BUILD_FAILURE_HANDLER,
DESC: [enable keeping of packaged modules in jdk image],
DESC: [enable building of the jtreg failure handler],
DEFAULT_DESC: [enabled if jtreg is present],
CHECKING_MSG: [if the jtreg failure handler should be built],
CHECK_AVAILABLE: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
mib[2] = pid;
size = (size_t) maxargs;
if (sysctl(mib, 3, args, &size, NULL, 0) == -1) {
if (errno != EINVAL) {
if (errno != EINVAL && errno != EIO) {
// If the pid is invalid, the information returned is empty and no exception
JNU_ThrowByNameWithLastError(env,
"java/lang/RuntimeException", "sysctl failed");
}
Expand Down Expand Up @@ -300,4 +301,3 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
// Free the arg buffer
free(args);
}

13 changes: 2 additions & 11 deletions src/java.base/share/classes/sun/net/util/SocketExceptions.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -67,16 +67,7 @@ public static IOException of(IOException e, SocketAddress addr) {
}

private static IOException ofInet(IOException e, InetSocketAddress addr) {
int port = addr.getPort();
String host = addr.getHostString();
StringBuilder sb = new StringBuilder();
sb.append(e.getMessage());
sb.append(": ");
sb.append(host);
sb.append(':');
sb.append(Integer.toString(port));
String enhancedMsg = sb.toString();
return create(e, enhancedMsg);
return create(e, String.join(": ", e.getMessage(), addr.toString()));
}

private static IOException ofUnixDomain(IOException e, UnixDomainSocketAddress addr) {
Expand Down
97 changes: 94 additions & 3 deletions src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import javax.print.attribute.standard.MediaSize;
import javax.print.attribute.standard.MediaSizeName;
import javax.print.attribute.standard.PageRanges;
import javax.print.attribute.standard.Sides;
import javax.print.attribute.Attribute;

import sun.java2d.*;
Expand Down Expand Up @@ -631,7 +632,8 @@ private PageFormat getPageFormat(int pageIndex) {
} catch (Exception e) {
return null;
}
return page;

return FlipPageFormat.flipPage(page);
}

private Printable getPrintable(int pageIndex) {
Expand Down Expand Up @@ -683,6 +685,24 @@ private Rectangle2D getPageFormatArea(PageFormat page) {
return pageFormatArea;
}

private int getSides() {
return (this.sidesAttr == null) ? -1 : this.sidesAttr.getValue();
}

private void setSides(int sides) {
if (attributes == null) {
return;
}

final Sides[] sidesTable = new Sides[] {Sides.ONE_SIDED, Sides.TWO_SIDED_LONG_EDGE, Sides.TWO_SIDED_SHORT_EDGE};

if (sides >= 0 && sides < sidesTable.length) {
Sides s = sidesTable[sides];
attributes.add(s);
this.sidesAttr = s;
}
}

private boolean cancelCheck() {
// This is called from the native side.

Expand Down Expand Up @@ -731,7 +751,7 @@ private void printToPathGraphics( final PeekGraphics graphics, // Always an a
Graphics2D pathGraphics = new CPrinterGraphics(delegate, printerJob); // Just stores delegate into an ivar
Rectangle2D pageFormatArea = getPageFormatArea(page);
initPrinterGraphics(pathGraphics, pageFormatArea);
painter.print(pathGraphics, page, pageIndex);
painter.print(pathGraphics, FlipPageFormat.getOriginal(page), pageIndex);
delegate.dispose();
delegate = null;
} catch (PrinterException pe) { throw new java.lang.reflect.UndeclaredThrowableException(pe); }
Expand All @@ -758,7 +778,7 @@ private Object[] getPageformatPrintablePeekgraphics(final int pageIndex) {
Runnable r = new Runnable() { public void run() { synchronized(ret) {
try {
Pageable pageable = getPageable();
PageFormat pageFormat = pageable.getPageFormat(pageIndex);
PageFormat pageFormat = getPageFormat(pageIndex);
if (pageFormat != null) {
Printable printable = pageable.getPrintable(pageIndex);
if (printable != null) {
Expand Down Expand Up @@ -871,4 +891,75 @@ protected MediaPrintableArea getDefaultPrintableArea(PageFormat page, double w,
(float) (paper.getImageableHeight() / dpi),
MediaPrintableArea.INCH);
}

// MacOS NSPrintInfo class has one to one correspondence
// between a paper size and its orientation.
// NSPrintInfo with paper width less than height
// has portrait orientation.
// NSPrintInfo with paper width greater than height
// has landscape orientation.
// (w < h) <-> portrait
// (w > h) <-> landscape
//
// Java PageFormat class has the following relation with NSPrintInfo:
// 1. PageFormat:
// page size: width < height
// orientation: portrait
// NSPrintInfo: width < height (portrait orientation)
// 2. PageFormat:
// page size: width < height
// orientation: landscape
// NSPrintInfo: width > height (landscape orientation)
//
// FlipPageFormat class establishes correspondence between
// Java PageFormat class which page width is greater than height
// with NSPrintInfo in the following way:
// 3. PageFormat:
// page size: width > height
// orientation: portrait
// FlipPageFormat
// page size: width < height
// orientation: landscape
// NSPrintInfo: width > height (landscape orientation)
// 4. PageFormat:
// page size: width > height
// orientation: landscape
// FlipPageFormat
// page size: width < height
// orientation: portrait
// NSPrintInfo: width < height (portrait orientation)
//
// FlipPageFormat preserves the original PageFormat class
// to pass it to Printable.print(Graphics, PageFormat, int)
// method overridden by a user.
private static class FlipPageFormat extends PageFormat {

private final PageFormat original;

private FlipPageFormat(PageFormat original) {
this.original = original;
Paper paper = original.getPaper();
Paper copyPaper = this.getPaper();
copyPaper.setSize(paper.getHeight(), paper.getWidth());
copyPaper.setImageableArea(
paper.getImageableY(), paper.getImageableX(),
paper.getImageableHeight(), paper.getImageableWidth());
this.setPaper(copyPaper);
this.setOrientation((original.getOrientation() == PageFormat.PORTRAIT)
? PageFormat.LANDSCAPE
: PageFormat.PORTRAIT);
}

private static PageFormat getOriginal(PageFormat page) {
return (page instanceof FlipPageFormat) ? ((FlipPageFormat) page).original : page;
}

private static PageFormat flipPage(PageFormat page) {
if (page == null) {
return null;
}
Paper paper = page.getPaper();
return (paper.getWidth() > paper.getHeight()) ? new FlipPageFormat(page) : page;
}
}
}
Loading

0 comments on commit 2101e68

Please sign in to comment.