llvm-project/libcxx
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
..
benchmarks [libc++][ranges] Implement ranges::minmax and ranges::minmax_element 2022-04-14 15:37:22 +02:00
cmake [runtimes] [cmake] Fix -Werror detection in common build configs 2022-05-12 22:22:15 +03:00
docs [libc++][ranges] Implement `views::drop`. 2022-05-10 09:31:05 -07:00
include [libc++] Mark <stdatomic.h> as requiring C++23 2022-05-12 14:45:49 -04:00
lib [libc++][NFC] Refactor the ABI changelog 2022-03-24 10:24:43 -04:00
src Fix "the the" typo in documentation and user facing strings 2022-05-05 17:52:08 +02:00
test [libc++][ranges] Implement `views::drop`. 2022-05-10 09:31:05 -07:00
utils [libc++][P0943] Add stdatomic.h header. 2022-05-06 09:52:48 -04:00
.clang-format [libc++] Update clang-format to C++20. 2021-10-30 12:50:57 +02:00
.clang-tidy [libc++] Enable modernize-loop-convert 2022-03-18 20:34:19 +01:00
.gitignore
CMakeLists.txt Revert "[msan][libcxx] Enable -fsanitize-memory-param-retval" 2022-04-30 15:19:16 +02:00
CREDITS.TXT Microsoft's floating-point to_chars powered by Ryu and Ryu Printf 2021-12-12 16:34:50 +01:00
LICENSE.TXT
TODO.TXT [libc++] Disallow volatile types in std::allocator 2021-09-22 11:47:38 -04:00
appveyor-reqs-install.cmd
appveyor.yml