<div dir="ltr"><div>Hi,</div><div><br></div><div>AFAICS glibc 2.17 (or later) are supported in:</div><br>- RHEL 7.9 and later<br>- Oracle 7.9 and later (direct RHEL spinoff, same versioning)<br>- SLES 12 SP5 and later<br>- Debian: Jessie (Debian 8) and anything later. Jessie not supported anymore. Current oldoldstable is Bullseye (Debian 11).<br><div>- Raspbian: any version after 2017, basically.</div><div>- Ubuntu: 14.04 and anything later. 14.04 is the last version Canonical still sells support for, AFAIK.</div><br>Noteworthy still supported commercial Linuxes with older glibcs: AFAICS only RHEL 6.9. We (IBM, Redhat) don't care about JDK 26 on these old systems.<br><div><br></div><div>Cheers, Thomas</div><br><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Sep 19, 2025 at 2:39 PM David Holmes <<a href="mailto:david.holmes@oracle.com">david.holmes@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 19/09/2025 10:21 pm, Baesken, Matthias wrote:<br>
> Hi David,  even  on RHEL   7.9   it works without  adding  -lrt to  linking , see the example   :<br>
<br>
It is only pre glibc 2.17 that we need librt.so for.<br>
<br>
David<br>
<br>
> <br>
> gcc --version<br>
> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)<br>
> Copyright (C) 2015 Free Software Foundation, Inc.<br>
> This is free software; see the source for copying conditions.  There is NO<br>
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>
> <br>
> gcc clock_gettime.c -o clock_gettime<br>
> ./clock_gettime<br>
> Elapsed time: 2.008803 seconds<br>
> <br>
> more ./clock_gettime.c<br>
> #include <stdio.h><br>
> #include <time.h><br>
> #include <unistd.h><br>
> <br>
> int main() {<br>
>      struct timespec start, end;<br>
>      double elapsed;<br>
> <br>
>      // Get start time<br>
>      clock_gettime(CLOCK_MONOTONIC, &start);<br>
> <br>
>      // Simulate some work (sleep for 2 seconds)<br>
>      sleep(2);<br>
> <br>
>      // Get end time<br>
>      clock_gettime(CLOCK_MONOTONIC, &end);<br>
> <br>
>      // Calculate elapsed time in seconds (as a double)<br>
>      elapsed = (end.tv_sec - start.tv_sec);<br>
>      elapsed += (end.tv_nsec - start.tv_nsec) / 1e9;<br>
> <br>
>      printf("Elapsed time: %.6f seconds\n", elapsed);<br>
> <br>
>      return 0;<br>
> }<br>
> <br>
> <br>
> ldd --version<br>
> ldd (GNU libc) 2.17<br>
> <br>
> <br>
> <br>
> But  on ancient   SLES 11  (SUSE Linux 11)  with<br>
> ldd --version<br>
> ldd (GNU libc) 2.11.3<br>
> <br>
> <br>
> I see the issue  ,  there I have to add   -lrt  :<br>
> <br>
> gcc  clock_gettime.c  -o   clock_gettime<br>
> /tmp/ccU07fSz.o: In function `main':<br>
> clock_gettime.c:(.text+0x20): undefined reference to `clock_gettime'<br>
> clock_gettime.c:(.text+0x40): undefined reference to `clock_gettime'<br>
> collect2: ld returned 1 exit status<br>
> <br>
> <br>
> gcc  clock_gettime.c  -o   clock_gettime -lrt<br>
> ./clock_gettime<br>
> Elapsed time: 2.000108 seconds<br>
> <br>
> <br>
> So it seems we have to go back to SLES11   and RHEL 6  (!)   for this strange  librt  issue .<br>
> <br>
> Best regards, Matthias<br>
> <br>
> <br>
> <br>
> -----Original Message-----<br>
> From: Baesken, Matthias<br>
> Sent: Friday, 19 September 2025 09:42<br>
> To: 'David Holmes' <<a href="mailto:david.holmes@oracle.com" target="_blank">david.holmes@oracle.com</a>>; <a href="mailto:build-dev@openjdk.org" target="_blank">build-dev@openjdk.org</a>; hotspot-dev <<a href="mailto:hotspot-dev-retn@openjdk.org" target="_blank">hotspot-dev-retn@openjdk.org</a>><br>
> Cc: Langer, Christoph <<a href="mailto:christoph.langer@sap.com" target="_blank">christoph.langer@sap.com</a>><br>
> Subject: RE: "useless" librt.so.1 dependency on Linux reported by dpkg-shlibdeps<br>
> <br>
> Hi David, I found a RHEL  7.9   machine with an old glibc  :<br>
> <br>
> ldd --version<br>
> ldd (GNU libc) 2.17<br>
> <br>
> But the gcc on this machine  is 4.8.5  , probably too  old   to build OpenJDK there to see  if this change breaks something .<br>
> <br>
> Any idea what I should test  on this old machine  regarding librt.so.1   ?<br>
> <br>
> <br>
> Best regards, Matthias<br>
> <br>
> <br>
> <br>
>>>>><br>
>>>>> ( seems some versions of  RHEL 7  / SLES 12  still had those old glibc<br>
>>>>> versions)<br>
>>>>><br>
>>>>> Could we clean this up?<br>
>>>>><br>
>>>>> Or is there still some need  to  support this in jdk26  ?<br>
>>>><br>
>>>> I always find it very difficult to determine when checks like these<br>
>>>> become unnecessary. I think RHEL 7 with glibc 2.17 is the oldest Linux<br>
>>>> release we currently support.<br>
>>>><br>
>>>> Given I wrote the above in April 2021, I would hope we can now move on,<br>
>>>> but again I don't know how to readily determine that.<br>
>>><br>
>>><br>
>>> I could create a removal PR and maybe you can test on the oldest platforms you want to support in release 26 ?<br>
>><br>
>> I don't have access to such systems for testing.<br>
>><br>
>> David<br>
> <br>
> <br>
<br>
</blockquote></div>