Merge ~liushuyu-011/ubuntu/+source/dpkg:ubuntu/noble-devel into ubuntu/+source/dpkg:ubuntu/noble-devel

Proposed by Zixing Liu
Status: Merged
Merge reported by: Zixing Liu
Merged at revision: 78e48fcbfcf09f9961841164d12a025de56ef865
Proposed branch: ~liushuyu-011/ubuntu/+source/dpkg:ubuntu/noble-devel
Merge into: ubuntu/+source/dpkg:ubuntu/noble-devel
Diff against target: 125 lines (+44/-0)
6 files modified
debian/changelog (+13/-0)
man/dpkg-buildflags.pod (+10/-0)
scripts/Dpkg/BuildFlags.pm (+2/-0)
scripts/Dpkg/Vendor/Ubuntu.pm (+13/-0)
scripts/mk/buildflags.mk (+4/-0)
scripts/t/mk/buildflags.mk (+2/-0)
Reviewer Review Type Date Requested Status
Steve Langasek (community) Approve
Benjamin Drung (community) Needs Fixing
Review via email: mp+473940@code.launchpad.net

Description of the change

This merge proposal backports the frame-pointer enablement logic to Noble for Rust toolchains.

To post a comment you must log in.
Revision history for this message
Benjamin Drung (bdrung) wrote :

There is no bug reference in d/changelog and 1.22.6ubuntu6.2 would be a more consistent choice.

review: Needs Fixing
Revision history for this message
Zixing Liu (liushuyu-011) wrote :

> There is no bug reference in d/changelog and 1.22.6ubuntu6.2 would be a more consistent choice.

Done now

Revision history for this message
Benjamin Drung (bdrung) wrote :

The documentation mentions 1.22.6ubuntu12 a lot, but since that is part of the SRU 1.22.6ubuntu6.2 should probably mentioned as well, shouldn't it?

55afb53... by Zixing Liu

replaces mainline version number 1.22.6ubuntu12 with 1.22.6ubuntu6.2

in the documentation

Revision history for this message
Zixing Liu (liushuyu-011) wrote :

> The documentation mentions 1.22.6ubuntu12 a lot, but since that is part of the SRU 1.22.6ubuntu6.2 should probably mentioned as well, shouldn't it?

Version numbers replaced.

Revision history for this message
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 9d5169b..6bc9a1c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
1dpkg (1.22.6ubuntu6.2) noble; urgency=medium
2
3 [ Zixing Liu ]
4 * Add RUSTFLAGS to define frame pointers for Rust toolchain (LP: #2082636).
5 * Replaces mainline version number 1.22.6ubuntu12 with 1.22.6ubuntu6.2 in
6 the documentation to avoid confusion with backported version.
7
8 [ Benjamin Drung ]
9 * buildflags: document RUSTFLAGS
10 * buildflags: Always set RUSTFLAGS
11
12 -- Zixing Liu <zixing.liu@canonical.com> Thu, 26 Sep 2024 13:14:01 -0600
13
1dpkg (1.22.6ubuntu6.1) noble-security; urgency=medium14dpkg (1.22.6ubuntu6.1) noble-security; urgency=medium
215
3 * SRU:16 * SRU:
diff --git a/man/dpkg-buildflags.pod b/man/dpkg-buildflags.pod
index af2198d..72bb0ab 100644
--- a/man/dpkg-buildflags.pod
+++ b/man/dpkg-buildflags.pod
@@ -319,6 +319,11 @@ Options for the host Fortran 9x compiler.
319Same as B<FFLAGS>.319Same as B<FFLAGS>.
320Since dpkg 1.17.7.320Since dpkg 1.17.7.
321321
322=item B<RUSTFLAGS>
323
324Options for the host Rust compiler (rustc).
325Since dpkg 1.22.6ubuntu6.2.
326
322=item B<LDFLAGS>327=item B<LDFLAGS>
323328
324Options passed to the host compiler when linking executables or shared329Options passed to the host compiler when linking executables or shared
@@ -392,6 +397,11 @@ be stripped from these options).
392Default value: empty.397Default value: empty.
393Since dpkg 1.22.1.398Since dpkg 1.22.1.
394399
400=item B<RUSTFLAGS_FOR_BUILD>
401
402Options for the build Rust compiler (rustc).
403Since dpkg 1.22.6ubuntu6.2.
404
395=back405=back
396406
397New flags might be added in the future if the need arises (for example407New flags might be added in the future if the need arises (for example
diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm
index 8aff53e..ba01c25 100644
--- a/scripts/Dpkg/BuildFlags.pm
+++ b/scripts/Dpkg/BuildFlags.pm
@@ -94,6 +94,8 @@ sub _init_vendor_defaults {
94 FCFLAGS_FOR_BUILD94 FCFLAGS_FOR_BUILD
95 LDFLAGS95 LDFLAGS
96 LDFLAGS_FOR_BUILD96 LDFLAGS_FOR_BUILD
97 RUSTFLAGS
98 RUSTFLAGS_FOR_BUILD
97 );99 );
98100
99 $self->{features} = {};101 $self->{features} = {};
diff --git a/scripts/Dpkg/Vendor/Ubuntu.pm b/scripts/Dpkg/Vendor/Ubuntu.pm
index 383d5cc..ca0c531 100644
--- a/scripts/Dpkg/Vendor/Ubuntu.pm
+++ b/scripts/Dpkg/Vendor/Ubuntu.pm
@@ -215,6 +215,19 @@ sub add_build_flags {
215 # Per https://wiki.ubuntu.com/DistCompilerFlags215 # Per https://wiki.ubuntu.com/DistCompilerFlags
216 $flags->prepend('LDFLAGS', '-Wl,-Bsymbolic-functions');216 $flags->prepend('LDFLAGS', '-Wl,-Bsymbolic-functions');
217217
218 # Add Rust flags
219 $flags->append('RUSTFLAGS', '');
220 $flags->append('RUSTFLAGS_FOR_BUILD', '');
221 # Rust frame pointer switch
222 if ($flags->use_feature('qa', 'framepointer')) {
223 my $arch = Dpkg::Arch::get_host_arch();
224 if (Dpkg::Arch::debarch_eq($arch, 's390x')) {
225 $flags->append('RUSTFLAGS', '-Ctarget-feature=+backchain');
226 } else {
227 $flags->append('RUSTFLAGS', '-Cforce-frame-pointers=yes');
228 }
229 }
230
218 # In Ubuntu these flags are set by the compiler, so when disabling the231 # In Ubuntu these flags are set by the compiler, so when disabling the
219 # features we need to pass appropriate flags to disable them.232 # features we need to pass appropriate flags to disable them.
220 if (!$flags->use_feature('hardening', 'stackprotectorstrong') &&233 if (!$flags->use_feature('hardening', 'stackprotectorstrong') &&
diff --git a/scripts/mk/buildflags.mk b/scripts/mk/buildflags.mk
index 6d9bacd..deb0d5f 100644
--- a/scripts/mk/buildflags.mk
+++ b/scripts/mk/buildflags.mk
@@ -11,6 +11,7 @@
11# FFLAGS: flags for the host Fortran 77 compiler.11# FFLAGS: flags for the host Fortran 77 compiler.
12# FCFLAGS: flags for the host Fortran 9x compiler.12# FCFLAGS: flags for the host Fortran 9x compiler.
13# LDFLAGS: flags for the host linker.13# LDFLAGS: flags for the host linker.
14# RUSTFLAGS: flags for the host Rust compiler (since 1.22.6ubuntu6.2).
14#15#
15# And the following variables for the build tools (since dpkg 1.22.1):16# And the following variables for the build tools (since dpkg 1.22.1):
16#17#
@@ -24,6 +25,7 @@
24# FFLAGS_FOR_BUILD: flags for the build Fortran 77 compiler.25# FFLAGS_FOR_BUILD: flags for the build Fortran 77 compiler.
25# FCFLAGS_FOR_BUILD: flags for the build Fortran 9x compiler.26# FCFLAGS_FOR_BUILD: flags for the build Fortran 9x compiler.
26# LDFLAGS_FOR_BUILD: flags for the build linker.27# LDFLAGS_FOR_BUILD: flags for the build linker.
28# RUSTFLAGS_FOR_BUILD: flags for the build Rust compiler (since 1.22.6ubuntu6.2).
27#29#
28# You can also export them in the environment by setting30# You can also export them in the environment by setting
29# DPKG_EXPORT_BUILDFLAGS to a non-empty value.31# DPKG_EXPORT_BUILDFLAGS to a non-empty value.
@@ -54,6 +56,8 @@ DPKG_BUILDFLAGS_LIST = \
54 FCFLAGS_FOR_BUILD \56 FCFLAGS_FOR_BUILD \
55 LDFLAGS \57 LDFLAGS \
56 LDFLAGS_FOR_BUILD \58 LDFLAGS_FOR_BUILD \
59 RUSTFLAGS \
60 RUSTFLAGS_FOR_BUILD \
57 # EOL61 # EOL
5862
59define dpkg_buildflags_export_envvar63define dpkg_buildflags_export_envvar
diff --git a/scripts/t/mk/buildflags.mk b/scripts/t/mk/buildflags.mk
index 94d85a7..ca321b9 100644
--- a/scripts/t/mk/buildflags.mk
+++ b/scripts/t/mk/buildflags.mk
@@ -24,3 +24,5 @@ test:
24 test "$(OBJCFLAGS_FOR_BUILD)" = "$(TEST_OBJCFLAGS_FOR_BUILD)"24 test "$(OBJCFLAGS_FOR_BUILD)" = "$(TEST_OBJCFLAGS_FOR_BUILD)"
25 test "$(OBJCXXFLAGS)" = "$(TEST_OBJCXXFLAGS)"25 test "$(OBJCXXFLAGS)" = "$(TEST_OBJCXXFLAGS)"
26 test "$(OBJCXXFLAGS_FOR_BUILD)" = "$(TEST_OBJCXXFLAGS_FOR_BUILD)"26 test "$(OBJCXXFLAGS_FOR_BUILD)" = "$(TEST_OBJCXXFLAGS_FOR_BUILD)"
27 test "$(RUSTFLAGS)" = "$(TEST_RUSTFLAGS)"
28 test "$(RUSTFLAGS_FOR_BUILD)" = "$(TEST_RUSTFLAGS_FOR_BUILD)"

Subscribers

People subscribed via source and target branches