[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#874078: lintian: improve binary-file-built-without-LFS-support info field



At https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871956
Guillem Rover proposes to revert this patch (for bug #874078) and make a better
one.

Just to summarise again the point that to me still seems valid after
Guillem's clarification on p(write|read)(|64): to me it's confusing to
have text that sounds like AC_SYS_LARGEFILE will "ensure" that
_FILE_OFFSET_BITS is set to 64, when at least on amd64, it
does not ensure this.

Proposal: first recommend using AC_SYS_LARGEFILE, and then propose hardwiring
_FILE_OFFSET_BITS to 64 as a fallback or as an alternative for packages
that don't use autotools.

I propose something like:

 To support large files, code review might be needed to make sure that
 those files are not slurped into memory or mmap(2)ed, and that
 correct 64-bit compatible data types are used (ex: off_t instead of
 ssize_t), etc.  Once that has been done, use the
 <tt>AC_SYS_LARGEFILE</tt> macro with autoconf, or append the output
 of <tt>getconf LFS_CFLAGS</tt> and <tt>getconf LFS_LDFLAGS</tt> to
 <tt>CFLAGS</tt> and <tt>LDFLAGS</tt> respectively, or hardwire
 <tt>_FILE_OFFSET_BITS</tt> to be defined and set to 64 before the
 relevant files are included.

But someone (Guillem?) who knows more than me could propose a better wording...

I've attached this as a patch, in case people are happy with this text without
further changes.
--- checks/binaries.desc.old2	2017-09-02 21:57:08.929153000 +0200
+++ checks/binaries.desc	2017-09-04 00:16:58.039294000 +0200
@@ -437,17 +437,14 @@
  files or files with large metadata values (ex: inode numbers) correctly.
  .
  To support large files, code review might be needed to make sure that
- those files are not slurped into memory or mmap(2)ed, and that correct
- 64-bit data types are used (ex: off_t instead of ssize_t), etc.  Once
- that has been done ensure, if needed, that <tt>_FILE_OFFSET_BITS</tt>
- is defined and
- set to 64 before the relevant files are included. This can be done
- conditionally by
- using the <tt>AC_SYS_LARGEFILE</tt> macro with autoconf, or by appending
- the output of <tt>getconf LFS_CFLAGS</tt> and <tt>getconf LFS_LDFLAGS</tt>
- to <tt>CFLAGS</tt> and <tt>LDFLAGS</tt> respectively. Functions such
- as pwrite and pread should be replaced by pwrite64 and pread64 in
- cases where <tt>_FILE_OFFSET_BITS</tt> is defined and set to 64.
+ those files are not slurped into memory or mmap(2)ed, and that
+ correct 64-bit compatible data types are used (ex: off_t instead of
+ ssize_t), etc.  Once that has been done, use the
+ <tt>AC_SYS_LARGEFILE</tt> macro with autoconf, or append the output
+ of <tt>getconf LFS_CFLAGS</tt> and <tt>getconf LFS_LDFLAGS</tt> to
+ <tt>CFLAGS</tt> and <tt>LDFLAGS</tt> respectively, or hardwire
+ <tt>_FILE_OFFSET_BITS</tt> to be defined and set to 64 before the
+ relevant files are included.
  .
  Take into account that even if this tag is not emitted, that does not
  mean the binary is LFS-safe (ie. no OOM conditions, file truncation

Reply to: