Skip to content

Commit 7f34663

Browse files
ramsay-jonesNinjaInShade
authored andcommitted
Makefile: remove NEEDS_LIBRT build variable
Commit d19e3a5 ("Makefile: add NEEDS_LIBRT to optionally link with librt", 2016-07-07) introduced the NEEDS_LIBRT build variable to disassociate the HAVE_CLOCK_GETTIME variable with the unconditional linking of the librt library. At one time, the clock_gettime() function was not available as part of the libc library and (on some unix systems) required linking with librt. Commit 52fcec7 ("config.mak.uname: define NEEDS_LIBRT under Linux, for now", 2016-07-10) set the NEEDS_LIBRT variable in the Linux section of the config.mak.uname file, since Debian 7 (wheezy) was one of the few remaining distributions, with glibc 2.13, that required linking with librt for clock_gettime(). Note that from glibc version 2.17, this is no longer necessary. Note that Debian 7.0 was released on May 4th, 2013 and benefited from long term support until May 2018 when it went end-of-life. Since that time, Linux distributions use a more up-to-date library, for example: Distribution version end of support Debian 8 2.19 30th June 2020 RHEL 8 2.28 31st May 2024 * Ubuntu 16.04 2.23 30th Apr 2021 * paid 'Maintenance support' ends 31st May 2029 Since it is no longer required, remove NEEDS_LIBRT from the Makefile and config.mak.uname. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 15d71ba commit 7f34663

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@ include shared.mak
340340
#
341341
# Define HAVE_SYNC_FILE_RANGE if your platform has sync_file_range.
342342
#
343-
# Define NEEDS_LIBRT if your platform requires linking with librt (glibc version
344-
# before 2.17) for clock_gettime and CLOCK_MONOTONIC.
345-
#
346343
# Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function.
347344
#
348345
# Define HAVE_GETDELIM if your system has the getdelim() function.
@@ -2174,10 +2171,6 @@ ifdef HAVE_SYNC_FILE_RANGE
21742171
BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE
21752172
endif
21762173

2177-
ifdef NEEDS_LIBRT
2178-
EXTLIBS += -lrt
2179-
endif
2180-
21812174
ifdef HAVE_BSD_SYSCTL
21822175
BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
21832176
endif

config.mak.uname

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ ifeq ($(uname_S),Linux)
5454
HAVE_DEV_TTY = YesPlease
5555
HAVE_CLOCK_GETTIME = YesPlease
5656
HAVE_CLOCK_MONOTONIC = YesPlease
57-
# -lrt is needed for clock_gettime on glibc <= 2.16
58-
NEEDS_LIBRT = YesPlease
5957
HAVE_SYNC_FILE_RANGE = YesPlease
6058
HAVE_GETDELIM = YesPlease
6159
FREAD_READS_DIRECTORIES = UnfortunatelyYes

0 commit comments

Comments
 (0)