This sysroot provides common headers and system libraries shared across architectures for Bazel builds. It is designed to be used in conjunction with architecture-specific sysroots for AMD64 and ARM64.
The bazel_sysroot_library sysroot serves as a common base for all architectures, providing:
- Common header files (
.h) used across architectures - Common system libraries (both shared
.soand static.a) - System dependencies that are architecture-independent
sysroot/
├── include/ # Common header files
├── lib/ # Common system libraries
└── BUILD.sysroot.bazel
The BUILD file exposes the following targets:
-
Filegroups:
:all- Includes both:includeand:lib:include- All header files in the include directory:lib- All library files in the lib directory
-
Library Targets:
:system_deps- Shared library target for dynamic linking:system_deps_static- Static library target for static linking
The sysroot includes the following common libraries and their headers:
-
Core system libraries:
- glibc
- gcc-unwrapped
-
Compression libraries:
- zlib
- bzip2
- xz
-
XML and parsing:
- libxml2
- expat
-
Networking:
- openssl
- curl
-
Text processing:
- pcre
- pcre2
-
JSON:
- jansson
-
Database:
- sqlite
-
Image processing:
- libpng
- libjpeg
-
System utilities:
- util-linux
This sysroot is typically used in conjunction with architecture-specific sysroots:
llvm.sysroot(
name = "llvm_toolchain",
targets = ["linux-x86_64"],
label = "@bazel_sysroot_tarball_amd64//:sysroot",
include_prefix = "@bazel_sysroot_library//:include",
lib_prefix = "@bazel_sysroot_lib_amd64//:lib",
system_libs = [
"@bazel_sysroot_library//:system_deps",
"@bazel_sysroot_library//:system_deps_static",
],
)To build this sysroot:
nix-build default.nixThe output will be a directory containing the sysroot structure with all necessary files and the BUILD.sysroot.bazel file.