Explorar el Código

Dpkg::Vendor::Ubuntu: Update ppc64el build flags support

Ubuntu never ended up shipping a ppc64 architecture, instead they have
a ppc64el one, so switch to that. And honor the noopt DEB_BUILD_OPTIONS
flag.

Closes: #738691

Signed-off-by: Guillem Jover <guillem@debian.org>
Adam Conrad hace 12 años
padre
commit
bbaa8eabaf
Se han modificado 2 ficheros con 9 adiciones y 4 borrados
  1. 3 0
      debian/changelog
  2. 6 4
      scripts/Dpkg/Vendor/Ubuntu.pm

+ 3 - 0
debian/changelog

@@ -43,6 +43,9 @@ dpkg (1.17.7) UNRELEASED; urgency=low
   * If the vendor does not have a Dpkg::Vendor module, try loading a module
     from the parent vendors, before falling back to Dpkg::Vendor::Default.
     Closes: #735978
+  * Set Ubuntu build flags for ppc64el instead of ppc64, as Ubuntu never ended
+    up shipping a ppc64 architecture. Also honor noopt DEB_BUILD_OPTIONS flag.
+    Thanks to Adam Conrad <adconrad@debian.org. Closes: #738691
 
   [ Updated dpkg translations ]
   * German (Sven Joachim).

+ 6 - 4
scripts/Dpkg/Vendor/Ubuntu.pm

@@ -95,10 +95,13 @@ sub run_hook {
 
     } 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 @@ sub run_hook {
 	$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;