Package: dpkg
Version: 1.17.5
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: origin-ubuntu trusty ubuntu-patch



In Ubuntu, the attached patch was applied to achieve the following:

  * Update the ppc64 buildflags vendor overrides for ppc64el instead, and
    make the implementation respect DEB_BUILD_OPTIONS=noopt (LP: #1279128)

In bug #612472, Colin submitted a patch to set buildflags on ppc64 in
Ubuntu to -O3.  This turns out to have two fundamental flaws:

1) We never actually shipped a ppc64 distribution.
2) It failed to respect DEB_BUILD_OPTIONS=noopt.

This patch addresses both those issues, by changing ppc64 to ppc64el,
which we are shipping, and falling through gracefully for the noopt case.

It would be lovely if this could be applied to dpkg trunk, so we can
reduce our delta.  Thanks in advance.

... Adam


-- System Information:
Debian Release: jessie/sid
  APT prefers trusty-updates
  APT policy: (500, 'trusty-updates'), (500, 'trusty-security'), (500, 'trusty')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13.0-7-generic (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru dpkg-1.17.5ubuntu3/scripts/Dpkg/Vendor/Ubuntu.pm dpkg-1.17.5ubuntu4/scripts/Dpkg/Vendor/Ubuntu.pm
--- dpkg-1.17.5ubuntu3/scripts/Dpkg/Vendor/Ubuntu.pm	2013-12-09 23:14:22.000000000 -0700
+++ dpkg-1.17.5ubuntu4/scripts/Dpkg/Vendor/Ubuntu.pm	2014-02-11 18:33:52.000000000 -0700
@@ -95,10 +95,13 @@
 
     } elsif ($hook eq 'update-buildflags') {
 	my $flags = shift @params;
+	my $build_opts = Dpkg::BuildOptions->new();
 
-	if (debarch_eq(get_host_arch(), 'ppc64')) {
-	    for my $flag (qw(CFLAGS CXXFLAGS GCJFLAGS FFLAGS)) {
-		$flags->set($flag, '-g -O3', 'vendor');
+	if (!$build_opts->has('noopt')) {
+	    if (debarch_eq(get_host_arch(), 'ppc64el')) {
+		for my $flag (qw(CFLAGS CXXFLAGS GCJFLAGS FFLAGS)) {
+		    $flags->set($flag, '-g -O3', 'vendor');
+		}
 	    }
 	}
 	# Per https://wiki.ubuntu.com/DistCompilerFlags
@@ -108,7 +111,6 @@
 	$self->SUPER::run_hook($hook, $flags);
 
 	# Allow control of hardening-wrapper via dpkg-buildpackage DEB_BUILD_OPTIONS
-	my $build_opts = Dpkg::BuildOptions->new();
 	my $hardening;
 	if ($build_opts->has('hardening')) {
 	    $hardening = $build_opts->get('hardening') // 1;

Reply via email to