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
CMakeLists.txt currently uses CMAKE_C_SIMULATE_ID (if set) to decide which cli parameter syntax to use. This is not correct usage of this variable, as its value specifies ABI compatibility, not frontend cli syntax (docs here).
Instead, CMAKE_C_COMPILER_FRONTEND_VARIANT should be used for that instead (docs here).
This issue will rarely cause problems as most people using clang for the MSVC ABI will probably use clang-cl, but I did hit it while updating the nxdk-based Xbox port of Mbed-TLS, where we use clang as our compiler, but with GNU-style cli while targeting MSVC ABI.
Mbed TLS version: 3.6.2 and development branch
Operating system and version: Arch Linux host, nxdk target
Compiler and options: clang 18.1.8 from Arch repos with nxdk-cc wrapper script
Additional environment information:
Expected behavior
The library compiles, using GNU-style parameters for the compiler
Actual behavior
Building the library aborts because MSVC-style parameters were passed to clang
clang: error: no such file or directory: '/W3'
clang: error: no such file or directory: '/utf-8'
Steps to reproduce
I don't expect anyone to actually reproduce this because actually triggering the error is very much a niche thing, but these are the steps:
Summary
CMakeLists.txt
currently usesCMAKE_C_SIMULATE_ID
(if set) to decide which cli parameter syntax to use. This is not correct usage of this variable, as its value specifies ABI compatibility, not frontend cli syntax (docs here).Instead,
CMAKE_C_COMPILER_FRONTEND_VARIANT
should be used for that instead (docs here).This issue will rarely cause problems as most people using clang for the MSVC ABI will probably use clang-cl, but I did hit it while updating the nxdk-based Xbox port of Mbed-TLS, where we use clang as our compiler, but with GNU-style cli while targeting MSVC ABI.
The issue was introduced by #8389 / #9273
System information
Mbed TLS version: 3.6.2 and development branch
Operating system and version: Arch Linux host, nxdk target
Compiler and options: clang 18.1.8 from Arch repos with nxdk-cc wrapper script
Additional environment information:
Expected behavior
The library compiles, using GNU-style parameters for the compiler
Actual behavior
Building the library aborts because MSVC-style parameters were passed to clang
Steps to reproduce
I don't expect anyone to actually reproduce this because actually triggering the error is very much a niche thing, but these are the steps:
make NXDK_ONLY=y
nxdk-cmake -DCMAKE_BUILD_TYPE=Release ../ -GNinja -DMBEDTLS_FATAL_WARNINGS=OFF -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF
ninja
Additional information
For reference, these are the variable values for nxdk:
The text was updated successfully, but these errors were encountered: