Skip to content

Upstream defects register (Clang/LLVM, GCC, MSVC STL, DPC++) #1027

Backlog

Description

@speak-agent

Register of upstream defects mcpp depends on: compilers, linkers, standard libraries and SDKs whose behaviour mcpp works around, documents or waits for. This body is the index; each comment below is one problem.

mcpp builds itself with GCC 16.1.0 on Linux x86_64 and with LLVM 23.1.3 on macOS, on Windows and for Linux aarch64 ([toolchain] of mcpp.toml); the versions a fresh home installs are the [[default]] rows of modules/toolchain-model/data/builtin.toml. An entry states the versions it was measured with.

Rules:

  • A new upstream problem gets a comment here and a row in this index, not an issue of its own. The comment states what was measured (versions, date), the symptom, the trigger, what mcpp does about it, and when the entry is retired.
  • Adding or removing a workaround in mcpp, or measuring a new toolchain version, updates the entry's comment and its row.
  • An upstream report or fix is linked in the row when it exists. Reports are filed upstream by the maintainers; "not filed" is the state until then.
  • Walk this list before a default toolchain version or mcpp's own pin changes: each open entry is measured with the new version, and one that no longer reproduces is retired with its workaround.
  • A defect of mcpp, or of a package of the mcpp ecosystem, is not an entry here.

Clang (frontend)

ID Problem Upstream mcpp From
UP-01 An exported operator template whose parameters are not all fixed by the first argument makes every importer crash on that operator not filed; regression between 18 and 20; present in 23.1.6 documented hazard (docs/20); state canary tests/e2e/150_… #256
UP-02 A full BMI from --precompile changes overload resolution in an importer (formatter<…, wchar_t> for a narrow string) not filed; no reduced case not reached: importers get the reduced BMI #424
UP-03 clang -c <reduced>.pcm exits 0 and writes an object without the definitions not filed; 8-line case; present in 23.1.6 not reached: the object edge compiles the source #424
UP-04 A builtin first looked up in a partition's purview is owned by the module; beside a global-module use it is "ambiguous" (macOS assert) not filed; cf. llvm/llvm-project#61931; present in 23.1.6 nothing in the engine; two project workarounds #632
UP-05 23.1.0: the MSVC STL's std module fails with "reference to 'align_val_t' is ambiguous" fixed in 23.1.1 (llvm/llvm-project#218152) closed: the default LLVM is 23.1.3 #640
UP-06 On a Windows host __FILE__ keeps \ for a POSIX target under -ffile-reproducible: an ok image differs from the one built on Linux or macOS not filed no build workaround; SPEC-014 §4.6: such images are built on Linux or macOS #850
UP-07 clang 23: no C++20 coroutines on i686-pc-windows-msvc; the MSVC STL's C++23 std module does not precompile there a limit upstream states, not a defect a note after the failure names the two options (docs/20) docs/20

LLVM linkers

ID Problem Upstream mcpp From
UP-08 ld64.lld cannot read an SDK whose .tbd files list arm64e.x1 (xcode-27) fixed in LLVM 23.1.3 (backport) closed: the default LLVM is 23.1.3 #669
UP-09 lld-link /OPT:REF discards a locally defined function reached only through an __imp_ slot; the first call is an access violation not filed; 20.1.7 to 23.1.3 static libraries state their static-API macro (staticlib feature in mcpp-index) #1002

MSVC STL

ID Problem Upstream mcpp From
UP-10 MSVC STL 14.51 with clang: std::find over a trivially comparable type wider than 8 bytes fails a static assertion microsoft/STL#6294 nothing in the engine; two project workarounds (docs/20) #609

GCC

ID Problem Upstream mcpp From
UP-11 16.1: internal compiler error (segmentation fault) at import mcpp.cli;, by the shape of the import graph (get_originating_module_decl) not filed; no case outside mcpp placement rule: a module reached through mcpp.cli keeps heavy imports and bodies out of its interface #721, #848, #863, #968
UP-12 16.1: an importer of an inline function body fails to read the module ("Bad file data") or links with undefined members of a standard template not filed; reduced case on a branch no inline helper that reaches mcpplibs.os (mcpp-plugins); a vector instead of a set in one function #905
UP-13 16.1: internal compiler error when an importer compares a module's type whose operator== is a defaulted friend not filed; not a verified minimal case nothing in the engine; a member operator== written out #910

DPC++ (intel/llvm)

ID Problem Upstream mcpp From
UP-14 DPC++ 7.1.0: clang-offload-bundler gives every NVIDIA architecture's members to a request for one (five-part bundle IDs) not filed (intel/llvm) the combination is documented as unsupported in mcpp-plugins #899

The reports in the last column hold the full measurements and reproductions; they are closed in favour of this register.

Activity

  1. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-01 — Clang: operator templates in a module interface make every importer crash on that operator name

    • Upstream: Clang frontend; not filed. A regression between clang 18 and 20.
    • Measured: clang 20.1.7 and 22.1.8 crash, 18.1.3 and GCC 16.1.0 do not (2026-07-21); still present with LLVM 23.1.3 and 23.1.6 (2026-11-26).
    • Symptom: an importer that uses the operator on any type ends with SIGSEGV in Sema::AddArgumentDependentLookupCandidates, or with unbounded InstantiateFunctionDefinition recursion.
    • Trigger: an exported operator (or function) template whose template parameters are not all fixed by the first argument, e.g. operator*(const Matx<T,m,l>&, const Matx<T,l,n>&). The crash is keyed by name: one such declaration breaks every use of that operator in every importer. The body is irrelevant.
    • In mcpp: documented in docs/20, "Known Toolchain Hazard: Operator Templates in Module Interfaces" (deduce whole operand types instead); tests/e2e/150_clang_module_operator_template.sh is a state canary over the bundled LLVMs. Its table records 18–22 and has no row for 23: a row 23) crash is due.
    • Retire when: a bundled LLVM compiles the canary's importer; the canary then fails and names this entry.
    • Report, 40-line reproduction and the trigger taxonomy: clang 20/22 module BMI: replacement-operator templates with params not pinned by arg1 poison name lookup for all importers (frontend SIGSEGV; gcc + clang18 fine) #256.
  2. added
    upstream-bug
    on Nov 26, 2026
  3. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-02 — Clang: a full BMI from --precompile changes overload resolution in an importer

    • Upstream: Clang; not filed, no reduced case yet.
    • Measured: clang 22.1.8, Linux x86_64 (2026-08-15); not measured again since.
    • Symptom: an importer with a narrow format string fails inside libc++: call to implicitly-deleted default constructor of 'formatter<basic_string<char>, wchar_t>' — the string is instantiated as basic_format_string<wchar_t, …>. The same sources compile against the reduced BMI of the same module.
    • Trigger: known only on a real tree (mcpp 2026.8.11.3 built by xmake, whose two-phase shape needs the full BMI). Two reductions that do not reproduce are recorded in the report.
    • In mcpp: not reached: the BMI published to importers is always the reduced one (bmiOnlyFlags = " --precompile -Xclang -emit-reduced-module-interface", modules/toolchain-model/src/model.cppm).
    • Retire when: a reduced case exists, is fixed upstream, and the full BMI is safe to publish.
    • Report: clang 22: full BMI from --precompile poisons importers; -c <reduced>.pcm silently emits an object with no definitions #424, defect 1.
  4. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-03 — Clang: clang -c <reduced>.pcm exits 0 and writes an object without the definitions

    • Upstream: Clang driver/codegen; not filed. An 8-line reproduction exists.
    • Measured: clang 22.1.8 (2026-08-15); still present with LLVM 23.1.3 and 23.1.6 (2026-11-26).
    • Symptom: compiling a reduced BMI to an object succeeds and the object defines none of the module's functions (1 defined symbol instead of 3 in the reproduction). The failure moves to the link, or does not appear when another object defines the name.
    • Note: a reduced BMI holds no function bodies, so it cannot be a code generation input; the defect is that this is not diagnosed. -fmodules-reduced-bmi together with --precompile is accepted and does nothing.
    • In mcpp: not reached: in the two-phase schedule the object edge compiles the source again and never a .pcm (src/build/schedule/policy.cppm).
    • Retire when: clang refuses a reduced BMI as a code generation input; whether the object edge may then take the full BMI is a separate measurement.
    • Report and reproduction: clang 22: full BMI from --precompile poisons importers; -c <reduced>.pcm silently emits an object with no definitions #424, defect 2.
  5. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-04 — Clang: a builtin first looked up in a partition's purview is owned by the module; beside a global-module use it is "ambiguous"

    • Upstream: Clang; not filed. Same class as Error combining c++20, libc++, PCH and stdarg llvm/llvm-project#61931 (__builtin_va_list, C++20 with a PCH).
    • Measured: clang 22.1.8, Linux x86_64 and macOS arm64 (2026-09-13); still present with LLVM 23.1.3 and 23.1.6 (2026-11-26).
    • Symptom: error: call to '__builtin_expect' is ambiguous, with two candidates that are the same builtin.
    • Trigger: (1) a module partition whose purview performs the first lookup of the builtin, and (2) an importer in the same module that also reaches a declaration of it from a global module fragment. Met on macOS, where <assert.h> expands assert to __builtin_expect; glibc's and MSVC's do not name a builtin.
    • In mcpp: nothing in the engine. Two workarounds for a project: shadow the one header that names the builtin (a 20-line assert.h with #include_next, on the package's own include path for macOS), or make the first lookup happen in the global module fragment of every partition.
    • Retire when: the 4-file reproduction compiles with a bundled LLVM.
    • Report, reproduction and the table of what triggers it: clang 22: a builtin first looked up in a module partition's purview becomes module-owned; importing it beside a GMF use is 'ambiguous' (macOS assert / __builtin_expect) #632.
  6. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-05 — Clang 23.1.0: the MSVC STL's std module fails with "reference to 'align_val_t' is ambiguous" — fixed in 23.1.1

  7. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-06 — Clang on a Windows host keeps \ in __FILE__ for a POSIX target under -ffile-reproducible

    • Upstream: Clang preprocessor; not filed. For a non-Windows target Preprocessor::processPathForFileMacro only calls remove_dots(…, Style::posix), which does not treat \ as a separator; the directory of an includer was joined with the host's separator.
    • Measured: LLVM 23.1.3 on ubuntu-24.04, macos-15 and windows-2022 (2026-10-28).
    • Symptom: an ok image (x86_64-openkal) built on Windows differs from the one built on Linux or macOS (which are identical) in two __FILE__ strings of libc++abi's demangler (…/src\demangle/ItaniumDemangle.h), 3,921 bytes in all.
    • In mcpp: no workaround in the build (a prefix map per directory of a package of libc++'s size exceeds the command line on Windows). The packaging specification states the rule (SPEC-014 §4.6): the images of a universal package are built on Linux or macOS, and mcpp pack --merge refuses two digests for one path.
    • Retire when: an image built on Windows has the digest of the one built on Linux.
    • Report: 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.
  8. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-07 — Clang 23: no C++20 coroutines on i686-pc-windows-msvc (a limit upstream states)

    • Upstream: a decision of clang 23, not a defect: it does not predefine __cpp_impl_coroutine for the 32-bit x86 Microsoft ABI and reports -Wcoroutines-unsupported-target. clang 22.1.8 predefines it.
    • Symptom: the MSVC STL keys <coroutine> on the macro, so (1) the C++23 std module does not precompile (<generator> uses coroutine_handle unchecked), and (2) code that uses coroutines stops at std::coroutine_traits type was not found.
    • In mcpp: the engine follows the compiler and appends a note to either failure, decided after the failure from a -dM -E probe. The options it names: build the package as C++20, or state toolchain = "llvm@22.1.8" for that target. docs/20, "Known Toolchain Limitation: Coroutines on the 32-bit x86 Microsoft ABI".
    • Retire when: clang supports coroutines on this ABI again, or the MSVC STL guards <generator>.
    • Record: docs/20 (no issue of its own).
  9. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-08 — ld64.lld cannot read an SDK whose .tbd files list arm64e.x1 — fixed in LLVM 23.1.3

  10. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-09 — lld-link /OPT:REF discards a locally defined function that is reached only through an __imp_ slot

    • Upstream: LLD (COFF); not filed.
    • Measured: lld-link 20.1.7, 20.1.8, 22.1.8, 23.1.3 (2026-11-22). MSVC's link.exe keeps the function.
    • Symptom: a declaration says __declspec(dllimport) and the definition is in the link (LNK4217). With /OPT:REF and one section per function the slot holds the image base, and the first call is an access violation (exit 0xC0000005).
    • Where mcpp meets it: tests and release links collect sections (since 2026.11.9.1); a static library whose header declares dllimport by default then crashes at its first call. First seen with mcpp pack --compress xz.
    • In mcpp: no change in the engine. A static library states its static-API macro for every unit that includes its headers, which the headers require with any linker: in mcpp-index a staticlib feature that default implies (compat.xz: LZMA_API_STATIC, compat.libarchive: LIBARCHIVE_STATIC, as compat.curl and compat.c-ares did).
    • Retire when: lld-link keeps the function; the descriptors' macros stay, being the correct use of those headers.
    • Report and 2-file reproduction: lld-link /OPT:REF drops a locally defined function reached only through an __imp_ slot (upstream LLVM) #1002.
  11. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-10 — MSVC STL 14.51 with clang: std::find over a trivially comparable type wider than 8 bytes fails a static assertion

  12. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-11 — GCC 16.1: internal compiler error (segmentation fault) at import mcpp.cli;, by the shape of the import graph

  13. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-12 — GCC 16.1: an importer of an inline function body fails to read the module ("Bad file data") or links with undefined members

    • Upstream: GCC C++ modules; not filed.
    • Measured: GCC 16.1.0 (-std=c++23 -fmodules), Linux x86_64 (2026-11-07 to 2026-11-09).
    • Symptom: either error: failed to read compiled module cluster N: Bad file data and fatal error: failed to load binding '…' in an importer, or a link that leaves members of a standard template undefined (std::optional<std::vector<mcpplibs::os::process::grant>>'s payload; std::set<std::string>::set()).
    • Trigger: an inline function in a module interface whose body reaches a module with mcpplibs.os's process types; the second form with a function that returns a std::set<std::string> it built. The same sources build when the functions are not inline.
    • Reduced case: branch repro/905 of mcpp-community/mcpp-plugins (src/tool.cppm at 117 lines); the reduction that needs no mcpp is still to do.
    • In mcpp: mcpp-plugins defines no helper that reaches mcpplibs.os as inline (0.21.0; docs/plugin-development.md §4); rows_served in modules/manifest/src/platform_providers.cppm returns a sorted vector instead of a set.
    • Retire when: the reduced case builds with the GCC mcpp uses.
    • Report: GCC 16 modules: an importer of an inline body that reaches mcpplibs.os fails ("Bad file data" / unresolved optional<vector<grant>>) #905.
  14. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-13 — GCC 16.1: internal compiler error when an importer compares a module's type whose operator== is a defaulted friend

    • Upstream: GCC C++ modules; not filed.
    • Measured: GCC 16.1.0 with mcpp's import std, building mcpp-community/mtest 0.4.0 (2026-11-08). The code in the report is the shape of the failing units, not a verified minimal case; it was not measured again outside that tree.
    • Symptom: the interface unit compiles; the importer ends with internal compiler error: Segmentation fault at the line friend bool operator==(const T&, const T&) = default;.
    • In mcpp: nothing in the engine. In a project: a member operator== written out (mtest 0.4.0, manifest/src/manifest.cppm).
    • Retire when: the defaulted friend compiles in an importer with the GCC mcpp uses.
    • Report: gcc 16.1: ICE when an importer compares a module type whose operator== is a defaulted friend #910.
  15. speak-agent commented on Nov 26, 2026

    @speak-agent
    MemberAuthor

    UP-14 — DPC++ 7.1.0: clang-offload-bundler gives every NVIDIA architecture's members to a request for one

    • Upstream: intel/llvm (the SDK's offload bundler); not filed.
    • Measured: DPC++ 7.1.0 (nightly 2026-09-01, clang 22.1.0 of intel/llvm 880399f4), CUDA 12.9.86, Linux x86_64 (2026-11-07).
    • Symptom: the driver writes five-part bundle IDs (sycl-nvptx64-nvidia-cuda-sm_89) and the bundler matches them to every NVPTX request: unbundling a static archive for one architecture yields the members of all, and the device link reports duplicate definitions. The same bytes under six-part IDs with an explicit environment unbundle correctly.
    • Scope: a multi-architecture SYCL static archive. Not affected: multi-architecture objects linked directly, single-architecture archives, SPIR-V with one NVIDIA architecture.
    • In mcpp: the engine needs no vendor-specific link mode and keeps both architectures; mcpp-plugins documents the combination as unsupported (docs/rules.md).
    • Retire when: the SDK writes or parses the IDs unambiguously; then the final device link and the cross-package control in mcpp-plugins' SYCL consumers.
    • Report and reproduction: SYCL: a multi-architecture NVIDIA static archive mixes architecture members (DPC++ offload bundle IDs) #899.
  16. pinned this issue on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions