[jdk8u-dev] Integrated: 8354941: Build failure with glibc 2.42 due to uabs() name collision

Andrew John Hughes andrew at openjdk.org
Fri Dec 5 16:57:50 UTC 2025


On Mon, 3 Nov 2025 19:28:14 GMT, Andrew John Hughes <andrew at openjdk.org> wrote:

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

This pull request has now been integrated.

Changeset: 48a9edf6
Author:    Andrew John Hughes <andrew at openjdk.org>
URL:       https://git.openjdk.org/jdk8u-dev/commit/48a9edf6301246c52fc5f770a644dec70d36c8df
Stats:     11 lines in 6 files changed: 0 ins; 0 del; 11 mod

8354941: Build failure with glibc 2.42 due to uabs() name collision

Reviewed-by: sgehwolf
Backport-of: 26a8acad1f45bec90ad6c4ff5cd41f4e7450a962

-------------

PR: https://git.openjdk.org/jdk8u-dev/pull/711


More information about the jdk8u-dev mailing list