[llvm-bugs] [Bug 51058] New: clang 12.0.1 cannot cross-compile libc++abi for arm-linux-gnueabihf with gcc-10-libstdc++

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 11 23:49:43 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51058

            Bug ID: 51058
           Summary: clang 12.0.1 cannot cross-compile libc++abi for
                    arm-linux-gnueabihf with gcc-10-libstdc++
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andrei.alekseenko at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

I don't really know whether the selected component is correct, possibly it
should be moved to libc++abi, but clang-11 is compiling it successfully while
clang-12 fails.
Compiling with clang-12 for targets x86_64 and aarch64 is successful, only
32-bit arm reveals problem (maybe other 32-bit archs too?)

Host OS: Ubuntu 20.04.2
Host OS Arch: x86_64
GCC: arm-linux-gnueabihf-gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0

Here is build log:

-- The C compiler identification is Clang 12.0.1
-- The CXX compiler identification is Clang 12.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-12 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++-12 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan setting CPP STANDARD: 17 WITH EXTENSIONS OFF
-- Conan: Adjusting fPIC flag (ON)
-- Conan: Compiler Clang>=8, checking major version 12
-- Conan: Checking correct version: 12
-- Conan: C++ stdlib: libstdc++
-- Configuring for standalone build.
-- Linker detection: GNU ld
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components:
Interpreter 
-- Libc++abi will be using libc++ includes from
/home/andrey/.conan/data/libcxxabi/12.0.1/mobile/stable/build/0f3a5e3fd89952192fc5899d839834dba42bac08/source_subfolder/libcxxabi/../libcxx/include
-- Looking for fopen in c
-- Looking for fopen in c - found
-- Looking for __gcc_personality_v0 in gcc_s
-- Looking for __gcc_personality_v0 in gcc_s - found
-- Looking for __aeabi_uldivmod in gcc
-- Looking for __aeabi_uldivmod in gcc - not found
-- Performing Test LIBCXXABI_HAS_NODEFAULTLIBS_FLAG
-- Performing Test LIBCXXABI_HAS_NODEFAULTLIBS_FLAG - Success
-- Performing Test LIBCXXABI_HAS_COMMENT_LIB_PRAGMA
-- Performing Test LIBCXXABI_HAS_COMMENT_LIB_PRAGMA - Success
-- Performing Test LIBCXXABI_HAS_NOSTDINCXX_FLAG
-- Performing Test LIBCXXABI_HAS_NOSTDINCXX_FLAG - Success
-- Looking for dladdr in dl
-- Looking for dladdr in dl - found
-- Looking for pthread_once in pthread
-- Looking for pthread_once in pthread - found
-- Looking for __cxa_thread_atexit_impl in c
-- Looking for __cxa_thread_atexit_impl in c - found
-- Looking for write in System
-- Looking for write in System - not found
-- Performing Test LIBCXXABI_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_W_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_W_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WALL_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WALL_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WCONVERSION_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WCONVERSION_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WMISMATCHED_TAGS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WMISMATCHED_TAGS_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WMISSING_BRACES_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WMISSING_BRACES_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WNEWLINE_EOF_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WNEWLINE_EOF_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_FUNCTION_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_FUNCTION_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSHADOW_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSHADOW_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSHORTEN_64_TO_32_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_COMPARE_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_COMPARE_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_CONVERSION_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_CONVERSION_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_PARAMETER_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_PARAMETER_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_VARIABLE_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_VARIABLE_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WWRITE_STRINGS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WWRITE_STRINGS_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNDEF_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNDEF_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WNO_ERROR_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WNO_ERROR_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WX_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WX_FLAG - Failed
-- Performing Test LIBCXXABI_SUPPORTS_PEDANTIC_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_PEDANTIC_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_FSTRICT_ALIASING_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_FSTRICT_ALIASING_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_EHSC_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_EHSC_FLAG - Failed
-- Performing Test LIBCXXABI_SUPPORTS_FUNWIND_TABLES_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_FUNWIND_TABLES_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG - Success
-- Could not find ParallelSTL, libc++abi will not attempt to use it but the
build may fail if the libc++ in use needs it to be available.
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DATAROOTDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR


-- Build files have been written to:
/home/andrey/.conan/data/libcxxabi/12.0.1/mobile/stable/build/0f3a5e3fd89952192fc5899d839834dba42bac08/build
[2/39] Building CXX object
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_aux_runtime.cpp.o
FAILED:
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_aux_runtime.cpp.o 
/usr/bin/clang++-12 -DHAVE___CXA_THREAD_ATEXIT_IMPL -D_GLIBCXX_USE_CXX11_ABI=0
-D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_EXTERN_TEMPLATE
-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
-D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_LINK_PTHREAD_LIB
-I../source_subfolder/libcxxabi/include
-I../source_subfolder/libcxxabi/../libcxx/include -std=c++17 -pthread -fPIC
-isystem /usr/arm-linux-gnueabihf/include/c++/10/arm-linux-gnueabihf -isystem
/usr/arm-linux-gnueabihf/include     -O3 -DNDEBUG  -fPIC -nostdinc++
-Werror=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmismatched-tags
-Wmissing-braces -Wnewline-eof -Wunused-function -Wshadow -Wshorten-64-to-32
-Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4
-Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef
-Wno-suggest-override -Wno-error -pedantic -fstrict-aliasing -funwind-tables
-D_DEBUG -UNDEBUG -std=c++20 -MD -MT
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_aux_runtime.cpp.o
-MF
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_aux_runtime.cpp.o.d
-o
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_aux_runtime.cpp.o
-c ../source_subfolder/libcxxabi/src/cxa_aux_runtime.cpp
In file included from ../source_subfolder/libcxxabi/src/cxa_aux_runtime.cpp:14:
../source_subfolder/libcxxabi/../libcxx/include/typeinfo:238:14: error: cast
from pointer to smaller type
'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t'
(aka 'unsigned int') loses information
      return reinterpret_cast<__type_name_t>(__v);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source_subfolder/libcxxabi/../libcxx/include/typeinfo:244:16: error:
reinterpret_cast from
'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t'
(aka 'unsigned int') to 'size_t' (aka 'unsigned long') is not allowed
        return reinterpret_cast<size_t>(__v);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
[6/39] Building CXX object
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o
FAILED:
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o 
/usr/bin/clang++-12 -DHAVE___CXA_THREAD_ATEXIT_IMPL -D_GLIBCXX_USE_CXX11_ABI=0
-D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_EXTERN_TEMPLATE
-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
-D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_LINK_PTHREAD_LIB
-I../source_subfolder/libcxxabi/include
-I../source_subfolder/libcxxabi/../libcxx/include -std=c++17 -pthread -fPIC
-isystem /usr/arm-linux-gnueabihf/include/c++/10/arm-linux-gnueabihf -isystem
/usr/arm-linux-gnueabihf/include     -O3 -DNDEBUG  -fPIC -nostdinc++
-Werror=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmismatched-tags
-Wmissing-braces -Wnewline-eof -Wunused-function -Wshadow -Wshorten-64-to-32
-Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4
-Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef
-Wno-suggest-override -Wno-error -pedantic -fstrict-aliasing -funwind-tables
-D_DEBUG -UNDEBUG -std=c++20 -MD -MT
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o
-MF
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o.d
-o
source_subfolder/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o
-c ../source_subfolder/libcxxabi/src/cxa_default_handlers.cpp
In file included from
../source_subfolder/libcxxabi/src/cxa_default_handlers.cpp:17:
In file included from ../source_subfolder/libcxxabi/src/private_typeinfo.h:14:
../source_subfolder/libcxxabi/../libcxx/include/typeinfo:238:14: error: cast
from pointer to smaller type
'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t'
(aka 'unsigned int') loses information
      return reinterpret_cast<__type_name_t>(__v);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source_subfolder/libcxxabi/../libcxx/include/typeinfo:244:16: error:
reinterpret_cast from
'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t'
(aka 'unsigned int') to 'size_t' (aka 'unsigned long') is not allowed
        return reinterpret_cast<size_t>(__v);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210712/6aa4aebd/attachment-0001.html>


More information about the llvm-bugs mailing list