Skip to content

Fix final binaries leaking build paths - #123

Merged
Arshia001 merged 1 commit into
mainfrom
fix/path-leak
Jun 22, 2026
Merged

Fix final binaries leaking build paths#123
Arshia001 merged 1 commit into
mainfrom
fix/path-leak

Conversation

@kilyanni

Copy link
Copy Markdown

A small irreproducibility issue I noticed while packaging this with Nix:

The final binaries leak paths to the build directory, meaning binaries aren't directly bit-for-bit reproducible.
This PR adds path maps so that the build is idempotent over the build directory path & clang resource dir path.

Should not change behavior.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses build irreproducibility where absolute build-directory and LLVM install paths can leak into produced archives (via debug-info paths), preventing bit-for-bit reproducible outputs across different build environments. It does so by adding deterministic path remapping flags to the CMake builds for compiler-rt and libc++.

Changes:

  • Detects Clang’s resource directory at build time and defines -ffile-prefix-map remappings for the repo root and resource dir.
  • Applies those remapping flags to CMake C/C++/ASM flags for the compiler-rt build.
  • Applies those remapping flags to CMake C/C++/ASM flags for the libcxx (LLVM runtimes) build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kilyanni
kilyanni requested a review from Arshia001 June 22, 2026 13:22
@Arshia001
Arshia001 merged commit 02851b7 into main Jun 22, 2026
6 checks passed
@Arshia001
Arshia001 deleted the fix/path-leak branch June 22, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants