Skip to content

llvm-17.0.0-rc1: libcxxabi does not build on macOS 10.12.6 #64226

@debohman

Description

@debohman
FAILED: libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_handlers.cpp.o 
/tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1-build/./bin/clang++ --target=x86_64-apple-darwin16.7.0 -DLIBCXX_BUILDING_LIBCXXABI -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCXXABI_BUILDING_LIBRARY -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1/libcxxabi/../libcxx/src -I/tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1-build/include/c++/v1 -I/tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1/libcxxabi/include -I/usr/local/include -fPIC -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 -fdiagnostics-color  -O3 -DNDEBUG -std=c++20 -fPIC -nostdinc++ -fstrict-aliasing -funwind-tables -D_DEBUG -UNDEBUG -Wall -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-error -MD -MT libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_handlers.cpp.o -MF libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_handlers.cpp.o.d -o libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_handlers.cpp.o -c /tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1/libcxxabi/src/cxa_handlers.cpp
In file included from /tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1/libcxxabi/src/cxa_handlers.cpp:12:
In file included from /tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1-build/include/c++/v1/stdexcept:48:
In file included from /tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1-build/include/c++/v1/iosfwd:106:
In file included from /tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1-build/include/c++/v1/__std_mbstate_t.h:14:
In file included from /tera/tera/debo/Projects/llvm/llvmorg-17.0.0-rc1-build/include/c++/v1/__mbstate_t.h:48:
/usr/include/sys/_types/_mbstate_t.h:31:9: error: unknown type name '__darwin_mbstate_t'
   31 | typedef __darwin_mbstate_t mbstate_t;
      |         ^
1 error generated.

The following change allows it to build:

diff --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h
index 2b9e719b1f2e..044c10a58c04 100644
--- a/libcxx/include/__mbstate_t.h
+++ b/libcxx/include/__mbstate_t.h
@@ -42,7 +42,10 @@
 #elif __has_include(<bits/types/mbstate_t.h>)
 #   include <bits/types/mbstate_t.h> // works on most Unixes
 #elif __has_include(<sys/_types/_mbstate_t.h>)
-#   include <sys/_types/_mbstate_t.h> // works on Darwin
+#  if __has_include(<machine/_types.h>)
+#    include <machine/_types.h>
+#  endif
+#  include <sys/_types/_mbstate_t.h> // works on Darwin
 #elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) && __has_include_next(<wchar.h>)
 #   include_next <wchar.h> // fall back to the C standard provider of mbstate_t
 #elif __has_include_next(<uchar.h>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-probleminvalidResolved as invalid, i.e. not a buglibc++abilibc++abi C++ Runtime Library. Not libc++.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions