[MacPorts] #62770: clang++ 11 broken by MacOS 11.3 update

MacPorts noreply at macports.org
Wed Apr 28 16:18:39 UTC 2021


#62770: clang++ 11 broken by MacOS 11.3 update
-----------------------+---------------------------
  Reporter:  haberg-1  |      Owner:  jeremyhu
      Type:  defect    |     Status:  assigned
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.6.4
Resolution:            |   Keywords:  bigsur x86_64
      Port:  clang-11  |
-----------------------+---------------------------
Changes (by jmroot):

 * status:  new => assigned
 * owner:  (none) => jeremyhu
 * cc: kencu (added)
 * milestone:  MacPorts Future =>


Old description:

> The update to MacOS 11.3 and Xcode 12.5, with Command Line Tools, broke
> clang++ 11: It can not find system headers such as wchar.h, it seems.
> Unclear with workarounds. Curiously, g++ 10 works.
>
> Specifically,
> /opt/local/bin/clang++-mp-11 hello_world.cc -o hello_world
> produces the errors below, whereas
> /opt/local/bin/g++-mp-10 hello_world.cc -o hello_world
> works.
>
>> % /opt/local/bin/clang++-mp-11 hello_world.cc -o hello_world
> In file included from hello_world.cc:2:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:214:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:95:
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:137:77: error:
> use of undeclared identifier 'wcschr'
> wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return
> (wchar_t*)wcschr(__s, __c);}
> ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:144:87: error:
> use of undeclared identifier 'wcspbrk'
> wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2)
> {return (wchar_t*)wcspbrk(__s1, __s2);}
> ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:151:78: error:
> use of undeclared identifier 'wcsrchr'; did you mean 'wcschr'?
> wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return
> (wchar_t*)wcsrchr(__s, __c);}
> ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:139:16: note:
> 'wcschr' declared here
> const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return
> __libcpp_wcschr(__s, __c);}
>                ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:86: error:
> use of undeclared identifier 'wcsstr'; did you mean 'wcschr'?
> wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2)
> {return (wchar_t*)wcsstr(__s1, __s2);}
> ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:16: note:
> 'wcschr' declared here
>       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return
> __libcpp_wcschr(__s, __c);}
>                ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:86: error:
> no matching function for call to 'wcschr'
> wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2)
> {return (wchar_t*)wcsstr(__s1, __s2);}
> ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:16: note:
> candidate disabled: <no message provided>
>       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return
> __libcpp_wcschr(__s, __c);}
>                ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:93: error:
> cannot initialize a parameter of type 'wchar_t *' with an lvalue of type
> 'const wchar_t *'
> wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2)
> {return (wchar_t*)wcsstr(__s1, __s2);}
> ^~~~
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:38: note:
> passing argument to parameter '__s' here
>       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return
> __libcpp_wcschr(__s, __c);}
>                                      ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:165:60: error:
> unknown type name 'size_t'
> wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n)
> {return (wchar_t*)wmemchr(__s, __c, __n);}
>                                                            ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:167:57: error:
> unknown type name 'size_t'
> const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n)
> {return __libcpp_wmemchr(__s, __c, __n);}
>                                                         ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:169:57: error:
> unknown type name 'size_t'
>       wchar_t* wmemchr(      wchar_t* __s, wchar_t __c, size_t __n)
> {return __libcpp_wmemchr(__s, __c, __n);}
>                                                         ^
> In file included from hello_world.cc:2:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:214:
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:189:14: error:
> use of undeclared identifier 'mbstate_t'
> typedef fpos<mbstate_t>    streampos;
>              ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:190:14: error:
> use of undeclared identifier 'mbstate_t'
> typedef fpos<mbstate_t>    wstreampos;
>              ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:195:14: error:
> use of undeclared identifier 'mbstate_t'
> typedef fpos<mbstate_t>    u16streampos;
>              ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:196:14: error:
> use of undeclared identifier 'mbstate_t'
> typedef fpos<mbstate_t>    u32streampos;
>              ^
> In file included from hello_world.cc:2:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:215:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/__locale:14:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:506:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/string_view:175:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/__string:57:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/algorithm:639:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:46:
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:49:9: error: no
> member named 'ptrdiff_t' in the global namespace
> using ::ptrdiff_t;
>       ~~^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:50:9: error: no
> member named 'size_t' in the global namespace
> using ::size_t;
>       ~~^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:53:9: error: no
> member named 'max_align_t' in the global namespace
> using ::max_align_t;
>       ~~^
> In file included from hello_world.cc:2:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:215:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/__locale:14:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:506:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/string_view:175:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/__string:57:
> In file included from
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/algorithm:639:
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:61:5:
> error: unknown type name 'size_t'
>     size_t    __size_;
>     ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:65:38:
> error: unknown type name 'size_t'
>     initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT
>                                      ^
> /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:73:13:
> error: unknown type name 'size_t'
>     typedef size_t    size_type;
>             ^
> fatal error: too many errors emitted, stopping now [-ferror-limit=]
> 20 errors generated.
>
New description:

 The update to MacOS 11.3 and Xcode 12.5, with Command Line Tools, broke
 clang++ 11: It can not find system headers such as wchar.h, it seems.
 Unclear with workarounds. Curiously, g++ 10 works.

 Specifically,
 /opt/local/bin/clang++-mp-11 hello_world.cc -o hello_world
 produces the errors below, whereas
 /opt/local/bin/g++-mp-10 hello_world.cc -o hello_world
 works.

 —
 {{{
 % /opt/local/bin/clang++-mp-11 hello_world.cc -o hello_world
 In file included from hello_world.cc:2:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:214:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:95:
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:137:77: error:
 use of undeclared identifier 'wcschr'
 wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return
 (wchar_t*)wcschr(__s, __c);}
 ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:144:87: error:
 use of undeclared identifier 'wcspbrk'
 wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2)
 {return (wchar_t*)wcspbrk(__s1, __s2);}
 ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:151:78: error:
 use of undeclared identifier 'wcsrchr'; did you mean 'wcschr'?
 wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return
 (wchar_t*)wcsrchr(__s, __c);}
 ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:139:16: note:
 'wcschr' declared here
 const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return
 __libcpp_wcschr(__s, __c);}
                ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:86: error:
 use of undeclared identifier 'wcsstr'; did you mean 'wcschr'?
 wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return
 (wchar_t*)wcsstr(__s1, __s2);}
 ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:16: note:
 'wcschr' declared here
       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return
 __libcpp_wcschr(__s, __c);}
                ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:86: error: no
 matching function for call to 'wcschr'
 wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return
 (wchar_t*)wcsstr(__s1, __s2);}
 ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:16: note:
 candidate disabled: <no message provided>
       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return
 __libcpp_wcschr(__s, __c);}
                ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:93: error:
 cannot initialize a parameter of type 'wchar_t *' with an lvalue of type
 'const wchar_t *'
 wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return
 (wchar_t*)wcsstr(__s1, __s2);}
 ^~~~
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:38: note:
 passing argument to parameter '__s' here
       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return
 __libcpp_wcschr(__s, __c);}
                                      ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:165:60: error:
 unknown type name 'size_t'
 wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n)
 {return (wchar_t*)wmemchr(__s, __c, __n);}
                                                            ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:167:57: error:
 unknown type name 'size_t'
 const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n)
 {return __libcpp_wmemchr(__s, __c, __n);}
                                                         ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:169:57: error:
 unknown type name 'size_t'
       wchar_t* wmemchr(      wchar_t* __s, wchar_t __c, size_t __n)
 {return __libcpp_wmemchr(__s, __c, __n);}
                                                         ^
 In file included from hello_world.cc:2:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:214:
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:189:14: error: use
 of undeclared identifier 'mbstate_t'
 typedef fpos<mbstate_t>    streampos;
              ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:190:14: error: use
 of undeclared identifier 'mbstate_t'
 typedef fpos<mbstate_t>    wstreampos;
              ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:195:14: error: use
 of undeclared identifier 'mbstate_t'
 typedef fpos<mbstate_t>    u16streampos;
              ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:196:14: error: use
 of undeclared identifier 'mbstate_t'
 typedef fpos<mbstate_t>    u32streampos;
              ^
 In file included from hello_world.cc:2:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:215:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/__locale:14:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:506:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/string_view:175:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/__string:57:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/algorithm:639:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:46:
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:49:9: error: no
 member named 'ptrdiff_t' in the global namespace
 using ::ptrdiff_t;
       ~~^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:50:9: error: no
 member named 'size_t' in the global namespace
 using ::size_t;
       ~~^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:53:9: error: no
 member named 'max_align_t' in the global namespace
 using ::max_align_t;
       ~~^
 In file included from hello_world.cc:2:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:215:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/__locale:14:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:506:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/string_view:175:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/__string:57:
 In file included from
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/algorithm:639:
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:61:5:
 error: unknown type name 'size_t'
     size_t    __size_;
     ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:65:38:
 error: unknown type name 'size_t'
     initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT
                                      ^
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:73:13:
 error: unknown type name 'size_t'
     typedef size_t    size_type;
             ^
 fatal error: too many errors emitted, stopping now [-ferror-limit=]
 20 errors generated.
 }}}
 —

--

-- 
Ticket URL: <https://trac.macports.org/ticket/62770#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list