feat(cc): align C compiler vendor detection with the OCaml compiler#15423
Merged
Conversation
Signed-off-by: Chizaram Chibueze <chizy7@gmail.com>
Member
Collaborator
|
Does this change have any user-visible effect? |
Contributor
Author
|
Mostly no. Two exceptions:
|
Alizter
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14870.
Dune detected the C/C++ compiler vendor with a coarser vocabulary than the OCaml compiler's own
OCAML_CC_VENDORmacro (ocaml/aclocal.m4). It recognized onlymsvc/clang/gcc/otherand emitted a "please open an issue" warning for compilers the compiler already names.What changed
OCAML_CC_VENDOR's ordered#ifladder and identifiers:msvc,icc,mingw,clang,gcc,xlc,sunc,unknown.cc_vendornow includes:Gcc | Clang | Msvc | Mingw | Intel | Xlc | Sun | Other.ocamlc -configdoes not exposec_compiler_vendor, so dune keeps its own preprocessor probe. Only the detection table, parser, and vendor type changed.Testing
Added a pure-function expect test covering every vendor word. The existing
foreign-stubs/cxx-flags.tstill passes unchanged.Two points I'd like a call on
-lstdc++instead of-lc++. I believe this is the correct behavior since MinGW ships GNUlibstdc++, but wanted to call it out because it changes behavior.