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
258: Fix 'cc --print-sysroot' call r=jethrogb a=DrTobe
This PR contains two changes:
1. The first commit fixes a bug that the result of `cc --print-sysroot` is not properly checked before it is evaluated and added as a compiler flag. This one should be easy to accept.
2. The second commit is harder to accept because it changes code in the `vendor` directory which should probably stay untouched? I just did not know how to append a compiler flag to the CMake process without doing so.
Without the new compiler flag `-Wno-unused-but-set-variable`, Apple clang 14 fails with the following error message and this conclusion seems to be _correct_:
```
mbedtls-sys/vendor/library/bignum.c:1395:29: error: variable 't' set but not used [-Werror,-Wunused-but-set-variable]
mbedtls_mpi_uint c = 0, t = 0;
^
```
So to fix builds for compilers which properly detect this, we need to somehow change the compiler flags for the C code. Setting it with `cmk.cflag(...)` in `mbedtls-sys/build/cmake.rs` did not work. I have thought about setting `CMAKE_C_FLAGS` before calling CMake but the new flag _must_ appear behind `-Wall` which is set by the `CMakeLists.txt` so I guess this will not work either. So how would you like to do this? Any other ideas?
Edit: The second commit has been removed (see discussion)
Co-authored-by: Tobias Naumann <[email protected]>
0 commit comments