Repository navigation
Backlog
Labels
upstream-bug根因在上游(编译器/构建工具/依赖),mcpp 只能绕过或声明为缺口
Description
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.
Metadata
Metadata
Assignees
Labels
upstream-bug根因在上游(编译器/构建工具/依赖),mcpp 只能绕过或声明为缺口
Activity
speak-agent commentedon Nov 26, 2026
UP-01 — Clang: operator templates in a module interface make every importer crash on that operator name
Sema::AddArgumentDependentLookupCandidates, or with unboundedInstantiateFunctionDefinitionrecursion.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.tests/e2e/150_clang_module_operator_template.shis a state canary over the bundled LLVMs. Its table records 18–22 and has no row for 23: a row23) crashis due.speak-agent commentedon Nov 26, 2026
UP-02 — Clang: a full BMI from
--precompilechanges overload resolution in an importercall to implicitly-deleted default constructor of 'formatter<basic_string<char>, wchar_t>'— the string is instantiated asbasic_format_string<wchar_t, …>. The same sources compile against the reduced BMI of the same module.bmiOnlyFlags = " --precompile -Xclang -emit-reduced-module-interface",modules/toolchain-model/src/model.cppm).-c <reduced>.pcmsilently emits an object with no definitions #424, defect 1.speak-agent commentedon Nov 26, 2026
UP-03 — Clang:
clang -c <reduced>.pcmexits 0 and writes an object without the definitions-fmodules-reduced-bmitogether with--precompileis accepted and does nothing..pcm(src/build/schedule/policy.cppm).-c <reduced>.pcmsilently emits an object with no definitions #424, defect 2.speak-agent commentedon Nov 26, 2026
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"
__builtin_va_list, C++20 with a PCH).error: call to '__builtin_expect' is ambiguous, with two candidates that are the same builtin.<assert.h>expandsassertto__builtin_expect; glibc's and MSVC's do not name a builtin.assert.hwith#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.speak-agent commentedon Nov 26, 2026
UP-05 — Clang 23.1.0: the MSVC STL's
stdmodule fails with "reference to 'align_val_t' is ambiguous" — fixed in 23.1.1align_val_tis ambiguous under MSVC in a module llvm/llvm-project#218152, introduced by [Sema] Add implicit std::align_val_t to std namespace DeclContext for module merging llvm/llvm-project#187347, fixed by [C++20] [Modules] Handling merging predefined decls from std llvm/llvm-project#219151 (onrelease/23.x, in clang 23.1.1).std.ixxstops invcruntime_new.h: the exportedstd::align_val_tis not merged with the declaration clang makes implicitly for aligned allocation.stdmodule fails withreference to 'align_val_t' is ambiguous(fixed in 23.1.1, llvm/llvm-project#218152) #640.speak-agent commentedon Nov 26, 2026
UP-06 — Clang on a Windows host keeps
\in__FILE__for a POSIX target under-ffile-reproduciblePreprocessor::processPathForFileMacroonly callsremove_dots(…, Style::posix), which does not treat\as a separator; the directory of an includer was joined with the host's separator.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.mcpp pack --mergerefuses two digests for one path.\in__FILE__for a POSIX target under -ffile-reproducible: an ok image built on Windows differs from one built on Linux/macOS #850.speak-agent commentedon Nov 26, 2026
UP-07 — Clang 23: no C++20 coroutines on
i686-pc-windows-msvc(a limit upstream states)__cpp_impl_coroutinefor the 32-bit x86 Microsoft ABI and reports-Wcoroutines-unsupported-target. clang 22.1.8 predefines it.<coroutine>on the macro, so (1) the C++23stdmodule does not precompile (<generator>usescoroutine_handleunchecked), and (2) code that uses coroutines stops atstd::coroutine_traits type was not found.-dM -Eprobe. The options it names: build the package as C++20, or statetoolchain = "llvm@22.1.8"for that target. docs/20, "Known Toolchain Limitation: Coroutines on the 32-bit x86 Microsoft ABI".<generator>.speak-agent commentedon Nov 26, 2026
UP-08 — ld64.lld cannot read an SDK whose
.tbdfiles listarm64e.x1— fixed in LLVM 23.1.3xcode-27runner image, in the Command Line Tools SDK and in Xcode's.ld64.lld: error: could not load TAPI file at <SDK>/usr/lib/libSystem.tbd: malformed file … unknown architecture arm64e.x1-macos, followed by undefined symbols.speak-agent commentedon Nov 26, 2026
UP-09 — lld-link
/OPT:REFdiscards a locally defined function that is reached only through an__imp_slotlink.exekeeps the function.__declspec(dllimport)and the definition is in the link (LNK4217). With/OPT:REFand one section per function the slot holds the image base, and the first call is an access violation (exit 0xC0000005).dllimportby default then crashes at its first call. First seen withmcpp pack --compress xz.staticlibfeature thatdefaultimplies (compat.xz:LZMA_API_STATIC,compat.libarchive:LIBARCHIVE_STATIC, ascompat.curlandcompat.c-aresdid).speak-agent commentedon Nov 26, 2026
UP-10 — MSVC STL 14.51 with clang:
std::findover a trivially comparable type wider than 8 bytes fails a static assertion<xutility>: std::find no longer compiles with structs with defaulted equality comparison with Clang-CL microsoft/STL#6294.x86_64-pc-windows-msvcwith the MSVC STL 14.51 (Visual Studio 18); the STL 14.3x ofwindows-2022compiles the same source, and MSVC's own front end never takes the path.xutility: error: static assertion failed: unexpected sizeinstd::_Find_vectorized. The STL admits the type to its vectorized path through a clang-only trait without an upper size bound; the function implements 1-, 2-, 4- and 8-byte elements.operator==instead of a defaulted one, or an image whose STL predates 14.51. docs/20, "Known Toolchain Hazard:std::findOver a Wide Trivially Comparable Type".<xutility>: std::find no longer compiles with structs with defaulted equality comparison with Clang-CL microsoft/STL#6294 is the one the Windows runners ship.speak-agent commentedon Nov 26, 2026
UP-11 — GCC 16.1: internal compiler error (segmentation fault) at
import mcpp.cli;, by the shape of the import graphUpstream: GCC C++ modules; not filed (a reduced case outside mcpp does not exist yet).
Measured: GCC 16.1.0, x86_64-linux-gnu, on mcpp's own tree. LLVM builds the same trees. mcpp's own build stays on 16.1.0: 16.2 has a modules regression of its own (stated in GCC 16.1 segfaults compiling src/main.cpp when the module graph gains one module #863).
Symptom:
src/main.cpp:5:17: internal compiler error: Segmentation faultatimport mcpp.cli;. Backtrace where one was taken (GCC 16.1 internal compiler error in add_imported_namespace when mcpp.build.prepare gains an interface unit in its import chain #721, GCC 16.1 ICE in get_originating_module_decl while importing mcpp.cli (module import-graph shape); worked around #848):module_state::read_namespaces→add_imported_namespace→get_originating_module_decl. Every module unit compiles; only the importer fails.Triggers measured, one entry because the symptom and the remedy are one (GCC 16.1 segfaults compiling src/main.cpp when the module graph gains one module #863 and GCC 16 modules: definitions in the interface of mcpp.pm.descriptor make an importer of mcpp.cli segfault at its import #968 recorded no backtrace, so their identity with the first two is by symptom):
mcpp.build.prepareand its imports, whatever it containsmcpp.cliimports; needs a three-level chain with global module fragments; two later occurrences in its commentsmain.cpp, or one more import of an existing modulemcpp.pm.descriptor) reached throughmcpp.cliIn mcpp (the rule the tree follows): a module reached through
mcpp.clikeeps heavy imports and function bodies out of its interface — the interface declares, an implementation unit (or an implementation partition that only implementation units import) defines and imports. New code is placed in existing modules where a new one would change the graph.Retire when: GCC 17, or a 16.x with the fix, is the toolchain mcpp builds itself with; then the placement rule is removed.
To do: a generated chain of modules as a self-contained case, then GCC Bugzilla.
Reports: GCC 16.1 internal compiler error in add_imported_namespace when mcpp.build.prepare gains an interface unit in its import chain #721, GCC 16.1 ICE in get_originating_module_decl while importing mcpp.cli (module import-graph shape); worked around #848, GCC 16.1 segfaults compiling src/main.cpp when the module graph gains one module #863, GCC 16 modules: definitions in the interface of mcpp.pm.descriptor make an importer of mcpp.cli segfault at its import #968.
speak-agent commentedon Nov 26, 2026
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
-std=c++23 -fmodules), Linux x86_64 (2026-11-07 to 2026-11-09).error: failed to read compiled module cluster N: Bad file dataandfatal 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()).inlinefunction in a module interface whose body reaches a module with mcpplibs.os's process types; the second form with a function that returns astd::set<std::string>it built. The same sources build when the functions are notinline.repro/905of mcpp-community/mcpp-plugins (src/tool.cppmat 117 lines); the reduction that needs no mcpp is still to do.inline(0.21.0; docs/plugin-development.md §4);rows_servedinmodules/manifest/src/platform_providers.cppmreturns a sorted vector instead of a set.speak-agent commentedon Nov 26, 2026
UP-13 — GCC 16.1: internal compiler error when an importer compares a module's type whose
operator==is a defaulted friendimport 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.internal compiler error: Segmentation faultat the linefriend bool operator==(const T&, const T&) = default;.operator==written out (mtest 0.4.0,manifest/src/manifest.cppm).speak-agent commentedon Nov 26, 2026
UP-14 — DPC++ 7.1.0:
clang-offload-bundlergives every NVIDIA architecture's members to a request for one880399f4), CUDA 12.9.86, Linux x86_64 (2026-11-07).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.docs/rules.md).-c <reduced>.pcmsilently emits an object with no definitions #424 as a duplicate of this issue\in__FILE__for a POSIX target under -ffile-reproducible: an ok image built on Windows differs from one built on Linux/macOS #850 as a duplicate of this issue