Skip to content

Commit 5891b11

Browse files
committed
Force frame pointers in Rust code
1 parent e266fe6 commit 5891b11

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ build --@rules_rust//:extra_rustc_flag="-Ccodegen-units=64"
144144
# just `.rmeta` instead of the full `.rlib`.
145145
build --@rules_rust//rust/settings:pipelined_compilation=True
146146

147+
# Enforce frame pointers everywhere. We rely on them for collecting backtraces.
148+
build --@rules_rust//:extra_rustc_flag="-Cforce-frame-pointers=yes"
149+
build --copt=-fno-omit-frame-pointer
150+
147151
# `cargo check` like config, still experimental!
148152
#
149153
# Ignores all outputs other than `.rmeta`, requires pipelied_compilation to be enabled!

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ rustflags = [
1717
"-Clink-arg=-Wl,-O3",
1818
"-Clink-arg=-fuse-ld=lld",
1919
"-Csymbol-mangling-version=v0",
20+
"-Cforce-frame-pointers=yes",
2021
"--cfg=tokio_unstable",
2122
]
2223

@@ -34,6 +35,7 @@ rustflags = [
3435
"-Clink-arg=-Wl,-O3",
3536
"-Clink-arg=-fuse-ld=lld",
3637
"-Csymbol-mangling-version=v0",
38+
"-Cforce-frame-pointers=yes",
3739
"--cfg=tokio_unstable",
3840
]
3941

ci/builder/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ ENV CC=$ARCH_GCC-unknown-linux-gnu-cc
414414
ENV CXX=$ARCH_GCC-unknown-linux-gnu-c++
415415
ENV CXXSTDLIB=static=stdc++
416416
ENV LDFLAGS="-fuse-ld=lld -static-libstdc++"
417-
ENV RUSTFLAGS="-Clink-arg=-Wl,--compress-debug-sections=zlib -Clink-arg=-Wl,-O3 -Clink-arg=-fuse-ld=lld -L/opt/x-tools/$ARCH_GCC-unknown-linux-gnu/$ARCH_GCC-unknown-linux-gnu/sysroot/lib/ -Csymbol-mangling-version=v0 --cfg=tokio_unstable"
417+
ENV RUSTFLAGS="-Clink-arg=-Wl,--compress-debug-sections=zlib -Clink-arg=-Wl,-O3 -Clink-arg=-fuse-ld=lld -L/opt/x-tools/$ARCH_GCC-unknown-linux-gnu/$ARCH_GCC-unknown-linux-gnu/sysroot/lib/ -Csymbol-mangling-version=v0 -Cforce-frame-pointers=yes --cfg=tokio_unstable"
418418
ENV TARGET_AR=$AR
419419
ENV TARGET_CC=$CC
420420
ENV TARGET_CXX=$CXX

misc/python/materialize/xcompile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def cargo(
153153
"-Clink-arg=-Wl,--compress-debug-sections=zlib",
154154
"-Clink-arg=-Wl,-O3",
155155
"-Csymbol-mangling-version=v0",
156+
"-Cforce-frame-pointers=yes",
156157
"--cfg=tokio_unstable",
157158
]
158159

0 commit comments

Comments
 (0)