Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ build --@rules_rust//:extra_rustc_flag="-Ccodegen-units=64"
# just `.rmeta` instead of the full `.rlib`.
build --@rules_rust//rust/settings:pipelined_compilation=True

# Enforce frame pointers everywhere. We rely on them for collecting backtraces.
build --@rules_rust//:extra_rustc_flag="-Cforce-frame-pointers=yes"
build --copt=-fno-omit-frame-pointer

# `cargo check` like config, still experimental!
#
# Ignores all outputs other than `.rmeta`, requires pipelied_compilation to be enabled!
Expand Down
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rustflags = [
"-Clink-arg=-Wl,-O3",
"-Clink-arg=-fuse-ld=lld",
"-Csymbol-mangling-version=v0",
"-Cforce-frame-pointers=yes",
"--cfg=tokio_unstable",
]

Expand All @@ -34,6 +35,7 @@ rustflags = [
"-Clink-arg=-Wl,-O3",
"-Clink-arg=-fuse-ld=lld",
"-Csymbol-mangling-version=v0",
"-Cforce-frame-pointers=yes",
"--cfg=tokio_unstable",
]

Expand Down
16 changes: 3 additions & 13 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ http_archive(
LLVM_VERSION = "19.1.6"

# We have a few variants of our clang toolchain, either improving how it's built or adding new tools.
LLVM_VERSION_SUFFIX = "1"
LLVM_VERSION_SUFFIX = "1.alpha"

# Version of the "toolchains_llvm" rule set, _not_ the version of clang/llvm.
#
Expand All @@ -250,21 +250,13 @@ load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
llvm_toolchain(
name = "llvm_toolchain",
llvm_version = LLVM_VERSION,
sha256 = {
"darwin-aarch64": "94ed965925dbdc25b29e6fcfa9a84b28d915d5c9da7c71405fc20bbcf8396bd1",
"darwin-x86_64": "9395b07fd5018816bcaee84522d9c9386fdbefe62fdf8afff89b57e1b7095463",
"linux-aarch64": "24fd3405f65ccbc39f0d14a5126ee2edb5904d7a9525ae483f34a510a1bdce3e",
"linux-x86_64": "bad3d776c222c99056eba8b64c085a1e08edd783cb102e1b6eba43b78ce2fe2b",
},
sysroot = {
"darwin-aarch64": "@sysroot_darwin_universal//:sysroot",
"darwin-x86_64": "@sysroot_darwin_universal//:sysroot",
"linux-x86_64": "@linux_sysroot-x86_64//:sysroot",
"linux-aarch64": "@linux_sysroot-aarch64//:sysroot",
},
urls = {
"darwin-aarch64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-{0}-{1}/darwin_aarch64.tar.zst".format(LLVM_VERSION, LLVM_VERSION_SUFFIX)],
"darwin-x86_64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-{0}-{1}/darwin_x86_64.tar.zst".format(LLVM_VERSION, LLVM_VERSION_SUFFIX)],
"linux-aarch64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-{0}-{1}/linux_aarch64.tar.zst".format(LLVM_VERSION, LLVM_VERSION_SUFFIX)],
"linux-x86_64": ["https://github.com/MaterializeInc/toolchains/releases/download/clang-{0}-{1}/linux_x86_64.tar.zst".format(LLVM_VERSION, LLVM_VERSION_SUFFIX)],
},
Expand Down Expand Up @@ -436,10 +428,8 @@ rust_bindgen_dependencies()
bindgen_toolchains(
"{0}-{1}".format(LLVM_VERSION, LLVM_VERSION_SUFFIX),
{
"darwin_aarch64": "sha256-wni7a1Wu6qGeNVOZOjc6ks1ACXf+RBoXu6YcSVkleos=",
"darwin_x86_64": "sha256-MKjPkNE2g2nw75SkOvjnieKnTtubUKyE3/o7olQm8j0=",
"linux_aarch64": "sha256-BvzsXMuiObNStcP86QwgBRDcTVBRsWUYio1iRCMhgxo=",
"linux_x86_64": "sha256-9PgulfHhsOd03ZhEO7ljp2EuDafIbME1oCJ/Rj/R7pU=",
"linux_aarch64": None,
"linux_x86_64": None,
},
)

Expand Down
2 changes: 1 addition & 1 deletion ci/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ ENV CC=$ARCH_GCC-unknown-linux-gnu-cc
ENV CXX=$ARCH_GCC-unknown-linux-gnu-c++
ENV CXXSTDLIB=static=stdc++
ENV LDFLAGS="-fuse-ld=lld -static-libstdc++"
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"
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"
ENV TARGET_AR=$AR
ENV TARGET_CC=$CC
ENV TARGET_CXX=$CXX
Expand Down
3 changes: 3 additions & 0 deletions misc/bazel/c_deps/BUILD.jemalloc.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ CONFIGURE_OPTIONS = [
"--enable-prof",
"--enable-stats",
"--with-malloc-conf=background_thread:true",
# Workaround to avoid deadlocking when jemalloc profiling causes nested
# backtrace collection. See database-issues#9159.
"--disable-prof-libgcc",
]

configure_make(
Expand Down
1 change: 1 addition & 0 deletions misc/python/materialize/xcompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def cargo(
"-Clink-arg=-Wl,--compress-debug-sections=zlib",
"-Clink-arg=-Wl,-O3",
"-Csymbol-mangling-version=v0",
"-Cforce-frame-pointers=yes",
"--cfg=tokio_unstable",
]

Expand Down
2 changes: 1 addition & 1 deletion src/prof/src/jemalloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use tikv_jemalloc_ctl::{epoch, stats};

#[allow(non_upper_case_globals)]
#[unsafe(export_name = "malloc_conf")]
pub static malloc_conf: &[u8] = b"prof:true,prof_active:true,lg_prof_sample:19\0";
pub static malloc_conf: &[u8] = b"prof:true,prof_active:true,lg_prof_sample:10\0";

#[derive(Copy, Clone, Debug)]
pub struct JemallocProfMetadata {
Expand Down