From 246f1c811448f37a44b41cd8df8d0ef9736d95f4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 26 Sep 2022 17:14:18 -0400 Subject: remove LFS64 symbol aliases; replace with dynamic linker remapping originally the namespace-infringing "large file support" interfaces were included as part of glibc-ABI-compat, with the intent that they not be used for linking, since our off_t is and always has been unconditionally 64-bit and since we usually do not aim to support nonstandard interfaces when there is an equivalent standard interface. unfortunately, having the symbols present and available for linking caused configure scripts to detect them and attempt to use them without declarations, producing all the expected ill effects that entails. as a result, commit 2dd8d5e1b8ba1118ff1782e96545cb8a2318592c was made to prevent this, using macros to redirect the LFS64 names to the standard names, conditional on _GNU_SOURCE or _LARGEFILE64_SOURCE. however, this has turned out to be a source of further problems, especially since g++ defines _GNU_SOURCE by default. in particular, the presence of these names as macros breaks a lot of valid code. this commit removes all the LFS64 symbols and replaces them with a mechanism in the dynamic linker symbol lookup failure path to retry with the spurious "64" removed from the symbol name. in the future, if/when the rest of glibc-ABI-compat is moved out of libc, this can be removed. --- src/misc/getrlimit.c | 2 -- src/misc/lockf.c | 2 -- src/misc/nftw.c | 2 -- src/misc/setrlimit.c | 2 -- 4 files changed, 8 deletions(-) (limited to 'src/misc') diff --git a/src/misc/getrlimit.c b/src/misc/getrlimit.c index bf676307..a5558d81 100644 --- a/src/misc/getrlimit.c +++ b/src/misc/getrlimit.c @@ -26,5 +26,3 @@ int getrlimit(int resource, struct rlimit *rlim) return ret; #endif } - -weak_alias(getrlimit, getrlimit64); diff --git a/src/misc/lockf.c b/src/misc/lockf.c index 16a80bec..0162442b 100644 --- a/src/misc/lockf.c +++ b/src/misc/lockf.c @@ -28,5 +28,3 @@ int lockf(int fd, int op, off_t size) errno = EINVAL; return -1; } - -weak_alias(lockf, lockf64); diff --git a/src/misc/nftw.c b/src/misc/nftw.c index 8dcff7fe..fcd25a73 100644 --- a/src/misc/nftw.c +++ b/src/misc/nftw.c @@ -138,5 +138,3 @@ int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, str pthread_setcancelstate(cs, 0); return r; } - -weak_alias(nftw, nftw64); diff --git a/src/misc/setrlimit.c b/src/misc/setrlimit.c index 5b713cf3..edb413fa 100644 --- a/src/misc/setrlimit.c +++ b/src/misc/setrlimit.c @@ -49,5 +49,3 @@ int setrlimit(int resource, const struct rlimit *rlim) return __syscall_ret(ret); #endif } - -weak_alias(setrlimit, setrlimit64); -- cgit v1.2.3-70-g09d2