Skip to content

Conversation

@thesamesam
Copy link
Contributor

@thesamesam thesamesam commented Jan 20, 2024

This fixes building with GCC 14:

  • Cherry-pick a fix from Harfbuzz upstream
  • Apply other -Wcalloc-transposed-args fixes to the JDK sources

-Wcalloc-transposed-args errors out with GCC 14 as the OpenJDK build uses
-Werror.

The calloc prototype is:

void *calloc(size_t nmemb, size_t size);

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size sizeof(struct ...). GCC then sees we're not
doing anything wrong.


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-8324243: Compilation failures in java.desktop module with gcc 14 (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17506

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 20, 2024

👋 Welcome back thesamesam! 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
Copy link

openjdk bot commented Jan 20, 2024

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

  • client

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 client client-libs-dev@openjdk.org label Jan 20, 2024
@TheShermanTanker
Copy link
Contributor

@thesamesam Unfortunately we can't fix the harfbuzz sources, since they are third party code. Your changes to harfbuzz code wouldn't be accepted by the client team :(

@thesamesam
Copy link
Contributor Author

@thesamesam Unfortunately we can't fix the harfbuzz sources, since they are third party code. Your changes to harfbuzz code wouldn't be accepted by the client team :(

Bleh. I don't suppose any exception can be made given it's a cherry-pick (i.e. my changes there are not original, they're upstream, just not in a release)?

If not, I can just drop that bit, and we can wait until a new Harfbuzz release is made and propagates into OpenJDK.

@TheShermanTanker
Copy link
Contributor

I don't believe harfbuzz has been bumped into a specific commit before, so I'm not sure about that. Perhaps you could wait till Phil sees this, for a conclusive answer

@thesamesam
Copy link
Contributor Author

thesamesam commented Jan 21, 2024

ok - if I have to drop it, so be it, not the end of the world. I guess it's also tricky because of cherry-picking one change vs bumping to some git commit upstream as a whole. I'll wait a little bit then just drop if nobody chimes in. Thank you!

@TheShermanTanker
Copy link
Contributor

You'd need a issue on the tracker to connect to this Pull Request for anyone to see this (most reviewers don't go through these manually, they come from the mailing lists). Are you able to create one yourself, or should I create one for you?

@thesamesam
Copy link
Contributor Author

Would you be so kind to file one for me please? I don't have access yet.

@TheShermanTanker
Copy link
Contributor

No problem!

Just change your Pull Request title to 8324243 (The literal number) and watch the magic happen :)

By the way, your name strikes me as familiar. Have I seen you before on the gcc mailing lists?

-Wcalloc-transposed-args errors out with GCC 14 as the OpenJDK build uses
-Werror.

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees we're not
doing anything wrong.

Signed-off-by: Sam James <sam@gentoo.org>
@thesamesam thesamesam changed the title Fix GCC 14 build 8324243: Fix GCC 14 build Jan 21, 2024
@openjdk
Copy link

openjdk bot commented Jan 21, 2024

@thesamesam Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 21, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 21, 2024

Webrevs

@thesamesam
Copy link
Contributor Author

thesamesam commented Jan 21, 2024

No problem!

Many thanks!

Just change your Pull Request title to 8324243 (The literal number) and watch the magic happen :)

By the way, your name strikes me as familiar. Have I seen you before on the gcc mailing lists?

You know, now you say it, I think we have interacted before actually - either on the GCC ML or bugzilla! I tend to pop up in a lot of places just because we have a lot of users with a lot of different odd and interesting environments.

@TheShermanTanker
Copy link
Contributor

No problem!

Many thanks!

Just change your Pull Request title to 8324243 (The literal number) and watch the magic happen :)
By the way, your name strikes me as familiar. Have I seen you before on the gcc mailing lists?

You know, now you say it, I think we have interacted before actually - either on the GCC ML or bugzilla! I tend to pop up in a lot of places just because we have a lot of users with a lot of different odd and interesting environments.

Ah! I think you might be the same Sam James in my thread about adding the invalid-noreturn warning to gcc (Which ultimately didn't get anywhere). Glad to meet you again! :)

This Pull Request might be related to client libs code, but given its nature I'd consider it a build-dev issue too, in which case, have a thumbs up from me, since that is my domain.

Thanks, and welcome to OpenJDK if you're new here!

@thesamesam
Copy link
Contributor Author

Ah, yes! FWIW, I'm still disappointed about that as well (I don't have any sort of power, just tend to do a lot of triage). Do consider sending it again when stage 1 opens again after GCC 14 is out. Persistence is key with GCC, even if your change isn't an objectionable one. It took me a little while to get used to that..

@openjdk openjdk bot removed the rfr Pull request is ready for review label Feb 2, 2024
This reverts commit acdd606c5d818baa783c6529ea58e66a061ec64a.
@openjdk
Copy link

openjdk bot commented Feb 2, 2024

@thesamesam Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 2, 2024
@magicus
Copy link
Member

magicus commented Feb 2, 2024

/label add build

@openjdk openjdk bot added the build build-dev@openjdk.org label Feb 2, 2024
@openjdk
Copy link

openjdk bot commented Feb 2, 2024

@magicus
The build label was successfully added.

Copy link
Member

@magicus magicus left a comment

Choose a reason for hiding this comment

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

Changes look good from a build perspective, but you need an ok from client as well for java.desktop changes.

Copy link

@kimbarrett kimbarrett left a comment

Choose a reason for hiding this comment

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

(I'm not a member of the relevant teams, but...)
The changes to calloc calls are plainly an improvement. The new gcc
warnings are correct in the sense of potentially confused code, though
in all of these cases I think it's "harmless".

Just a minor whitespace issue in the build changes.

@prrace
Copy link
Contributor

prrace commented Feb 21, 2024

@thesamesam you need to fix the PR title to match the JBS issue just as the bot is instructing you.
Then the bots should mark this "ready" to push.

@thesamesam thesamesam changed the title 8324243: Fix GCC 14 build JDK-8324243: Compilation failures in java.desktop module with gcc 14 Feb 22, 2024
@thesamesam
Copy link
Contributor Author

Thanks, I hadn't gone back and read the original comment.

@openjdk
Copy link

openjdk bot commented Feb 22, 2024

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

8324243: Compilation failures in java.desktop module with gcc 14

Reviewed-by: jwaters, ihse, kbarrett, 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 385 new commits pushed to the master branch:

  • 0bcece9: 8325342: Remove unneeded exceptions in compare.sh
  • 64f7972: 8326158: Javadoc for java.time.DayOfWeek#minus(long)
  • f0f4d63: 8326351: Update the Zlib version in open/src/java.base/share/legal/zlib.md to 1.3.1
  • 51e2dde: 8326235: RISC-V: Size CodeCache for short calls encoding
  • c022431: 8326412: debuginfo files should not have executable bit set
  • 33834b7: 8326375: [REDO] Clean up NativeCompilation.gmk and its newly created parts
  • 2352268: 8326334: JFR failed assert(used(klass)) failed: invariant
  • 492e8bf: 8325587: Shenandoah: ShenandoahLock should allow blocking in VM
  • 5f16f34: 8326370: Remove redundant and misplaced micros from StringBuffers
  • 921507c: 8326319: G1: Remove unused G1ConcurrentMark::_init_times
  • ... and 375 more: https://git.openjdk.org/jdk/compare/f4d08ccf80812d4f26a148fac6bf99b96672a63f...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 (@TheShermanTanker, @magicus, @kimbarrett, @prrace) 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 Feb 22, 2024
@thesamesam
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Feb 22, 2024
@openjdk
Copy link

openjdk bot commented Feb 22, 2024

@thesamesam
Your change (at version ef79e7a) is now ready to be sponsored by a Committer.

@TheShermanTanker
Copy link
Contributor

Glad to have met you again in this Pull Request :)
/sponsor

@openjdk
Copy link

openjdk bot commented Feb 22, 2024

Going to push as commit 8e5f6dd.
Since your change was applied there have been 385 commits pushed to the master branch:

  • 0bcece9: 8325342: Remove unneeded exceptions in compare.sh
  • 64f7972: 8326158: Javadoc for java.time.DayOfWeek#minus(long)
  • f0f4d63: 8326351: Update the Zlib version in open/src/java.base/share/legal/zlib.md to 1.3.1
  • 51e2dde: 8326235: RISC-V: Size CodeCache for short calls encoding
  • c022431: 8326412: debuginfo files should not have executable bit set
  • 33834b7: 8326375: [REDO] Clean up NativeCompilation.gmk and its newly created parts
  • 2352268: 8326334: JFR failed assert(used(klass)) failed: invariant
  • 492e8bf: 8325587: Shenandoah: ShenandoahLock should allow blocking in VM
  • 5f16f34: 8326370: Remove redundant and misplaced micros from StringBuffers
  • 921507c: 8326319: G1: Remove unused G1ConcurrentMark::_init_times
  • ... and 375 more: https://git.openjdk.org/jdk/compare/f4d08ccf80812d4f26a148fac6bf99b96672a63f...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 22, 2024
@openjdk openjdk bot closed this Feb 22, 2024
@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 Feb 22, 2024
@openjdk
Copy link

openjdk bot commented Feb 22, 2024

@TheShermanTanker @thesamesam Pushed as commit 8e5f6dd.

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

@thesamesam thesamesam deleted the gcc14 branch February 22, 2024 06:41
@thesamesam
Copy link
Contributor Author

Thank you!

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 integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants