RFR: 8333326: Linux Alpine build fails after 8302744

Matthias Baesken mbaesken at openjdk.org
Tue Jun 4 07:41:03 UTC 2024


On Tue, 4 Jun 2024 06:40:29 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Good point. The man page also has:
>> 
>> 
>> VERSIONS
>>        There are two different versions of basename() - the POSIX version  de‐
>>        scribed above, and the GNU version, which one gets after
>> 
>>                #define _GNU_SOURCE         /* See feature_test_macros(7) */
>>                #include <string.h>
>> 
>>        The  GNU  version  never  modifies  its argument, and returns the empty
>>        string when path has a trailing slash, and in particular also  when  it
>>        is "/".  There is no GNU version of dirname().
>> 
>>        With glibc, one gets the POSIX version of basename() when <libgen.h> is
>>        included, and the GNU version otherwise.
>> 
>> 
>> So it sounds like we use the GNU version when `glibc` is being used.
>
> Thanks @jerboaa I obviously completely missed that. :(
> 
> But as per Thomas's comment we should be using the Posix function not glibc version. Then we would not need to specialize for Musl-C.

So should I remove the ifdef MUSL_LIBC  ?
I considered this but was not sure because  it might change more than just fixing the Alpine build.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19497#discussion_r1625511045


More information about the hotspot-runtime-dev mailing list