remove LFS64 symbol aliases; replace with dynamic linker remapping
authorRich Felker <dalias@aerifal.cx>
Mon, 26 Sep 2022 21:14:18 +0000 (17:14 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 19 Oct 2022 18:01:31 +0000 (14:01 -0400)
commit246f1c811448f37a44b41cd8df8d0ef9736d95f4
tree30e9e8c314b98c4004472b8fd49d21175a075946
parentdec8f0a4fa7aa533c843e6eaec862be674ff3a1a
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.
57 files changed:
compat/time32/__xstat.c
compat/time32/aio_suspend_time32.c
compat/time32/fstat_time32.c
compat/time32/fstatat_time32.c
compat/time32/lstat_time32.c
compat/time32/stat_time32.c
ldso/dynlink.c
src/aio/aio.c
src/aio/aio_suspend.c
src/aio/lio_listio.c
src/dirent/alphasort.c
src/dirent/readdir.c
src/dirent/readdir_r.c
src/dirent/scandir.c
src/dirent/versionsort.c
src/fcntl/creat.c
src/fcntl/open.c
src/fcntl/openat.c
src/fcntl/posix_fadvise.c
src/fcntl/posix_fallocate.c
src/legacy/ftw.c
src/linux/fallocate.c
src/linux/getdents.c
src/linux/prlimit.c
src/linux/sendfile.c
src/misc/getrlimit.c
src/misc/lockf.c
src/misc/nftw.c
src/misc/setrlimit.c
src/mman/mmap.c
src/regex/glob.c
src/stat/__xstat.c
src/stat/fstat.c
src/stat/fstatat.c
src/stat/lstat.c
src/stat/stat.c
src/stat/statvfs.c
src/stdio/fgetpos.c
src/stdio/fopen.c
src/stdio/freopen.c
src/stdio/fseek.c
src/stdio/fsetpos.c
src/stdio/ftell.c
src/stdio/tmpfile.c
src/temp/mkostemp.c
src/temp/mkostemps.c
src/temp/mkstemp.c
src/temp/mkstemps.c
src/unistd/ftruncate.c
src/unistd/lseek.c
src/unistd/mipsn32/lseek.c
src/unistd/pread.c
src/unistd/preadv.c
src/unistd/pwrite.c
src/unistd/pwritev.c
src/unistd/truncate.c
src/unistd/x32/lseek.c