[libcxx-commits] [libcxx] [libc++][hardening] Add an experimental function to log hardening errors (PR #149452)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 24 15:47:47 PDT 2025


zeroomega wrote:

Hi, after this change got landed, we are seeing a build failure on baremetal armv6m-none-eabi target, error message:

```
FAILED: libcxx/src/CMakeFiles/cxx_experimental.dir/experimental/log_hardening_failure.cpp.obj 
/b/s/w/ir/x/w/llvm_build/./bin/clang++ --target=armv6m-none-eabi -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GLIBCXX_ASSERTIONS -D_LARGEFILE_SOURCE -D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_LINK_PTHREAD_LIB -D_LIBCPP_LINK_RT_LIB -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/s/w/ir/x/w/llvm_build/include/armv6m-unknown-none-eabi/c++/v1 -I/b/s/w/ir/x/w/llvm_build/include/c++/v1 -isystem /b/s/w/ir/x/w/llvm_build/include/armv6m-unknown-none-eabi --target=armv6m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/b/s/w/ir/x/w/llvm_build/runtimes/runtimes-armv6m-none-eabi-bins=../../../llvm-llvm-project -ffile-prefix-map=/b/s/w/ir/x/w/llvm-llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=c++2b -UNDEBUG -faligned-allocation -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -fsized-deallocation -Wall -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wzero-length-array -Wdeprecated-redundant-constexpr-static-def -Wno-nullability-completeness -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-error -fno-exceptions -fno-rtti -D_LIBCPP_ENABLE_EXPERIMENTAL -fdebug-prefix-map=/b/s/w/ir/x/w/llvm_build/include/c++/v1=/b/s/w/ir/x/w/llvm-llvm-project/libcxx/include -nostdlibinc -MD -MT libcxx/src/CMakeFiles/cxx_experimental.dir/experimental/log_hardening_failure.cpp.obj -MF libcxx/src/CMakeFiles/cxx_experimental.dir/experimental/log_hardening_failure.cpp.obj.d -o libcxx/src/CMakeFiles/cxx_experimental.dir/experimental/log_hardening_failure.cpp.obj -c /b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/experimental/log_hardening_failure.cpp
/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/experimental/log_hardening_failure.cpp:21:8: error: reference to unresolved using declaration
   21 |   std::fputs(message, stderr);
      |        ^
/b/s/w/ir/x/w/llvm_build/include/c++/v1/cstdio:140:1: note: using declaration annotated with 'using_if_exists' here
  140 | using ::fputs _LIBCPP_USING_IF_EXISTS;
      | ^
/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/experimental/log_hardening_failure.cpp:21:3: error: excess elements in scalar initializer
   21 |   std::fputs(message, stderr);
      |   ^                 ~~~~~~~~
2 errors generated.
```

Build task: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8708441153070837249/overview
Could you take a look please? If it takes some time to fix, could you revert it?

https://github.com/llvm/llvm-project/pull/149452


More information about the libcxx-commits mailing list