{"thread":{"id":"63134","subject":"[PATCH 04/12] Makefile: remove NEEDS_LIBRT build variable","startedAt":"2025-03-15T02:50:16Z","lastAt":"2025-03-15T02:50:16Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":12},"messages":[{"id":"514347","messageId":"bb895671-ad11-4ddd-b8f3-ec6479bf4da4@ramsayjones.plus.com","threadId":"63134","inReplyTo":null,"subject":"[PATCH 04/12] Makefile: remove NEEDS_LIBRT build variable","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-03-15T02:47:14Z","receivedAt":"2025-03-15T02:50:16Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit d19e3a5b21 (\"Makefile: add NEEDS_LIBRT to optionally link with\nlibrt\", 2016-07-07) introduced the NEEDS_LIBRT build variable to\ndisassociate the HAVE_CLOCK_GETTIME variable with the unconditional\nlinking of the librt library. At one time, the clock_gettime() function\nwas not available as part of the libc library and (on some unix systems)\nrequired linking with librt.\n\nCommit 52fcec75ce (\"config.mak.uname: define NEEDS_LIBRT under Linux, for\nnow\", 2016-07-10) set the NEEDS_LIBRT variable in the Linux section of\nthe config.mak.uname file, since Debian 7 (wheezy) was one of the few\nremaining distributions, with glibc 2.13, that required linking with\nlibrt for clock_gettime(). Note that from glibc version 2.17, this is no\nlonger necessary.\n\nNote that Debian 7.0 was released on May 4th, 2013 and benefited from\nlong term support until May 2018 when it went end-of-life. Since that\ntime, Linux distributions use a more up-to-date library, for example:\n\n    Distribution   version  end of support\n\n    Debian 8       2.19     30th June 2020\n    RHEL   8       2.28     31st May  2024 *\n    Ubuntu 16.04   2.23     30th Apr  2021\n\n* paid 'Maintenance support' ends 31st May 2029\n\nSince it is no longer required, remove NEEDS_LIBRT from the Makefile and\nconfig.mak.uname.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n Makefile         | 7 -------\n config.mak.uname | 2 --\n 2 files changed, 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 818dde32a9..8fa4d2664e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -340,9 +340,6 @@ include shared.mak\n #\n # Define HAVE_SYNC_FILE_RANGE if your platform has sync_file_range.\n #\n-# Define NEEDS_LIBRT if your platform requires linking with librt (glibc version\n-# before 2.17) for clock_gettime and CLOCK_MONOTONIC.\n-#\n # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function.\n #\n # Define HAVE_GETDELIM if your system has the getdelim() function.\n@@ -2171,10 +2168,6 @@ ifdef HAVE_SYNC_FILE_RANGE\n \tBASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE\n endif\n \n-ifdef NEEDS_LIBRT\n-\tEXTLIBS += -lrt\n-endif\n-\n ifdef HAVE_BSD_SYSCTL\n \tBASIC_CFLAGS += -DHAVE_BSD_SYSCTL\n endif\ndiff --git a/config.mak.uname b/config.mak.uname\nindex b12d4e168a..88007c4f13 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -54,8 +54,6 @@ ifeq ($(uname_S),Linux)\n \tHAVE_DEV_TTY = YesPlease\n \tHAVE_CLOCK_GETTIME = YesPlease\n \tHAVE_CLOCK_MONOTONIC = YesPlease\n-\t# -lrt is needed for clock_gettime on glibc <= 2.16\n-\tNEEDS_LIBRT = YesPlease\n \tHAVE_SYNC_FILE_RANGE = YesPlease\n \tHAVE_GETDELIM = YesPlease\n \tFREAD_READS_DIRECTORIES = UnfortunatelyYes\n-- \n2.49.0\n"}]}