This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=36038b2af4e361c712cdbb78d9f7f26d053a0be0 commit 36038b2af4e361c712cdbb78d9f7f26d053a0be0 Author: Guillem Jover <[email protected]> AuthorDate: Sat Dec 10 13:55:26 2022 +0100 Dpkg::BuildFlags: Add support for builtin build flags These denote build flags that might be handled as builtin defaults by the compiler (even if only on a subset of architectures). The current example of such case would be PIE on gcc in Debian. --- scripts/Dpkg/BuildFlags.pm | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm index 3000a73f5..4fe69bbcc 100644 --- a/scripts/Dpkg/BuildFlags.pm +++ b/scripts/Dpkg/BuildFlags.pm @@ -74,6 +74,7 @@ sub _init_vendor_defaults { my $self = shift; $self->{features} = {}; + $self->{builtins} = {}; $self->{optvals} = {}; $self->{flags} = { ASFLAGS => '', @@ -296,6 +297,35 @@ sub use_feature { return 1; } +=item $bf->set_builtin($area, $feature, $enabled) + +Update the boolean state of whether a specific feature within a known +feature area is handled (even if only in some architectures) as a builtin +default by the compiler. + +=cut + +sub set_builtin { + my ($self, $area, $feature, $enabled) = @_; + $self->{builtins}{$area}{$feature} = $enabled; +} + +=item $bf->get_builtins($area) + +Return, for the given area, a hash with keys as feature names, and values +as booleans indicating whether the feature is handled as a builtin default +by the compiler or not. Only features that might be handled as builtins on +some architectures are returned as part of the hash. Missing features mean +they are currently never handled as builtins by the compiler. + +=cut + +sub get_builtins { + my ($self, $area) = @_; + return if ! exists $self->{builtins}{$area}; + return %{$self->{builtins}{$area}}; +} + =item $bf->set_option_value($option, $value) B<Private> method to set the value of a build option. @@ -526,7 +556,8 @@ sub list { New option: 'vendor_defaults' in new(). -New methods: $bf->load_vendor_defaults(), $bf->use_feature(). +New methods: $bf->load_vendor_defaults(), $bf->use_feature(), +$bf->set_builtin(), $bf->get_builtins(). =head2 Version 1.04 (dpkg 1.20.0) -- Dpkg.Org's dpkg

