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
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The changes break clean MinGW builds by removing a required tracing-header generator and cause valid HLSL shaders to fail compilation because required language options are left disabled.
This PR adjusts DXC’s CMake configuration for MinGW, separating executable startup options from library settings and refining platform-specific build conditions.
Changes:
Move MinGW console and Unicode linker options to executable targets.
Restrict selected Windows dependencies to MSVC and adjust resource include flags.
Update architecture checks, runtime linking, warning suppression, and language-option configuration.
File
Description
tools/clang/tools/dxr/CMakeLists.txt
Add MinGW executable linker options.
tools/clang/tools/dxl/CMakeLists.txt
Add MinGW executable linker options.
tools/clang/tools/dxildll/CMakeLists.txt
Narrow dependency guards to MSVC and adjust resource flags.
tools/clang/tools/dxcvalidator/CMakeLists.txt
Remove MinGW linker options and version linkage.
tools/clang/tools/dxclib/CMakeLists.txt
Remove propagated executable linker options.
tools/clang/tools/dxc/CMakeLists.txt
Add MinGW executable linker options.
tools/clang/CMakeLists.txt
Enable variable language options for MinGW.
projects/CMakeLists.txt
Restrict tracing and DXIL conversion projects to MSVC.
CMakeLists.txt
Guard control-flow protection by architecture and limit Unix RPATH setup.
cmake/modules/HandleLLVMOptions.cmake
Adjust MinGW static runtime linking and warning suppression.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Replacing -static with -static-libstdc++ can leave LLVM_BUILD_STATIC=ON executables dependent on a MinGW libgcc DLL, causing startup failures on systems without that runtime.
LLVM static builds may depend on missing MinGW libgcc DLL
cmake/modules/HandleLLVMOptions.cmake:242
With a MinGW toolchain that links libgcc dynamically by default, replacing -static with -static-libstdc++ makes LLVM_BUILD_STATIC=ON executables depend on a MinGW libgcc DLL, so they can fail to start on systems without that runtime. Retain -static for executables independently of the new shared-library flags, or explicitly cover the remaining runtime libraries.
Normalize processor name before ARM64 protection check
CMakeLists.txt:114
Native Windows CMake can report CMAKE_SYSTEM_PROCESSOR as ARM64. Since MATCHES is case-sensitive, that value still enables -fcf-protection, which is unsupported for the ARM64 target, so this configuration continues to fail. Normalize the processor name to lowercase before matching so the guard handles native Windows ARM64 as well as aarch64/arm64 toolchains.
Replacing -static with -static-libstdc++ can leave LLVM_BUILD_STATIC=ON executables dependent on a MinGW libgcc DLL, causing startup failures on systems without that runtime.
1 previously missed issue
In code that hasn't changed since last review
LLVM static builds may depend on missing MinGW libgcc DLL cmake/modules/HandleLLVMOptions.cmake:242
With a MinGW toolchain that links libgcc dynamically by default, replacing -static with -static-libstdc++ makes LLVM_BUILD_STATIC=ON executables depend on a MinGW libgcc DLL, so they can fail to start on systems without that runtime. Retain -static for executables independently of the new shared-library flags, or explicitly cover the remaining runtime libraries.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because case-sensitive processor detection can incorrectly enable an x86-only compiler flag on Windows ARM64, breaking MinGW Clang builds.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because an unpublished finding identifies a case-sensitive processor check that can leave an unsupported compiler flag enabled and break Windows ARM64 MinGW builds.
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
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.
This PR updates CMake related files for MinGW, after the dxil updates.