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;