Skip to content

Add LLVM toolchain with GCC-based sysroot - #380

Draft
4og wants to merge 1 commit into
mainfrom
4og_llvm_toolchain_sysroot
Draft

Add LLVM toolchain with GCC-based sysroot#380
4og wants to merge 1 commit into
mainfrom
4og_llvm_toolchain_sysroot

Conversation

@4og

@4og 4og commented Jul 14, 2026

Copy link
Copy Markdown
Member

Draft. Do not merge

Adds a hermetic LLVM/Clang toolchain that reuses the S-CORE GCC package's sysroot.
Clang and GCC now build against the same libc/libstdc++, giving reproducible cross-toolchain builds without a separately maintained sysroot.

Clang should use the same libc/libstdc++ as GCC. But the GCC package keeps libstdc++ (<triple>/include/c++) and its support libs (lib/gcc) outside the sysroot, whereas under --sysroot Clang only looks in usr/include/c++ and usr/lib/gcc. Also, llvm.sysroot needs the sysroot dir to be its own Bazel package.

Since we can't modify the GCC package repo, the gcc_sysroot rule builds a self-contained sysroot: it copies the bare sysroot out of the already-extracted @score_gcc_x86_64_toolchain_pkg, folds the headers and libs into it, and adds a BUILD file. Clang then finds everything from --sysroot alone.

@github-project-automation github-project-automation Bot moved this to In Progress in BAS - Baselibs FT Jul 14, 2026
@4og 4og changed the title 4og llvm toolchain sysroot Add hermetic LLVM toolchain with GCC-based sysroot Jul 14, 2026
@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@4og
4og force-pushed the 4og_llvm_toolchain_sysroot branch from 978a138 to 1463adb Compare July 14, 2026 17:09
@4og 4og changed the title Add hermetic LLVM toolchain with GCC-based sysroot Add LLVM toolchain with GCC-based sysroot Jul 14, 2026
@4og
4og force-pushed the 4og_llvm_toolchain_sysroot branch 3 times, most recently from 593fa7f to d7bb7dd Compare July 15, 2026 09:27
@4og
4og force-pushed the 4og_llvm_toolchain_sysroot branch from d7bb7dd to 5a2cf7f Compare July 30, 2026 16:25
@github-actions github-actions Bot added the bazel Bazel and Starlark build files label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bazel Bazel and Starlark build files

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant