@@ -96,9 +96,13 @@ common --enable_platform_specific_config
9696# macOS: boost.stacktrace needs this since backtrace() doesn't require GNU source
9797build:macos --copt=-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
9898build:macos --host_copt=-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
99- # Aligned allocation/deallocation for abseil is only available since 10.13
100- build:macos --macos_minimum_os=10.13
101- build:macos --host_macos_minimum_os=10.13
99+ # Floating-point std::to_chars (behind std::format, used by OpenSTA)
100+ # needs macOS 13.3; std::filesystem (src/tcl_readline_setup.cc) needs
101+ # 10.15; abseil's aligned allocation needs 10.13. The historical 10.13
102+ # floor was never enforced: toolchains_llvm ignored it and compiled
103+ # against the host SDK's default. hermetic-llvm honors it.
104+ build:macos --macos_minimum_os=13.3
105+ build:macos --host_macos_minimum_os=13.3
102106
103107# Settings for --config=asan address sanitizer build
104108build:asan --strip=never
@@ -108,6 +112,11 @@ build:asan --copt=-O1
108112build:asan --copt=-g
109113build:asan --copt=-fno-omit-frame-pointer
110114build:asan --linkopt=-fsanitize=address
115+ # TCMalloc is incompatible with ASan: __asan_init's interceptor setup calls
116+ # dlsym -> malloc before TCMalloc is initialized, segfaulting at startup.
117+ # Override the per-target malloc attribute to use the system allocator, which
118+ # ASan intercepts cleanly.
119+ build:asan --custom_malloc=@bazel_tools//tools/cpp:malloc
111120
112121# Flags with enough debug symbols to get useful outputs with Linux `perf`
113122build:profile --strip=never
@@ -118,6 +127,9 @@ build:profile --copt -fno-omit-frame-pointer --host_copt -fno-omit-frame-pointer
118127# Improve hermeticity by disallowing user envars and network access
119128build --incompatible_strict_action_env
120129build --nosandbox_default_allow_network
130+ # Refuse to autodetect a local C++ toolchain (/usr/bin/gcc); the hermetic
131+ # toolchain must win resolution, with or without the etc/bazel-hermetic wrapper.
132+ common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
121133
122134test --build_tests_only
123135
@@ -137,6 +149,11 @@ build:ci --disk_cache=
137149# Tell the 'ci' config to include 'opt'
138150build:ci --config=opt
139151
152+ # Launch py_binary via a shell stub instead of rules_python's legacy python
153+ # stub, whose '#!/usr/bin/env python3' shebang needs a host python3 before
154+ # the hermetic interpreter takes over (found by etc/bazel-hermetic).
155+ common --@rules_python//python/config_settings:bootstrap_impl=script
156+
140157# Setup remote cache
141158# Anon: HTTPS read-only cache
142159build --remote_cache=https://bazel.precisioninno.com
0 commit comments