[libcxx][AIX] Switch build compiler to clang

This patch switches the build compiler for AIX from ibm-clang to clang. ibm-clang++_r has `-pthread` by default, but clang for AIX doesn't, so `-pthread` had to be added to the test config. A bunch of tests now pass, so the `XFAIL` was removed. This patch also switch the build to use the visibility support available in clang-15 to control symbols exported by the shared library (AIX traditionally uses explicit export lists for this purpose).

Reviewed By: #libc, #libc_abi, daltenty, #libunwind, ldionne

Differential Revision: https://reviews.llvm.org/D127470
This commit is contained in:
Jake Egan 2022-06-13 21:44:58 -04:00
parent ac4006b0d6
commit 1cf4113952
182 changed files with 22 additions and 356 deletions

View File

@ -479,6 +479,11 @@ if(ZOS)
add_target_flags_if_supported("-fzos-le-char-mode=ebcdic")
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
add_target_flags_if_supported("-mdefault-visibility-export-mapping=explicit")
set(CMAKE_AIX_EXPORT_ALL_SYMBOLS OFF)
endif()
# Configure compiler.
include(config-ix)

View File

@ -3,6 +3,7 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
set(CMAKE_C_FLAGS "-D__LIBC_NO_CPP_MATH_OVERLOADS__" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-D__LIBC_NO_CPP_MATH_OVERLOADS__" CACHE STRING "")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-G -Wl,-bcdtors:all:-2147483548:s" CACHE STRING "")
set(CMAKE_AR "/usr/bin/ar" CACHE FILEPATH "")
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")

View File

@ -52,6 +52,8 @@
# define _LIBCPP_OBJECT_FORMAT_COFF 1
#elif defined(__wasm__)
# define _LIBCPP_OBJECT_FORMAT_WASM 1
#elif defined(_AIX)
# define _LIBCPP_OBJECT_FORMAT_XCOFF 1
#else
// ... add new file formats here ...
#endif
@ -121,12 +123,15 @@
// the dylib for backwards compatibility.
# define _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
#elif _LIBCPP_ABI_VERSION == 1
# if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
# if !(defined(_LIBCPP_OBJECT_FORMAT_COFF)||defined(_LIBCPP_OBJECT_FORMAT_XCOFF))
// Enable compiling copies of now inline methods into the dylib to support
// applications compiled against older libraries. This is unnecessary with
// COFF dllexport semantics, since dllexport forces a non-inline definition
// of inline functions to be emitted anyway. Our own non-inline copy would
// conflict with the dllexport-emitted copy, so we disable it.
// conflict with the dllexport-emitted copy, so we disable it. For XCOFF,
// the linker will take issue with the symbols in the shared object if the
// weak inline methods get visibility (such as from -fvisibility-inlines-hidden),
// so disable it.
# define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
# endif
// Feature macros for disabling pre ABI v1 features. All of these options

View File

@ -6,7 +6,7 @@ lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
config.substitutions.append(('%{flags}', ''))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -D__LIBC_NO_CPP_MATH_OVERLOADS__ -I %{include} -I %{libcxx}/test/support'
'-nostdinc++ -D__LIBC_NO_CPP_MATH_OVERLOADS__ -I %{include} -I %{libcxx}/test/support -pthread'
))
config.substitutions.append(('%{link_flags}',
'-nostdlib++ -L %{lib} -lc++ -lc++abi -latomic -Wl,-bbigtoc'

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const_reference at(size_type pos) const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const charT& back() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const charT& front() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const_reference operator[](size_type pos) const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void clear(); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// bool empty() const noexcept; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// size_type length() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void reserve(size_type res_arg); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void resize(size_type n); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void resize(size_type n, charT c); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void shrink_to_fit(); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// size_type size() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template<class _Tp>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>& operator=(charT c); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(const basic_string<charT,traits,Allocator>& str); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(const basic_string& str, const Allocator& alloc); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(initializer_list<charT> il, const Allocator& a = Allocator()); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template<class InputIterator>

View File

@ -9,8 +9,6 @@
// <string>
// UNSUPPORTED: c++03, c++11, c++14
// XFAIL: LIBCXX-AIX-FIXME
// template<class InputIterator,
// class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// basic_string(InputIterator, InputIterator, Allocator = Allocator())

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(basic_string<charT,traits,Allocator>&& str); // constexpr since C++20

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(basic_string&& str, const Allocator& alloc); // constexpr since C++20

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -8,8 +8,6 @@
// <string>
// XFAIL: LIBCXX-AIX-FIXME
// basic_string(const charT* s, const Allocator& a = Allocator()); // constexpr since C++20
#include <string>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(const charT* s, size_type n, const Allocator& a = Allocator()); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(size_type n, charT c, const Allocator& a = Allocator()); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// explicit basic_string(basic_string_view<CharT, traits> sv, const Allocator& a = Allocator()); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>& operator=(basic_string_view<charT, traits> sv); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// UNSUPPORTED: c++03, c++11, c++14

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// UNSUPPORTED: c++03, c++11, c++14

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string(const basic_string<charT,traits,Allocator>& str,

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// iterator begin(); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const_iterator cbegin() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const_iterator cend() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const_reverse_iterator crbegin() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// const_reverse_iterator crend() const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// iterator end(); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// reverse_iterator rbegin(); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// reverse_iterator rend(); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template <class T>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// UNSUPPORTED: c++03
// <string>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template<class InputIterator>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>& append(const charT* s); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void push_back(charT c) // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template <class T>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// UNSUPPORTED: c++03
// <string>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template<class InputIterator>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>& assign(const charT* s); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// size_type copy(charT* s, size_type n, size_type pos = 0) const; // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// iterator erase(const_iterator p); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// iterator erase(const_iterator first, const_iterator last); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void pop_back(); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// iterator insert(const_iterator p, charT c); // constexpr since C++20

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// iterator insert(const_iterator p, initializer_list<charT> il); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template<class InputIterator>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// iterator insert(const_iterator p, size_type n, charT c); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template <class T>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>& operator+=(charT c); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// UNSUPPORTED: c++03
// <string>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>& operator+=(const charT* s); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// UNSUPPORTED: c++03
// <string>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template<class InputIterator>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template <class T>

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// basic_string<charT,traits,Allocator>&

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// void swap(basic_string& s); // constexpr since C++20

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: LIBCXX-AIX-FIXME
// <string>
// template<class charT, class traits, class Allocator>

Some files were not shown because too many files have changed in this diff Show More