RFR: 8354941: Build failure with glibc 2.42 due to uabs() name collision
Severin Gehwolf
sgehwolf at openjdk.org
Mon Apr 28 08:39:46 UTC 2025
On Thu, 17 Apr 2025 12:31:18 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> glibc 2.42 defines its own version of `uabs` when `stdlib.h` is being included. I propose to rename the hotspot version of `uabs` to `custom_uabs` (or some other suitable name) to avoid the name clash. The rename of the function is hidden by using a `UABS` macro instead in the code.
>
> Testing:
> - [x] GHA (also [here](https://github.com/jerboaa/jdk/actions/runs/14513365723))
> - [x] Builds with this patch with GCC 15 where the build would fail earlier and pass with this patch.
>
> Thoughts?
As per the guide, [namespaces are discouraged](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md#namespaces). So what would you suggest? Keep the macro and name-space the custom impl we have with something like `hotspot_uabs`? Something else? Sorry, it doesn't seem clear to me from the discussion.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24723#issuecomment-2834451305
More information about the hotspot-dev
mailing list