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
1diff --git a/debian/changelog b/debian/changelog
2index 9d5169b..6bc9a1c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,16 @@
6+dpkg (1.22.6ubuntu6.2) noble; urgency=medium
7+
8+ [ Zixing Liu ]
9+ * Add RUSTFLAGS to define frame pointers for Rust toolchain (LP: #2082636).
10+ * Replaces mainline version number 1.22.6ubuntu12 with 1.22.6ubuntu6.2 in
11+ the documentation to avoid confusion with backported version.
12+
13+ [ Benjamin Drung ]
14+ * buildflags: document RUSTFLAGS
15+ * buildflags: Always set RUSTFLAGS
16+
17+ -- Zixing Liu <zixing.liu@canonical.com> Thu, 26 Sep 2024 13:14:01 -0600
18+
19 dpkg (1.22.6ubuntu6.1) noble-security; urgency=medium
20
21 * SRU:
22diff --git a/man/dpkg-buildflags.pod b/man/dpkg-buildflags.pod
23index af2198d..72bb0ab 100644
24--- a/man/dpkg-buildflags.pod
25+++ b/man/dpkg-buildflags.pod
26@@ -319,6 +319,11 @@ Options for the host Fortran 9x compiler.
27 Same as B<FFLAGS>.
28 Since dpkg 1.17.7.
29
30+=item B<RUSTFLAGS>
31+
32+Options for the host Rust compiler (rustc).
33+Since dpkg 1.22.6ubuntu6.2.
34+
35 =item B<LDFLAGS>
36
37 Options passed to the host compiler when linking executables or shared
38@@ -392,6 +397,11 @@ be stripped from these options).
39 Default value: empty.
40 Since dpkg 1.22.1.
41
42+=item B<RUSTFLAGS_FOR_BUILD>
43+
44+Options for the build Rust compiler (rustc).
45+Since dpkg 1.22.6ubuntu6.2.
46+
47 =back
48
49 New flags might be added in the future if the need arises (for example
50diff --git a/scripts/Dpkg/BuildFlags.pm b/scripts/Dpkg/BuildFlags.pm
51index 8aff53e..ba01c25 100644
52--- a/scripts/Dpkg/BuildFlags.pm
53+++ b/scripts/Dpkg/BuildFlags.pm
54@@ -94,6 +94,8 @@ sub _init_vendor_defaults {
55 FCFLAGS_FOR_BUILD
56 LDFLAGS
57 LDFLAGS_FOR_BUILD
58+ RUSTFLAGS
59+ RUSTFLAGS_FOR_BUILD
60 );
61
62 $self->{features} = {};
63diff --git a/scripts/Dpkg/Vendor/Ubuntu.pm b/scripts/Dpkg/Vendor/Ubuntu.pm
64index 383d5cc..ca0c531 100644
65--- a/scripts/Dpkg/Vendor/Ubuntu.pm
66+++ b/scripts/Dpkg/Vendor/Ubuntu.pm
67@@ -215,6 +215,19 @@ sub add_build_flags {
68 # Per https://wiki.ubuntu.com/DistCompilerFlags
69 $flags->prepend('LDFLAGS', '-Wl,-Bsymbolic-functions');
70
71+ # Add Rust flags
72+ $flags->append('RUSTFLAGS', '');
73+ $flags->append('RUSTFLAGS_FOR_BUILD', '');
74+ # Rust frame pointer switch
75+ if ($flags->use_feature('qa', 'framepointer')) {
76+ my $arch = Dpkg::Arch::get_host_arch();
77+ if (Dpkg::Arch::debarch_eq($arch, 's390x')) {
78+ $flags->append('RUSTFLAGS', '-Ctarget-feature=+backchain');
79+ } else {
80+ $flags->append('RUSTFLAGS', '-Cforce-frame-pointers=yes');
81+ }
82+ }
83+
84 # In Ubuntu these flags are set by the compiler, so when disabling the
85 # features we need to pass appropriate flags to disable them.
86 if (!$flags->use_feature('hardening', 'stackprotectorstrong') &&
87diff --git a/scripts/mk/buildflags.mk b/scripts/mk/buildflags.mk
88index 6d9bacd..deb0d5f 100644
89--- a/scripts/mk/buildflags.mk
90+++ b/scripts/mk/buildflags.mk
91@@ -11,6 +11,7 @@
92 # FFLAGS: flags for the host Fortran 77 compiler.
93 # FCFLAGS: flags for the host Fortran 9x compiler.
94 # LDFLAGS: flags for the host linker.
95+# RUSTFLAGS: flags for the host Rust compiler (since 1.22.6ubuntu6.2).
96 #
97 # And the following variables for the build tools (since dpkg 1.22.1):
98 #
99@@ -24,6 +25,7 @@
100 # FFLAGS_FOR_BUILD: flags for the build Fortran 77 compiler.
101 # FCFLAGS_FOR_BUILD: flags for the build Fortran 9x compiler.
102 # LDFLAGS_FOR_BUILD: flags for the build linker.
103+# RUSTFLAGS_FOR_BUILD: flags for the build Rust compiler (since 1.22.6ubuntu6.2).
104 #
105 # You can also export them in the environment by setting
106 # DPKG_EXPORT_BUILDFLAGS to a non-empty value.
107@@ -54,6 +56,8 @@ DPKG_BUILDFLAGS_LIST = \
108 FCFLAGS_FOR_BUILD \
109 LDFLAGS \
110 LDFLAGS_FOR_BUILD \
111+ RUSTFLAGS \
112+ RUSTFLAGS_FOR_BUILD \
113 # EOL
114
115 define dpkg_buildflags_export_envvar
116diff --git a/scripts/t/mk/buildflags.mk b/scripts/t/mk/buildflags.mk
117index 94d85a7..ca321b9 100644
118--- a/scripts/t/mk/buildflags.mk
119+++ b/scripts/t/mk/buildflags.mk
120@@ -24,3 +24,5 @@ test:
121 test "$(OBJCFLAGS_FOR_BUILD)" = "$(TEST_OBJCFLAGS_FOR_BUILD)"
122 test "$(OBJCXXFLAGS)" = "$(TEST_OBJCXXFLAGS)"
123 test "$(OBJCXXFLAGS_FOR_BUILD)" = "$(TEST_OBJCXXFLAGS_FOR_BUILD)"
124+ test "$(RUSTFLAGS)" = "$(TEST_RUSTFLAGS)"
125+ test "$(RUSTFLAGS_FOR_BUILD)" = "$(TEST_RUSTFLAGS_FOR_BUILD)"

Subscribers

People subscribed via source and target branches