Page MenuHomePhabricator

[libc++] Fix the LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT setting
ClosedPublic

Authored by ldionne on May 15 2020, 2:40 PM.

Details

Summary

When the __config_site header is generated, but LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT
wasn't specified, _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT would be defined
to 0, which was the NonUnique RTTI comparison implementation. The intent
was to use the Unique RTTI comparison implementation in that case, which
caused https://llvm.org/PR45549.

Instead, use a proper "switch" to select the RTTI comparison implementation.
Note that 0 can't be used as a value, because that is treated the same
by CMake as a variable that is just not defined.

Diff Detail

Event Timeline

ldionne created this revision.May 15 2020, 2:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2020, 2:40 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.May 28 2020, 9:50 AM
This revision is now accepted and ready to land.May 28 2020, 9:50 AM
This revision was automatically updated to reflect the committed changes.

This change breaks building on Fedora 32 with clang-10 (as shipped by Fedora). Can we revert this or commit a quick fix?

FAIL: libc++ :: libcxx/modules/clocale_exports.compile.pass.cpp (55739 of 64166)

  • TEST 'libc++ :: libcxx/modules/clocale_exports.compile.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp -v -std=c++2a -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules -fsyntax-only

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-1.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
(in-process)
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names -main-file-name clocale_exports.compile.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/modules -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fmodules -fimplicit-module-maps -fmodules-cache-path=/tmp/org.llvm.clang.dave/ModuleCache -fmodules-validate-system-headers -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -x c++ /home/dave/s/lp/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
While building module 'std' imported from /home/dave/s/lp/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp:22:
In file included from <module-includes>:31:
In file included from /home/dave/s/lp/libcxx/include/complex.h:28:
In file included from /home/dave/s/lp/libcxx/include/ccomplex:20:
In file included from /home/dave/s/lp/libcxx/include/complex:247:
In file included from /home/dave/s/lp/libcxx/include/sstream:173:
In file included from /home/dave/s/lp/libcxx/include/ostream:138:
In file included from /home/dave/s/lp/libcxx/include/ios:215:
In file included from /home/dave/s/lp/libcxx/include/
locale:14:
In file included from /home/dave/s/lp/libcxx/include/string:506:
In file included from /home/dave/s/lp/libcxx/include/string_view:175:
In file included from /home/dave/s/lp/libcxx/include/__string:57:
In file included from /home/dave/s/lp/libcxx/include/algorithm:643:
In file included from /home/dave/s/lp/libcxx/include/memory:668:
/home/dave/s/lp/libcxx/include/typeinfo:267:5: error: invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION

error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION

^

/home/dave/s/lp/libcxx/include/typeinfo:269:6: error: C++ requires a type specifier for all declarations

__impl;
^

/home/dave/s/lp/libcxx/include/typeinfo:280:5: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

__impl::__type_name_t __type_name;
^

/home/dave/s/lp/libcxx/include/typeinfo:284:21: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

: __type_name(__impl::__string_to_type_name(__n)) {}
              ^

/home/dave/s/lp/libcxx/include/typeinfo:293:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__type_name_to_string(__type_name);
       ^

/home/dave/s/lp/libcxx/include/typeinfo:299:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__lt(__type_name, __arg.__type_name);
       ^

/home/dave/s/lp/libcxx/include/typeinfo:305:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__hash(__type_name);
       ^

/home/dave/s/lp/libcxx/include/typeinfo:311:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__eq(__type_name, __arg.__type_name);
       ^

/home/dave/s/lp/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp:22:10: fatal error: could not build module 'std'
#include <clocale>
~~~~~~~~^
9 errors generated.


FAIL: libc++ :: libcxx/modules/cinttypes_exports.compile.pass.cpp (56023 of 64166)

  • TEST 'libc++ :: libcxx/modules/cinttypes_exports.compile.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp -v -std=c++2a -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules -fsyntax-only

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-1.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
(in-process)
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names -main-file-name cinttypes_exports.compile.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/modules -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fmodules -fimplicit-module-maps -fmodules-cache-path=/tmp/org.llvm.clang.dave/ModuleCache -fmodules-validate-system-headers -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -x c++ /home/dave/s/lp/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
While building module 'std' imported from /home/dave/s/lp/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp:22:
In file included from <module-includes>:31:
In file included from /home/dave/s/lp/libcxx/include/complex.h:28:
In file included from /home/dave/s/lp/libcxx/include/ccomplex:20:
In file included from /home/dave/s/lp/libcxx/include/complex:247:
In file included from /home/dave/s/lp/libcxx/include/sstream:173:
In file included from /home/dave/s/lp/libcxx/include/ostream:138:
In file included from /home/dave/s/lp/libcxx/include/ios:215:
In file included from /home/dave/s/lp/libcxx/include/
locale:14:
In file included from /home/dave/s/lp/libcxx/include/string:506:
In file included from /home/dave/s/lp/libcxx/include/string_view:175:
In file included from /home/dave/s/lp/libcxx/include/__string:57:
In file included from /home/dave/s/lp/libcxx/include/algorithm:643:
In file included from /home/dave/s/lp/libcxx/include/memory:668:
/home/dave/s/lp/libcxx/include/typeinfo:267:5: error: invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION

error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION

^

/home/dave/s/lp/libcxx/include/typeinfo:269:6: error: C++ requires a type specifier for all declarations

__impl;
^

/home/dave/s/lp/libcxx/include/typeinfo:280:5: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

__impl::__type_name_t __type_name;
^

/home/dave/s/lp/libcxx/include/typeinfo:284:21: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

: __type_name(__impl::__string_to_type_name(__n)) {}
              ^

/home/dave/s/lp/libcxx/include/typeinfo:293:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__type_name_to_string(__type_name);
       ^

/home/dave/s/lp/libcxx/include/typeinfo:299:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__lt(__type_name, __arg.__type_name);
       ^

/home/dave/s/lp/libcxx/include/typeinfo:305:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__hash(__type_name);
       ^

/home/dave/s/lp/libcxx/include/typeinfo:311:14: error: 'std::type_info::__impl' (aka 'int') is not a class, namespace, or enumeration

return __impl::__eq(__type_name, __arg.__type_name);
       ^

/home/dave/s/lp/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp:22:10: fatal error: could not build module 'std'
#include <cinttypes>
~~~~~~~~^
9 errors generated.



Failing Tests (2):

libc++ :: libcxx/modules/cinttypes_exports.compile.pass.cpp
libc++ :: libcxx/modules/clocale_exports.compile.pass.cpp

Testing Time: 167.45s

Unsupported Tests  : 12368
Expected Passes    : 51643
Expected Failures  :   153
Unexpected Failures:     2

10 warning(s) in tests
FAILED: CMakeFiles/check-all

Thanks for the heads up. I've been looking at the issue without being able to reproduce it on a recent clang -- so far I think this is a modules cache issue.