You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
clang on a Windows host keeps \ in __FILE__ for a POSIX target under -ffile-reproducible: an ok image built on Windows differs from one built on Linux/macOS #850
An ok image (x86_64-openkal) built on a Windows host is not the bytes of the same image built on Linux or macOS. The difference is two __FILE__ strings from libc++abi's demangler:
Measured with a probe building one image (import std, an exception, std::source_location, [profile.release] trim_paths = true) with mcpp release/2026.10.27.1 and llvm@23.1.3 on ubuntu-24.04, macos-15 and windows-2022 (mcpplibs/openkal-platform, branch probe/image-bytes). The Linux and macOS images share one sha256; the Windows one differs in 3,921 bytes, all following from those two strings (.rodata, then .text and .rela.dyn offsets).
Cause (upstream)
cxa_demangle.cpp includes "demangle/ItaniumDemangle.h", found relative to the includer's directory; clang joins that directory and the spelled name with the host's separator (llvm::sys::path::append, native style), so on Windows the path is …/src\demangle/ItaniumDemangle.h. mcpp maps the package's prefix (-ffile-prefix-map) and, since #847, passes -ffile-reproducible with trim_paths. -ffile-reproducible is documented as using the target's separator in __FILE__, but for a non-Windows target Preprocessor::processPathForFileMacro only calls remove_dots(…, Style::posix), which does not treat \ as a separator, so the host's separator stays. For a Windows target the flag does normalise (to \).
Consequence
mcpp pack --merge correctly refuses a package whose images were built on Windows together with one built elsewhere (two digests for one path).
None in the build: the joined directory is the includer's and depends on which files include which, so a prefix map per directory of every package would be needed, which the command-line length on Windows does not allow for packages of libc++'s size. The packaging spec states the rule (SPEC-014 §4.6) and the release notes do not claim host-independent images for Windows hosts.
To be reported to LLVM: -ffile-reproducible keeps the host's \ in __FILE__ for a POSIX target when the path was joined on a Windows host.
Activity
prepare: the Windows first run's closures are their own step and the …
design: §15.1 what the implementation corrected (runners over the hos…