Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8255040: Replace __sync_add_and_fetch with __atomic_add_fetch to avoid build errors with clang #803

Closed
wants to merge 1 commit into from

Conversation

@DamonFool
Copy link
Member

@DamonFool DamonFool commented Oct 22, 2020

Hi all,

It's time to replace __sync_add_and_fetch with __atomic_add_fetch to avoid build errors.

After JDK-8252221, build errors with clang were observed [1] due to the use of __sync_add_and_fetch, which is legacy and will be deprecated in the future.
It can be reproduced by building macos-x86-zero or linux-x86-zero with clang.

The fix was prepared by learning from aarch64's implementation [2].
Please review it.

Thanks
Best regards,
Jie

[1] https://bugs.openjdk.java.net/browse/JDK-8255040
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp#L39


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x32 Linux x64 Windows x64 macOS x64
Build ✔️ (1/1 passed) ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) (1/9 failed) ✔️ (9/9 passed)

Failed test task

Issue

  • JDK-8255040: Replace __sync_add_and_fetch with __atomic_add_fetch to avoid build errors with clang

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/803/head:pull/803
$ git checkout pull/803

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 22, 2020

👋 Welcome back jiefu! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Oct 22, 2020

/issue add JDK-8255040
/test
/label add hotspot-runtime
/cc hotspot-runtime

Loading

@openjdk openjdk bot changed the title Replace __sync_add_and_fetch with __atomic_add_fetch to avoid build errors with clang 8255040: Replace __sync_add_and_fetch with __atomic_add_fetch to avoid build errors with clang Oct 22, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Oct 22, 2020

@DamonFool The primary solved issue for a PR is set through the PR title. Since the current title does not contain an issue reference, it will now be updated.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Oct 22, 2020

@DamonFool
The hotspot-runtime label was successfully added.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Oct 22, 2020

@DamonFool The hotspot-runtime label was already applied.

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 22, 2020

Webrevs

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Oct 26, 2020

This bug was exposed after JDK-8252221.
Hope the author and reviewers of JDK-8252221 ( @amitdpawar , @tschatzl and @kimbarrett ) can first take a look at this.
Thanks.

Loading

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Hi Jie,

LGTM.

Thanks,
David

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Oct 27, 2020

@DamonFool This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8255040: Replace __sync_add_and_fetch with __atomic_add_fetch to avoid build errors with clang

Reviewed-by: dholmes, kbarrett

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 57 new commits pushed to the master branch:

  • bcdeeaa: 8199054: Test javax/swing/UIDefaults/8149879/InternalResourceBundle.java is unstable
  • dee31d0: 8167355: [macos 10.12] Timeout in javax/swing/JTextArea/TextViewOOM/TextViewOOM.java
  • abdbbe3: 8254370: Update the classes in the java.awt.color package
  • 8ca59c9: 8255206: [macos] LicenseTest fails on macOS 11
  • ca8bba6: 8238263: Create at-requires mechanism for containers
  • a7fa1b7: 8251994: VM crashed running TestComplexAddrExpr.java test with -XX:UseAVX=X
  • b498433: 8254825: Monitoring available clipboard formats should be done via new Windows APIs
  • de05b00: 8255365: Problem list failing client manual tests
  • 49c4978: 8060202: [macosx] Test closed/java/awt/Choice/GetSizeTest/GetSizeTest fails only in MacOSX(10.10)
  • 2b47a58: 8028281: [TEST_BUG] [macosx] javax/swing/JTabbedPane/7024235/Test7024235.java fails
  • ... and 47 more: https://git.openjdk.java.net/jdk/compare/211bb62a90bb8d9dd24b2907b7763641373a5dd4...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

Loading

@openjdk openjdk bot added the ready label Oct 27, 2020
Copy link

@kimbarrett kimbarrett left a comment

Looks good.

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Oct 27, 2020

Thanks @dholmes-ora and @kimbarrett for your review.
Will push it later.

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Oct 27, 2020

/integrate

Loading

@openjdk openjdk bot closed this Oct 27, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 27, 2020
@DamonFool DamonFool deleted the JDK-8255040 branch Oct 27, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Oct 27, 2020

@DamonFool Since your change was applied there have been 57 commits pushed to the master branch:

  • bcdeeaa: 8199054: Test javax/swing/UIDefaults/8149879/InternalResourceBundle.java is unstable
  • dee31d0: 8167355: [macos 10.12] Timeout in javax/swing/JTextArea/TextViewOOM/TextViewOOM.java
  • abdbbe3: 8254370: Update the classes in the java.awt.color package
  • 8ca59c9: 8255206: [macos] LicenseTest fails on macOS 11
  • ca8bba6: 8238263: Create at-requires mechanism for containers
  • a7fa1b7: 8251994: VM crashed running TestComplexAddrExpr.java test with -XX:UseAVX=X
  • b498433: 8254825: Monitoring available clipboard formats should be done via new Windows APIs
  • de05b00: 8255365: Problem list failing client manual tests
  • 49c4978: 8060202: [macosx] Test closed/java/awt/Choice/GetSizeTest/GetSizeTest fails only in MacOSX(10.10)
  • 2b47a58: 8028281: [TEST_BUG] [macosx] javax/swing/JTabbedPane/7024235/Test7024235.java fails
  • ... and 47 more: https://git.openjdk.java.net/jdk/compare/211bb62a90bb8d9dd24b2907b7763641373a5dd4...master

Your commit was automatically rebased without conflicts.

Pushed as commit d735f91.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants