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

8300169: Build failure with clang-15 #12005

Closed
wants to merge 1 commit into from

Conversation

DamonFool
Copy link
Member

@DamonFool DamonFool commented Jan 14, 2023

Hi all,

Please review the fix for the build failure with clang-15.

  1. -Wbitwise-instead-of-logical
   1) src/hotspot/share/oops/generateOopMap.cpp          <--- fixed the warning
   2) src/hotspot/share/runtime/notificationThread.cpp   <--- keep the code and disable warnings
   3) src/hotspot/share/runtime/serviceThread.cpp        <--- keep the code and disable warnings
  1. -Wdeprecated-non-prototype (all the warnings are disabled)
   1) Mainly caused by files under `src/java.base/share/native/libzip/zlib/`  <--- keep the code and disable warnings
      It occurred while building LIBJLI, LIBZIP and LIBSPLASHSCREEN.

   2) While compiling src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c  <--- keep the code and disable warnings

   3) Caused by src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m  <--- fixed the warnings
  1. -Wdeprecated-builtins
   Caused by files under src/java.desktop/share/native/libharfbuzz/  <--- fixed the warnings

Ref: https://github.com/harfbuzz/harfbuzz/blob/main/src/hb-meta.hh#L202

  1. -Wgnu-folding-constant
   Caused by src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.m  <--- keep the code and disable warnings

Thanks.
Best regards,
Jie


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12005/head:pull/12005
$ git checkout pull/12005

Update a local copy of the PR:
$ git checkout pull/12005
$ git pull https://git.openjdk.org/jdk pull/12005/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12005

View PR using the GUI difftool:
$ git pr show -t 12005

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12005.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 14, 2023

👋 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 14, 2023
@openjdk
Copy link

openjdk bot commented Jan 14, 2023

@DamonFool The following labels will be automatically applied to this pull request:

  • build
  • client
  • core-libs
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org hotspot hotspot-dev@openjdk.org client client-libs-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Jan 14, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 14, 2023

Webrevs

@@ -188,7 +188,7 @@ template <> struct hb_int_max<signed long long> : hb_integral_constant<s
template <> struct hb_int_max<unsigned long long> : hb_integral_constant<unsigned long long, ULLONG_MAX> {};
#define hb_int_max(T) hb_int_max<T>::value

#if defined(__GNUC__) && __GNUC__ < 5
#if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__)
Copy link
Member

Choose a reason for hiding this comment

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

Normally, such changes in third-party libraries need to be done upstream, and not locally. @prrace can confirm.

Copy link
Member Author

Choose a reason for hiding this comment

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

Normally, such changes in third-party libraries need to be done upstream, and not locally. @prrace can confirm.

Thanks @kevinrushforth for your review.

Yes, it had been fixed in the upstream and I just follow it.
Please see https://github.com/harfbuzz/harfbuzz/blob/main/src/hb-meta.hh#L202 .

Or did you mean we had to sync the whole harfbuzz with the upstream?
If so, I would suggest doing it in a separate PR.
What do you think?
Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

No, I didn't mean to update all of harfbuzz. What you've done seems fine to me, but let's see what @prrace says.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the exact same change has been committed upstream then we are OK to take this because then when we upgrade harfbuzz (under a separate bug) whoever doing the upgrade can be blissfully ignorant of this. In fact it is because there is no easy way to be track changes on the JDK side and reapply them that we have this rule.

@AlanBateman
Copy link
Contributor

It occurred while building LIBJLI, LIBZIP and LIBSPLASHSCREEN.

Is there a list of the issues building libjli? I don't see the in the PR or the JBS issue. For the libzip issues, are these in the native methods or when compiling the zlib code, just wondering if there are bug reports for upstream there too.

@DamonFool
Copy link
Member Author

Is there a list of the issues building libjli? I don't see the in the PR or the JBS issue. For the libzip issues, are these in the native methods or when compiling the zlib code, just wondering if there are bug reports for upstream there too.

Thanks @AlanBateman for the review.

Here is the bug report while building libjli (target support_native_java.base_libjli_zadler32.o).

1 error generated.
* For target support_native_java.base_libjli_zadler32.o:
/Users/jiefu/jdk/src/java.base/share/native/libzip/zlib/zadler32.c:87:15: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
uLong ZEXPORT adler32_z(adler, buf, len)
              ^
/Users/jiefu/jdk/src/java.base/share/native/libzip/zlib/zadler32.c:158:15: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
uLong ZEXPORT adler32(adler, buf, len)
              ^
/Users/jiefu/jdk/src/java.base/share/native/libzip/zlib/zadler32.c:167:13: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
local uLong adler32_combine_(adler1, adler2, len2)
            ^
/Users/jiefu/jdk/src/java.base/share/native/libzip/zlib/zadler32.c:167:13: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
/Users/jiefu/jdk/src/java.base/share/native/libzip/zlib/zadler32.c:196:15: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
              ^
/Users/jiefu/jdk/src/java.base/share/native/libzip/zlib/zadler32.c:204:15: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
   ... (rest of output omitted)

@DamonFool
Copy link
Member Author

For the libzip issues, are these in the native methods or when compiling the zlib code, just wondering if there are bug reports for upstream there too.

Mainly caused by files under src/java.base/share/native/libzip/zlib/.
I'm not sure if there is already a bug report to the upstream.

@AlanBateman
Copy link
Contributor

Mainly caused by files under src/java.base/share/native/libzip/zlib/. I'm not sure if there is already a bug report to the upstream.

Maybe this one:
madler/zlib#633

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Hotspot changes are good.

Thanks.

@openjdk
Copy link

openjdk bot commented Jan 17, 2023

@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:

8300169: Build failure with clang-15

Reviewed-by: dholmes, prr

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 39 new commits pushed to the master branch:

  • 8c12ae8: 8283203: Fix typo in SystemTray.getTrayIconSize javadoc
  • e7e3712: 8300010: UnsatisfiedLinkError on calling System.console().readPassword() on Windows
  • 0b9ff06: 8300184: Optimize ResourceHashtableBase::iterate_all using _number_of_entries
  • 75b122f: 8300120: Configure should support different defaults for CI/dev build environments
  • e139ec3: 8300069: Left shift of negative value in share/adlc/dict2.cpp
  • fb147aa: 8300228: ModuleReader.find on exploded module throws if resource name maps to invalid file path
  • 4cd166f: 8300125: Serial: Remove unused Generation::reset_saved_marks
  • 85d70ac: Merge
  • e15bdc5: 8299789: Compilation of gtest causes build to fail if runtime libraries are in different dirs
  • b7fb8ef: 8299323: Allow extended registers for cmpw
  • ... and 29 more: https://git.openjdk.org/jdk/compare/4be94e435002d9d6cb594a393e9e35d650a9a0c9...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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 17, 2023
@DamonFool
Copy link
Member Author

Hotspot changes are good.

Thanks @dholmes-ora .

@DamonFool
Copy link
Member Author

Hi @kevinrushforth and @AlanBateman , are you fine with this change?
Thanks.

@kevinrushforth
Copy link
Member

Yes, but I would wait for @prrace to review the Harfbuzz change.

@AlanBateman
Copy link
Contributor

Hi @kevinrushforth and @AlanBateman , are you fine with this change?

No objection from me but I agree with Kevin to wait to see what Phil says about Harfbuzz.

Copy link
Contributor

@prrace prrace left a comment

Choose a reason for hiding this comment

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

client changes are OK by me.

@mlbridge
Copy link

mlbridge bot commented Jan 17, 2023

Mailing list message from Patrick Chen on build-dev:

no you have to revert the commit

Le mar. 17 janv. 2023 ? 17:55, Alan Bateman <alanb at openjdk.org> a ?crit :

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20230117/4dc50b9b/attachment.htm>

@DamonFool
Copy link
Member Author

Mailing list message from Patrick Chen on build-dev:

no you have to revert the commit

Why?
Is there anything wrong?
Thanks.

Le mar. 17 janv. 2023 ? 17:55, Alan Bateman a ?crit :

-------------- next part -------------- An HTML attachment was scrubbed... URL: https://mail.openjdk.org/pipermail/build-dev/attachments/20230117/4dc50b9b/attachment.htm

@DamonFool
Copy link
Member Author

client changes are OK by me.

Thanks @prrace .

@DamonFool
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 18, 2023

Going to push as commit 15a9186.
Since your change was applied there have been 53 commits pushed to the master branch:

  • d918042: 8300267: Remove duplicated setter/getter for do_not_unlock
  • 7c8b99e: 8300117: Replace use of JNI_COMMIT mode with mode 0
  • c705673: 8299089: Instrument global jni handles with tag to make them distinguishable
  • 66f7387: 8299074: nmethod marked for deoptimization is not deoptimized
  • 1f438a8: 8282651: ZGC: vmTestbase/gc/ArrayJuggle/ tests fails intermittently with exit code 97
  • f1194dc: 8300109: RISC-V: Improve code generation for MinI/MaxI nodes
  • 89a032d: 8300002: Performance regression caused by non-inlined hot methods due to post call noop instructions
  • 7071397: 8299224: TestReporterStreams.java has bad indentation for legal header
  • 1d8b87d: 8300321: Use link tags in javax.sql.rowset package-info
  • f9883fc: 8300279: Use generalized see and link tags in core libs in client libs
  • ... and 43 more: https://git.openjdk.org/jdk/compare/4be94e435002d9d6cb594a393e9e35d650a9a0c9...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 18, 2023
@openjdk openjdk bot closed this Jan 18, 2023
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 18, 2023
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jan 18, 2023
@openjdk
Copy link

openjdk bot commented Jan 18, 2023

@DamonFool Pushed as commit 15a9186.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org client client-libs-dev@openjdk.org core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants