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

JDK-8308288: Fix xlc17 clang warnings and build errors in hotspot #14283

Closed
wants to merge 1 commit into from

Conversation

JoKern65
Copy link
Contributor

@JoKern65 JoKern65 commented Jun 2, 2023

This pr is a split off from JDK-8308288 : Fix xlc17 clang warnings in shared code #14146
It handles the part in hotspot.

It handles the error introduced by a redefine of malloc in stdlib.h resulting in the following build error:

/data/d042520/pr/jdk/src/hotspot/share/runtime/os.cpp:616:5: error: no member named '_vec_malloc' in 'LogTag'; did you mean 'vec_malloc'?
log_warning(malloc, free)("ptr caught: " PTR_FORMAT, p2i(ptr));
^~~~~~~~~~~~~~~~~~~~~~~~~
/data/d042520/pr/jdk/src/hotspot/share/logging/log.hpp:46:28: note: expanded from macro 'log_warning'
#define log_warning(...) (!log_is_enabled(Warning, VA_ARGS)) ? (void)0 : LogImpl<LOG_TAGS(VA_ARGS)>::writeLogLevel::Warning
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/d042520/pr/jdk/src/hotspot/share/logging/log.hpp:68:45: note: expanded from macro 'log_is_enabled'
#define log_is_enabled(level, ...) (LogImpl<LOG_TAGS(VA_ARGS)>::is_level(LogLevel::level))
^~~~~~~~~~~~~~~~~~~~~
/data/d042520/pr/jdk/src/hotspot/share/logging/logTag.hpp:221:38: note: expanded from macro 'LOG_TAGS'
#define LOG_TAGS(...) EXPAND_VARARGS(LOG_TAGS_EXPANDED(VA_ARGS, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG, _NO_TAG))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/d042520/pr/jdk/src/hotspot/share/logging/logTag.hpp:217:57: note: expanded from macro 'LOG_TAGS_EXPANDED'
#define LOG_TAGS_EXPANDED(T0, T1, T2, T3, T4, T5, ...) PREFIX_LOG_TAG(T0), PREFIX_LOG_TAG(T1), PREFIX_LOG_TAG(T2),
^~~~~~~~~~~~~~~~~~
... (rest of output omitted)

Additionally it solves the need for an #include <alloca.h> on AIX for any usage of the alloca function, by adding the include to globalDefinitions_xlc.hpp


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

  • JDK-8308288: Fix xlc17 clang warnings and build errors in hotspot (Bug - "4")

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14283

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 2, 2023

👋 Welcome back JoKern65! 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 Jun 2, 2023
@openjdk
Copy link

openjdk bot commented Jun 2, 2023

@JoKern65 The following label will be automatically applied to this pull request:

  • hotspot

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

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jun 2, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 2, 2023

Webrevs

@JoKern65 JoKern65 changed the title JDK-8308288: Fix xlc17 clang warnings and build errors in hotspot JDK-8308288: Fix xlc17 clang warnings and build errors in hotspotx Jun 5, 2023
@JoKern65 JoKern65 changed the title JDK-8308288: Fix xlc17 clang warnings and build errors in hotspotx JDK-8308288: Fix xlc17 clang warnings and build errors in hotspot Jun 5, 2023
Copy link
Member

@GoeLin GoeLin left a comment

Choose a reason for hiding this comment

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

os.cpp / timezone
I leave it to you that it's the correct behaviour
for AIX, for the other platforms it looks good.

os.cpp / print_function_and_library_name()
I don't like assignements in if(), but the fix here
should not change this. Good.

globalDefinitions_xlc.hpp / alloca.h
Good.

globalDefinitions_xlc.hpp / malloc
Having looked at the discussion about this in #14146,
I think this is the solution we want to have here.
I don't think we should harden the code wrt. the fact
that malloc and others can be macros. At least as long
as none of the compilers of the main platforms detects
this (e.g. running in GHA).
Also, I know that Joachim asked IBM to remove the
macro from the header. After all, it worked with xlc16.
So let's fix this here in the _xlc file.

@openjdk
Copy link

openjdk bot commented Jun 5, 2023

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

8308288: Fix xlc17 clang warnings and build errors in hotspot

Reviewed-by: goetz, mbaesken

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

  • 89f5bac: 8309225: Fix xlc17 clang 15 warnings in security and servicability
  • 6eddbe2: 8309219: Fix xlc17 clang 15 warnings in java.base
  • 177e832: 8307153: JVMTI GetThreadState on carrier should return STATE_WAITING
  • f0236ed: 8309543: Micro-optimize x86 assembler UseCondCardMark
  • 9d7bf53: 8280982: [Wayland] [XWayland] java.awt.Robot taking screenshots
  • a1ab377: 8309550: jdk.jfr.internal.Utils::formatDataAmount method should gracefully handle amounts equal to Long.MIN_VALUE
  • c49129f: 8308445: Linker should check that capture state segment is big enough
  • fa79111: 8308031: Linkers should reject unpromoted variadic parameters
  • 16ebf47: 8309594: Cleanup naming in JavacParser related to unnamed classes
  • 5722903: 8307374: Add a JFR event for tracking RSS
  • ... and 113 more: https://git.openjdk.org/jdk/compare/70670b4af617699782f892ae4cb5228ec655a2d0...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@GoeLin, @MBaesken) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 5, 2023
@JoKern65
Copy link
Contributor Author

JoKern65 commented Jun 6, 2023

@kimbarrett, @tstuefe, are you fine with pushing the fix for the malloc
macro as is?

Copy link
Member

@MBaesken MBaesken left a comment

Choose a reason for hiding this comment

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

The malloc change does not look very nice, but I think for now we can use that on AIX with xlc17.

@JoKern65
Copy link
Contributor Author

JoKern65 commented Jun 7, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 7, 2023
@openjdk
Copy link

openjdk bot commented Jun 7, 2023

@JoKern65
Your change (at version 91d2140) is now ready to be sponsored by a Committer.

@TheRealMDoerr
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 7, 2023

Going to push as commit 5b147eb.
Since your change was applied there have been 123 commits pushed to the master branch:

  • 89f5bac: 8309225: Fix xlc17 clang 15 warnings in security and servicability
  • 6eddbe2: 8309219: Fix xlc17 clang 15 warnings in java.base
  • 177e832: 8307153: JVMTI GetThreadState on carrier should return STATE_WAITING
  • f0236ed: 8309543: Micro-optimize x86 assembler UseCondCardMark
  • 9d7bf53: 8280982: [Wayland] [XWayland] java.awt.Robot taking screenshots
  • a1ab377: 8309550: jdk.jfr.internal.Utils::formatDataAmount method should gracefully handle amounts equal to Long.MIN_VALUE
  • c49129f: 8308445: Linker should check that capture state segment is big enough
  • fa79111: 8308031: Linkers should reject unpromoted variadic parameters
  • 16ebf47: 8309594: Cleanup naming in JavacParser related to unnamed classes
  • 5722903: 8307374: Add a JFR event for tracking RSS
  • ... and 113 more: https://git.openjdk.org/jdk/compare/70670b4af617699782f892ae4cb5228ec655a2d0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 7, 2023
@openjdk openjdk bot closed this Jun 7, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Jun 7, 2023
@openjdk
Copy link

openjdk bot commented Jun 7, 2023

@TheRealMDoerr @JoKern65 Pushed as commit 5b147eb.

💡 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
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants