[PATCH] D142279: [cmake] Use LLVM_ENABLE_ASSERTIONS to enable assertions in libstdc++

Steven Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 09:52:07 PST 2023


srj added a comment.

> I can reproduce the error above on a debian:bookworm docker using gcc-12 12.2.0-14. But why are you hitting this when building LLVM? Where does -Werror=restrict come from? I don't think we enable that in normal LLVM builds.

The error comes not when building LLVM itself, but when building something that *uses* LLVM: the LLVM #includes now bring in the `_GLIBCXX_ASSERTIONS` definition. Our code had previously enabled `-Wrestrict`, but since `_GLIBCXX_ASSERTIONS` wasn't enabled before, this apparently-pre-existing-bug in gcc didn't show itself. In other words: the addition of _GLIBCXX_ASSERTIONS changes the downstream compilation environment for anything that is using LLVM as a library and compiling under gcc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142279/new/

https://reviews.llvm.org/D142279



More information about the llvm-commits mailing list