Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8287917: System.loadLibrary does not work on Big Sur if JDK is built …
…with macOS SDK 10.15 and earlier

Reviewed-by: mchung
  • Loading branch information
Yoshiki Sato authored and Mandy Chung committed Jun 15, 2022
1 parent bbaeacb commit fe80721
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022, 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 @@ -39,7 +39,8 @@ class ClassLoaderHelper {
try {
major = Integer.parseInt(i < 0 ? osVersion : osVersion.substring(0, i));
} catch (NumberFormatException e) {}
hasDynamicLoaderCache = major >= 11;
// SDK 10.15 and earlier always reports 10.16 instead of 11.x.x
hasDynamicLoaderCache = major >= 11 || osVersion.equals("10.16");
}

private ClassLoaderHelper() {}
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, 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 @@ -42,6 +42,8 @@

public class LibraryFromCache {
public static void main(String[] args) throws IOException {
System.out.println("os.version = " + System.getProperty("os.version"));

String libname = args[0];
if (!systemHasLibrary(libname)) {
System.out.println("Test skipped. Library " + libname + " not found");
Expand Down

7 comments on commit fe80721

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmtd
Copy link

@jmtd jmtd commented on fe80721 Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on fe80721 Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmtd the backport was successfully created on the branch jmtd-backport-fe807217 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit fe807217 from the openjdk/jdk repository.

The commit being backported was authored by Yoshiki Sato on 15 Jun 2022 and was reviewed by Mandy Chung.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev jmtd-backport-fe807217:jmtd-backport-fe807217
$ git checkout jmtd-backport-fe807217
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev jmtd-backport-fe807217

@jmtd
Copy link

@jmtd jmtd commented on fe80721 Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on fe80721 Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmtd Could not automatically backport fe807217 to openjdk/jdk11u-dev due to conflicts in the following files:

  • src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java

To manually resolve these conflicts run the following commands in your personal fork of openjdk/jdk11u-dev:

$ git checkout -b jmtd-backport-fe807217
$ git fetch --no-tags https://git.openjdk.org/jdk fe807217a79753f84c00432e7451c17baa6645c5
$ git cherry-pick --no-commit fe807217a79753f84c00432e7451c17baa6645c5
$ # Resolve conflicts
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport fe807217a79753f84c00432e7451c17baa6645c5'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk11u-dev with the title Backport fe807217a79753f84c00432e7451c17baa6645c5.

@jmtd
Copy link

@jmtd jmtd commented on fe80721 Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u

@openjdk
Copy link

@openjdk openjdk bot commented on fe80721 Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmtd Could not automatically backport fe807217 to openjdk/jdk11u due to conflicts in the following files:

  • src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk11u. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk11u master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b jmtd-backport-fe807217

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk fe807217a79753f84c00432e7451c17baa6645c5

# Backport the commit
$ git cherry-pick --no-commit fe807217a79753f84c00432e7451c17baa6645c5
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport fe807217a79753f84c00432e7451c17baa6645c5'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk11u with the title Backport fe807217a79753f84c00432e7451c17baa6645c5.

Please sign in to comment.