[jdk8u-dev] RFR: 8354941: Build failure with glibc 2.42 due to uabs() name collision [v2]
Andrew John Hughes
andrew at openjdk.org
Fri Dec 5 16:29:18 UTC 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](https://bugs.openjdk.org/browse/JDK-8248414), "AArch64: Remove uses of long and unsigned long ints" and [JDK-8251930](https://bugs.openjdk.org/browse/JDK-8251930), "AArch64: Native types mismatch in hotspot", but these in turn require adaptation to work around other missing changes like [JDK-8222412](https://bugs.openjdk.org/browse/JDK-8222412) "AARCH64: multiple instructions encoding issues" and [JDK-8139043](https://bugs.openjdk.org/browse/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](https://bugs.openjdk.org/browse/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_...
Andrew John Hughes has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
- Merge remote-tracking branch 'dev/master' into JDK-8354941
- Backport 26a8acad1f45bec90ad6c4ff5cd41f4e7450a962
-------------
Changes:
- all: https://git.openjdk.org/jdk8u-dev/pull/711/files
- new: https://git.openjdk.org/jdk8u-dev/pull/711/files/994ba93b..49dbce7b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=711&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=711&range=00-01
Stats: 178929 lines in 356 files changed: 172723 ins; 5744 del; 462 mod
Patch: https://git.openjdk.org/jdk8u-dev/pull/711.diff
Fetch: git fetch https://git.openjdk.org/jdk8u-dev.git pull/711/head:pull/711
PR: https://git.openjdk.org/jdk8u-dev/pull/711
More information about the jdk8u-dev
mailing list