Skip to content

Conversation

@gnu-andrew
Copy link
Member

@gnu-andrew gnu-andrew commented Nov 3, 2025

This backport replaces the local definition of uabs with g_uabs to avoid a conflict with the uabs declared in versions of glibc 2.42 and later.

The patch is mostly clean, with the exception of two conflicts:

  1. In assembler_aarch64.cpp, the type of uimm is unsigned long in 8u, rather than uint64_t. 8u is missing a sequence of changes, which begins with JDK-8248414, "AArch64: Remove uses of long and unsigned long ints" and JDK-8251930, "AArch64: Native types mismatch in hotspot", but these in turn require adaptation to work around other missing changes like JDK-8222412 "AARCH64: multiple instructions encoding issues" and JDK-8139043, "aarch64: add support for adler32 intrinsic". Backporting 8248414 & 8251930 may be worthwhile, especially if Windows & Mac AArch64 ports are ever considered for 8u, but really needs to be done by someone with access to AArch64 hardware to verify the changes. I don't think it's necessary just for a simple name substitution.
  2. In stubGenerator_aarch64.cpp, I corrected the type of granularity in copy_memory(bool, Register, Register, Register, Register, int) from int to unsigned int, which matches the signature of g_uabs. This same correction was made in later JDKs as part of an enhancement, JDK-8257436 "Regressions in ArrayCopyUnalignedDst.testByte/testChar for 65-78 bytes when UseSIMDForMemoryOps is on". Again, the rest may be worth backporting if the same performance improvement is visible on 8u AArch64, but the risk isn't appropriate for this change.

The change was verified by ensuring that uabs no longer exists in the source code after this patch.

$ grep -r 'uabs' hotspot/
hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp:    return g_uabs(target - branch) < branch_range;
hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp:    if (g_uabs(imm) < (1 << 24)) {
hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp:    size_t granularity = g_uabs(step);
hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp:    unsigned int granularity = g_uabs(step);
hotspot/src/cpu/aarch64/vm/assembler_aarch64.cpp:  unsigned long uimm = g_uabs(imm);
hotspot/src/share/vm/opto/mulnode.cpp:  unsigned int abs_con = g_uabs(con);
hotspot/src/share/vm/opto/mulnode.cpp:  julong abs_con = g_uabs(con);
hotspot/src/share/vm/utilities/globalDefinitions.hpp:static inline unsigned int g_uabs(unsigned int n) {
hotspot/src/share/vm/utilities/globalDefinitions.hpp:static inline julong g_uabs(julong n) {
hotspot/src/share/vm/utilities/globalDefinitions.hpp:static inline julong g_uabs(jlong n) { return g_uabs((julong)n); }
hotspot/src/share/vm/utilities/globalDefinitions.hpp:static inline unsigned int g_uabs(int n) { return g_uabs((unsigned int)n); }

$ grep -r 'uabs' hotspot/|grep -v g_uabs
<no results>

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
  • JDK-8354941 needs maintainer approval

Issue

  • JDK-8354941: Build failure with glibc 2.42 due to uabs() name collision (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/711/head:pull/711
$ git checkout pull/711

Update a local copy of the PR:
$ git checkout pull/711
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/711/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 711

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/711.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 3, 2025

👋 Welcome back andrew! 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 Nov 3, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport 26a8acad1f45bec90ad6c4ff5cd41f4e7450a962 8354941: Build failure with glibc 2.42 due to uabs() name collision Nov 3, 2025
@openjdk
Copy link

openjdk bot commented Nov 3, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels Nov 3, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 3, 2025

Webrevs

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

Labels

backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant