Build fails as follows with musl: src/portage_util_file_copy_reflink_linux.c:69:36: error: unknown type name ‘loff_t’ cfr_wrapper(int fd_out, int fd_in, loff_t *off_out, size_t len) ^ src/portage_util_file_copy_reflink_linux.c:99:38: error: unknown type name ‘loff_t’ do_lseek_data(int fd_out, int fd_in, loff_t *off_out) { ^ src/portage_util_file_copy_reflink_linux.c: In function ‘_reflink_linux_file_copy’: src/portage_util_file_copy_reflink_linux.c:192:35: error: unknown type name ‘loff_t’ ssize_t (*copyfunc)(int, int, loff_t *, size_t); The problem was initially reported here: https://github.com/gentoo/portage/pull/159
Patch sent for review: https://archives.gentoo.org/gentoo-portage-dev/message/7367ea89eaca61e060b0903fb813fe22 https://github.com/gentoo/portage/pull/161
The patch looks good to me. Actually -D_FILE_OFFSET_BITS=64 suffices, and -D_LARGEFILE_SOURCE and -D_LARGEFILE64_SOURCE are unecessary. See feature_test_macros(7).
(In reply to Felix Janda from comment #2) > The patch looks good to me. Thanks! > Actually -D_FILE_OFFSET_BITS=64 suffices, and -D_LARGEFILE_SOURCE and > -D_LARGEFILE64_SOURCE are unecessary. See feature_test_macros(7). It says new programs should just use -D_FILE_OFFSET_BITS=64, but I wonder if the other macros are useful for prefix, since it might be compiled against an older libc. Ultimately, it would be nice to even support non-Linux platforms.
Older libc (RH/CO/OL5 or 6) yes, non-Linux, I doubt it since this is pretty much linux specific isn't it?
(In reply to Fabian Groffen from comment #4) > Older libc (RH/CO/OL5 or 6) yes Okay, that seems like a good enough reason to cargo cult the old macros. > non-Linux, I doubt it since this is pretty much linux specific isn't it? Maybe we could implement sparse copy for FreeBSD, since its lseek apparently supports SEEK_HOLE and SEEK_DATA: https://www.freebsd.org/cgi/man.cgi?query=lseek&sektion=2 I see that sendfile does not support output to regular files on either FreeBSD or MacOS.
(In reply to Zac Medico from comment #3) > > Actually -D_FILE_OFFSET_BITS=64 suffices, and -D_LARGEFILE_SOURCE and > > -D_LARGEFILE64_SOURCE are unecessary. See feature_test_macros(7). > > It says new programs should just use -D_FILE_OFFSET_BITS=64, but I wonder if > the other macros are useful for prefix, since it might be compiled against > an older libc. Ultimately, it would be nice to even support non-Linux > platforms. Existing autoconf macros are a nice reference here - AC_SYS_LARGEFILE in particular: http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/specific.m4#n128 AIX for example needs _LARGE_FILES.
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1a7aeb58c4e687e4d4012054b56373f27941a067 (In reply to Michael Haubenwallner from comment #6) > Existing autoconf macros are a nice reference here - AC_SYS_LARGEFILE in > particular: >http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/specific.m4#n128 > > AIX for example needs _LARGE_FILES. Okay, looks like we'll probably want to move to autoconf for non-Linux support. Thanks!
Fixed in 2.3.6.