[dpkg] 160/192: dpkg-buildflags: Add support for new future feature area
Ximin Luo
infinity0 at debian.org
Tue Oct 17 11:04:13 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch pu/reproducible_builds
in repository dpkg.
commit d917dd74cfb8c78f7a99a7e02d4098866f3f763d
Author: Guillem Jover <guillem at debian.org>
Date: Mon Sep 18 03:02:58 2017 +0200
dpkg-buildflags: Add support for new future feature area
This new area includes an lfs feature, to be used instead of the
getconf(1) interfaces which cannot support cross-building.
---
debian/changelog | 3 +++
man/dpkg-buildflags.man | 12 +++++++++++-
scripts/Dpkg/BuildFlags.pm | 6 +++---
scripts/Dpkg/Vendor/Debian.pm | 15 +++++++++++++++
4 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index fa941b3..79657a1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,6 +37,9 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
file, and will also be used to initialize the new source:Synopsis and
source:Extended-Description substvars that will be available when
generating the DEBIAN/control and .changes files. Closes: #555743
+ * Add new “future” feature area in dpkg-buildflags:
+ - Add new «lfs» feature, to be used instead of the getconf(1) interface
+ which cannot support cross-building.
* Perl modules:
- Switch from Dpkg::Util to List::Util, now that the module in the
new required Perl contains the needed functions.
diff --git a/man/dpkg-buildflags.man b/man/dpkg-buildflags.man
index 6bfd059..541132e 100644
--- a/man/dpkg-buildflags.man
+++ b/man/dpkg-buildflags.man
@@ -167,7 +167,7 @@ For example:
.BI \-\-query\-features " area"
Print the features enabled for a given area (since dpkg 1.16.2).
The only currently recognized
-areas on Debian and derivatives are \fBqa\fP, \fBreproducible\fP,
+areas on Debian and derivatives are \fBfuture\fP, \fBqa\fP, \fBreproducible\fP,
\fBsanitize\fP and \fBhardening\fP, see the \fBFEATURE AREAS\fP
section for more details.
Exits with 0 if the area is known otherwise exits with 1.
@@ -246,6 +246,16 @@ Thus disabling everything in the \fBhardening\fP area and enabling only
.P
export DEB_BUILD_MAINT_OPTIONS=hardening=\-all,+format,+fortify
.
+.SS future
+Several compile-time options (detailed below) can be used to enable features
+that should be enabled by default, but cannot due to backwards compatibility
+reasons.
+.TP
+.B lfs
+This setting (disabled by default) enables Large File Support on 32-bit
+architectures where their ABI does not include LFS by default, by adding
+\fB-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64\fP to \fBCPPFLAGS\fP
+.
.SS qa
Several compile-time options (detailed below) can be used to help detect
problems in the source code or build system.
diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm
index b97e5c7..0533b12 100644
--- a/scripts/Dpkg/BuildFlags.pm
+++ b/scripts/Dpkg/BuildFlags.pm
@@ -237,7 +237,7 @@ sub set {
Update the boolean state of whether a specific feature within a known
feature area has been enabled. The only currently known feature areas
-are "qa", "sanitize", "hardening" and "reproducible".
+are "future", "qa", "sanitize", "hardening" and "reproducible".
=cut
@@ -409,8 +409,8 @@ sub is_maintainer_modified {
=item $bf->has_features($area)
Returns true if the given area of features is known, and false otherwise.
-The only currently recognized feature areas are "qa", "sanitize", "hardening"
-and "reproducible".
+The only currently recognized feature areas are "future", "qa", "sanitize",
+"hardening" and "reproducible".
=cut
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 4b5436e..e0fd011 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -103,6 +103,9 @@ sub _add_build_flags {
# Default feature states.
my %use_feature = (
+ future => {
+ lfs => 0,
+ },
qa => {
bug => 0,
canary => 0,
@@ -153,6 +156,18 @@ sub _add_build_flags {
($abi, $os, $cpu) = ('', '', '');
}
+ ## Area: future
+
+ if ($use_feature{future}{lfs}) {
+ my ($abi_bits, $abi_endian) = Dpkg::Arch::debarch_to_abiattrs($arch);
+ my $cpu_bits = Dpkg::Arch::debarch_to_cpubits($arch);
+
+ if ($abi_bits == 32 and $cpu_bits == 32) {
+ $flags->append('CPPFLAGS',
+ '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64');
+ }
+ }
+
## Area: qa
# Warnings that detect actual bugs.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list