@@ -34,8 +34,35 @@ bazel_dep(name = "rules_python", version = "1.8.5")
3434bazel_dep (name = "rules_shell" , version = "0.6.1" )
3535bazel_dep (name = "swig" , version = "4.3.0.bcr.2" )
3636
37+ # bison is transitive (rules_bison -> bison). Same gnulib libc-header
38+ # shadowing class as sed/gawk/m4 under hermetic-llvm (BCR #7642).
39+ # 3.8.2.bcr.7 fixes lib/ but src/ still picks up raw libc headers; the
40+ # patch restores gnulib wrapper-header precedence via -I (to be proposed
41+ # upstream as 3.8.2.bcr.8, then drop).
42+ single_version_override (
43+ module_name = "bison" ,
44+ patch_strip = 1 ,
45+ patches = [
46+ "//bazel/bison-patches:0001-gnulib-wrapper-headers-use-I-not-isystem.patch" ,
47+ ],
48+ version = "3.8.2.bcr.7" ,
49+ )
50+
3751BOOST_VERSION = "1.89.0.bcr.2"
3852
53+ # boost::icl's exclusive_less_than comparator violates strict weak ordering
54+ # (boostorg/icl#51); libc++'s std::map exposes it, leaving phantom intervals
55+ # after interval_set subtraction (boostorg/icl#55) — pad IO fillers were
56+ # placed on top of pads. Upstream fix boostorg/icl@7de3f55655 (#54), merged
57+ # after boost 1.90. Drop when a boost.icl release containing it lands in BCR.
58+ single_version_override (
59+ module_name = "boost.icl" ,
60+ patch_strip = 1 ,
61+ patches = [
62+ "//bazel/boost-icl-patches:0001-refactor-interval-lookup-operations-icl-54.patch" ,
63+ ],
64+ )
65+
3966bazel_dep (name = "boost.algorithm" , version = BOOST_VERSION )
4067bazel_dep (name = "boost.asio" , version = BOOST_VERSION )
4168bazel_dep (name = "boost.beast" , version = BOOST_VERSION )
@@ -76,13 +103,54 @@ bazel_dep(name = "boost.utility", version = BOOST_VERSION)
76103bazel_dep (name = "cudd" , version = "3.0.0.bcr.2" )
77104bazel_dep (name = "eigen" , version = "3.4.0.bcr.3" )
78105bazel_dep (name = "fmt" , version = "11.2.0.bcr.1" )
106+
107+ # gawk is transitive (abc -> ncurses -> gawk; yosys -> gawk). Same gnulib
108+ # libc-header shadowing as sed: gawk@5.3.2.bcr.2 fails to compile against
109+ # hermetic-llvm's explicit libc -isystem entries (BCR #7642). 5.3.2.bcr.7
110+ # carries the upstream fix (BCR #7989).
111+ single_version_override (
112+ module_name = "gawk" ,
113+ version = "5.3.2.bcr.7" ,
114+ )
115+
79116bazel_dep (name = "git" , version = "2.54.0" )
80117bazel_dep (name = "googletest" , version = "1.17.0.bcr.2" )
118+
119+ # m4 is transitive (rules_bison/rules_flex -> m4). Same gnulib libc-header
120+ # shadowing class as sed/gawk under hermetic-llvm (BCR #7642).
121+ single_version_override (
122+ module_name = "m4" ,
123+ version = "1.4.21.bcr.4" ,
124+ )
125+
81126bazel_dep (name = "openmp" , version = "21.1.5.bcr.2" )
82127bazel_dep (name = "or-tools" , version = "9.15" )
128+
129+ # sed is transitive (abc -> ncurses -> sed). Its vendored gnulib headers
130+ # deliberately shadow libc headers (stdio.h, error.h); hermetic-llvm's
131+ # explicit libc -isystem entries outrank them and sed@4.9.bcr.3 fails to
132+ # compile (BCR #7642). 4.9.bcr.5 carries the upstream fix (BCR #7915).
133+ single_version_override (
134+ module_name = "sed" ,
135+ version = "4.9.bcr.5" ,
136+ )
137+
83138bazel_dep (name = "spdlog" , version = "1.15.1" )
84139bazel_dep (name = "sv-lang" , version = "10.0.1-20260316-f04e8156" )
85140bazel_dep (name = "tcl_lang" , version = "9.0.2.bcr.1" )
141+
142+ # tclZipfs.c's '#include "crypt.h"' picks up glibc's crypt.h instead of the
143+ # vendored minizip one when glibc headers are explicit -isystem directories
144+ # (hermetic-llvm zero-sysroot toolchain). Drop when fixed in a tcl_lang
145+ # BCR release.
146+ single_version_override (
147+ module_name = "tcl_lang" ,
148+ patch_strip = 1 ,
149+ patches = [
150+ "//bazel/tcl-patches:0001-tclZipfs-include-vendored-minizip-crypt.h-by-path.patch" ,
151+ ],
152+ )
153+
86154bazel_dep (name = "tcmalloc" , version = "0.0.0-20250927-12f2552" )
87155bazel_dep (name = "yaml-cpp" , version = "0.9.0" )
88156bazel_dep (name = "zlib" , version = "1.3.1.bcr.8" )
@@ -101,7 +169,12 @@ git_override(
101169
102170## Lock the compiler version and avoid any local compiler.
103171## Downstream consumers must configure their own C++ toolchain.
104- bazel_dep (name = "toolchains_llvm" , version = "1.5.0" , dev_dependency = True )
172+ ##
173+ ## hermetic-llvm (BCR module "llvm") provides statically linked LLVM
174+ ## binaries and a zero-sysroot cc_toolchain: no host compiler, linker,
175+ ## libxml2 or /usr/include involved, and it runs unmodified on distros
176+ ## without FHS paths (e.g. NixOS).
177+ bazel_dep (name = "llvm" , version = "0.8.11" , dev_dependency = True )
105178
106179# --- Dev dependencies (not propagated to downstream consumers) ---
107180
@@ -159,26 +232,72 @@ archive_override(
159232
160233bazel_dep (name = "yosys" , version = "0.62.bcr.2" , dev_dependency = True )
161234bazel_dep (name = "yosys-slang" , version = "0.0.0" , dev_dependency = True )
235+ archive_override (
236+ module_name = "yosys-slang" ,
237+ sha256 = "34198f2ed7b2d3175c3ce3c9fb1c6c91f28dbcfe531d97b91d6b12c48431bdef" ,
238+ strip_prefix = "sv-elab-6760afa2c9b9ba231a9c6a9e94f0939dd39f0a20" ,
239+ urls = ["https://github.com/povik/yosys-slang/archive/6760afa2c9b9ba231a9c6a9e94f0939dd39f0a20.tar.gz" ],
240+ )
162241
163242# --- Extensions ---
164243
165- llvm = use_extension (
166- "@toolchains_llvm//toolchain/extensions:llvm.bzl" ,
167- "llvm" ,
168- dev_dependency = True ,
169- )
170- llvm .toolchain (
171- llvm_version = "20.1.8" ,
172- )
173- use_repo (llvm , "llvm_toolchain" , "llvm_toolchain_llvm" )
174-
175- # FYI: Comment out @llvm_toolchain//:all on NixOS and use the local clang toolchain instead.
176244register_toolchains (
177- "@llvm_toolchain// :all" ,
245+ "@llvm//toolchain :all" ,
178246 "@rules_verilator//verilator:verilator_toolchain" ,
179247 dev_dependency = True ,
180248)
181249
250+ # hermetic-llvm ships a minimal macOS SDK subset (frameworks are opt-in).
251+ # Qt (qt-bazel) needs the desktop frameworks; the first six entries are
252+ # hermetic-llvm's defaults, which listing any framework replaces.
253+ osx = use_extension ("@llvm//extensions:osx.bzl" , "osx" , dev_dependency = True )
254+ osx .frameworks (names = [
255+ "CoreFoundation" ,
256+ "Foundation" ,
257+ "Kernel" ,
258+ "OSLog" ,
259+ "Security" ,
260+ "SystemConfiguration" ,
261+ "AppKit" ,
262+ "ApplicationServices" ,
263+ "CFNetwork" ,
264+ "Carbon" ,
265+ "Cocoa" ,
266+ "ColorSync" ,
267+ "CoreData" ,
268+ "CoreGraphics" ,
269+ "CoreImage" ,
270+ "CoreServices" ,
271+ "CoreText" ,
272+ "CoreVideo" ,
273+ "DiskArbitration" ,
274+ # ATS (inside the ApplicationServices umbrella) has .tbd symlinks into
275+ # the FontServices private framework; without it they dangle and bazel
276+ # rejects the sysroot ("file type is not supported").
277+ "FontServices" ,
278+ "GSS" ,
279+ "IOKit" ,
280+ "IOSurface" ,
281+ "ImageIO" ,
282+ "Metal" ,
283+ # MetalKit's MTKModel.h includes ModelIO/ModelIO.h.
284+ "MetalKit" ,
285+ "ModelIO" ,
286+ "OpenGL" ,
287+ # PrintCore is inside the ApplicationServices umbrella, but must be
288+ # named for the SDK subset to keep usr/include/cups (its ObjC headers
289+ # import <cups/ppd.h>).
290+ "PrintCore" ,
291+ "QuartzCore" ,
292+ # AppKit reaches these on macOS: NSImageView.h includes Symbols
293+ # unconditionally; NSText*.h take the non-UIKit branch into the
294+ # UIFoundation private framework; NSSharingService pulls CloudKit.
295+ "CloudKit" ,
296+ "Symbols" ,
297+ "UIFoundation" ,
298+ "UniformTypeIdentifiers" ,
299+ ])
300+
182301python = use_extension ("@rules_python//python/extensions:python.bzl" , "python" )
183302python .toolchain (
184303 ignore_root_user_error = True ,
@@ -244,7 +363,7 @@ alias(
244363 visibility = ["//visibility:public"],
245364)
246365""" ,
247- path = "bazel" ,
366+ path = "bazel/slang-compat " ,
248367)
249368
250369# --- Overrides ---
0 commit comments