Skip to content
Snippets Groups Projects
Commit 372d2a73 authored by Guillem Jover's avatar Guillem Jover
Browse files

Dpkg::Vendor::Ubuntu: Use new build flag option override support to set -O3

parent 1e0f6d9c
No related branches found
No related tags found
1 merge request!4Update crimson to version from bookworm
......@@ -99,23 +99,6 @@ sub run_hook {
# Run the Debian hook to add hardening flags
$self->SUPER::run_hook($hook, $flags);
require Dpkg::BuildOptions;
my $build_opts = Dpkg::BuildOptions->new();
if (!$build_opts->has('noopt')) {
require Dpkg::Arch;
my $arch = Dpkg::Arch::get_host_arch();
if ($arch eq 'ppc64el') {
for my $flag (qw(CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS GCJFLAGS
FFLAGS FCFLAGS)) {
my $value = $flags->get($flag);
$value =~ s/-O[0-9]/-O3/;
$flags->set($flag, $value);
}
}
}
# Per https://wiki.ubuntu.com/DistCompilerFlags
$flags->prepend('LDFLAGS', '-Wl,-Bsymbolic-functions');
} else {
......@@ -123,6 +106,20 @@ sub run_hook {
}
}
# Override Debian default features.
sub set_build_features {
my ($self, $flags) = @_;
$self->SUPER::set_build_features($flags);
require Dpkg::Arch;
my $arch = Dpkg::Arch::get_host_arch();
if ($arch eq 'ppc64el' && $flags->get_option_value('optimize-level') != 0) {
$flags->set_option_value('optimize-level', 3);
}
}
=head1 PUBLIC FUNCTIONS
=over
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment