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

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



Hi!

On Mon, 2017-09-04 at 00:23:42 +0200, Boud Roukema wrote:
> 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.

Here's my proposal, let me know if this clarifies it sufficiently. :)

Thanks,
Guillem
From 5960c082e074c31b0bd12281eafba63fd173488f Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Mon, 4 Sep 2017 01:01:36 +0200
Subject: [PATCH 1/2] Revert "Apply patch from Boud Roukema to improve the
 description of the binary-file-built-without-LFS-support tag. (Closes:
 #874078)"

This reverts commit f40064ca2ec72bbed05eba25b87aaea4c13ccb20.

Signed-off-by: Guillem Jover <guillem@debian.org>
---
 checks/binaries.desc | 10 +++-------
 debian/changelog     |  3 ---
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/checks/binaries.desc b/checks/binaries.desc
index 87bbab18d..659c23f10 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -439,15 +439,11 @@ Info: The listed ELF binary appears to be (partially) built without
  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
+ that has been done ensure <tt>_FILE_OFFSET_BITS</tt> is defined and
+ set to 64 before the relevant files are included.  This can be done 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.
+ to <tt>CFLAGS</tt> and <tt>LDFLAGS</tt> respectively.
  .
  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
diff --git a/debian/changelog b/debian/changelog
index 8565bbe08..973ca8491 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,9 +5,6 @@ lintian (2.5.53) UNRELEASED; urgency=medium
   * checks/apache2.pm:
     + [CL] Fix an apache2-unparsable-dependency false positive by allowing
       periods (".") in dependency names.  (Closes: #873701)
-  * checks/binaries.pm:
-    + [CL] Apply patch from Boud Roukema to improve the description of the
-      binary-file-built-without-LFS-support tag.  (Closes: #874078)
   * checks/changes.{pm,desc}:
     + [CL] Ignore DFSG-repacked packages when checking for upstream
       source tarball signatures as they will never match by definition.
-- 
2.14.1

From 84e7f2b0342baace2cc80a43bf7de37b898ad212 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Mon, 4 Sep 2017 01:01:58 +0200
Subject: [PATCH 2/2] c/binaries: Improve LFS tag description

Mention when setting the _FILE_OFFSET_BITS macro is optional, and that
it does not require renaming function names. Mention the option of
providing parallel interfaces with _LARGEFILE64_SOURCE for shared
libraries. Add references to SUSv2 and the glibc manual.

Closes: #874078
Signed-off-by: Guillem Jover <guillem@debian.org>
---
 checks/binaries.desc | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/checks/binaries.desc b/checks/binaries.desc
index 659c23f10..e0731fb06 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -440,10 +440,17 @@ Info: The listed ELF binary appears to be (partially) built without
  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 <tt>_FILE_OFFSET_BITS</tt> is defined and
- set to 64 before the relevant files are included.  This can be done 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.
+ set to 64 before any system headers are included (note that on systems
+ were the ABI has LFS enabled by default, setting <tt>_FILE_OFFSET_BITS</tt>
+ to 64 will be a no-op, and as such optional).  This can be done by using
+ the <tt>AC_SYS_LARGEFILE</tt> macro with autoconf which will set any
+ macro required to enable LFS when necessary, 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.  Using
+ <tt>_FILE_OFFSET_BITS</tt> should require no system function renames (eg.
+ from open(2) to open64(2)), and if this tag is still emitted, the most
+ probable cause is because the macro is not seen by the system code being
+ compiled.
  .
  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
@@ -451,4 +458,10 @@ Info: The listed ELF binary appears to be (partially) built without
  .
  Also note that enabling LFS on a shared library is not always safe as
  it might break ABI in case some of the exported types change size, in
- those cases a SOVERSION bump might be required.
+ those cases a SOVERSION bump might be required.  Or alternatively, on
+ systems with an ABI without LFS, defining <tt>_LARGEFILE64_SOURCE</tt>
+ and exporting both 32 and 64-bit variants of the interfaces can avoid
+ the SOVERSION bump, at the cost of more complex maintenance.
+Ref:
+ https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html,
+ http://www.unix.org/version2/whatsnew/lfs20mar.html
-- 
2.14.1


Reply to: