diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | man/dpkg-buildflags.man | 12 | ||||
-rw-r--r-- | scripts/Dpkg/BuildFlags.pm | 6 | ||||
-rw-r--r-- | scripts/Dpkg/Vendor/Debian.pm | 15 |
4 files changed, 32 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index fa941b3ed..79657a1b7 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 6bfd059f0..541132e0b 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 b97e5c779..0533b12b5 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 4b5436ee1..e0fd01113 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. |