llvm-project/libunwind
Martin Storsjö f8da28f522 [runtimes] [cmake] Fix -Werror detection in common build configs
We add `--unwindlib=none` to `CMAKE_REQUIRED_FLAGS`
to make sure that builds with a yet-incomplete toolchain succeed,
to avoid linker failures about missing unwindlib.

When this option is added to `CMAKE_REQUIRED_FLAGS`, it gets added to
both compile and link commands in CMake compile tests. If
`--unwindlib=none` is included in compilation commands, it causes
warnings about unused arguments, as the flag only is relevant for
linking.

Due to the warnings in CMake tests, the later CMake test for the
`-Werror` option failed (as the tested `-Werror` option caused the
preexisting warning due to unused `--unwindlib=none` to become a
hard error). Therefore, most CI configurations that build with
`LIBCXX_ENABLE_WERROR` didn't actually end up enabling `-Werror`
after all.

When looking at the CI build log of recent CI builds, they do
end up printing:

    -- Performing Test LIBCXX_SUPPORTS_WERROR_FLAG
    -- Performing Test LIBCXX_SUPPORTS_WERROR_FLAG - Failed
    -- Performing Test LIBCXX_SUPPORTS_WX_FLAG
    -- Performing Test LIBCXX_SUPPORTS_WX_FLAG - Failed

Thus while the configurations are meant to error out on warnings,
they actually haven't done that, due to the interaction of these
options.

To fix this, remove the individual cases of adding `--unwindlib=none`
into `CMAKE_REQUIRED_FLAGS` in libcxx and libunwind.
`runtimes/CMakeLists.txt` still adds `--unwindlib=none` if needed, but
not otherwise. (The same issue with enabling `-Werror` does remain
if `--unwindlib=none` strictly is needed though - that can be fixed
separately afterwards.)

These individual cases in libunwind and libcxx were added while
standalone builds of the runtimes still were supported - but no longer
are necessary now.

Differential Revision: https://reviews.llvm.org/D124375
2022-05-12 22:22:15 +03:00
..
cmake [runtimes] [cmake] Fix -Werror detection in common build configs 2022-05-12 22:22:15 +03:00
docs Replace links to archived mailing lists by links to Discourse forums 2022-03-23 10:10:20 -04:00
include [libunwind] Add SystemZ support 2022-05-02 14:35:29 +02:00
src [libunwind] Silence warnings about unused variables. NFC. 2022-05-04 22:55:02 +03:00
test [libunwind][SystemZ] Unwind out of signal handlers 2022-05-04 10:43:11 +02:00
.clang-format
CMakeLists.txt [runtimes] Print the testing configuration in use in libunwind and libc++abi 2022-05-11 10:18:09 -04:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00