Uploaded image for project: 'Swift'
  1. Swift
  2. SR-3472

compiler-rt on amd64 ubuntu targets i386 even if libstd++ is not present for i386

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: None
    • Labels:
      None

      Description

      compiler-rt builds for i386 even when there is no i386 ``libstdc++`` installed, so it fails on the linker step. Should we even be building for i386 here?

      The cmake does a check_library_exists in ``compiler-rt/cmake/config-ix.cmake``:
      check_library_exists(stdc++ __cxa_throw "" COMPILER_RT_HAS_LIBSTDCXX)

      But this isn't fine-grained enough for 64/32bit.

      I don't know which platforms compiler-rt should support by default.

      $ uname -a
      Linux asdf 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
      aka Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-45-generic x86_64)

      $ apt search 'libstdc++' | grep libstd | grep installed
      libstdc++-4.8-dev/xenial,now 4.8.5-4ubuntu2 amd64 [installed]

      $ mkdir jira-issue-i386
      $ git clone git@github.com:apple/swift.git
      $ swift/utils/update-checkout --clone
      $ swift/utils/build-script --preset=buildbot_incremental_linux

      – Target triple: x86_64-unknown-linux-gnu
      – Native target architecture is X86
      – Threads enabled.
      – Doxygen disabled.
      – Sphinx disabled.
      – Go bindings enabled.
      – Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
      – Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
      – OCaml bindings disabled.
      – Building with -fPIC
      – Constructing LLVMBuild project information
      – Targeting X86
      – Targeting ARM
      – Targeting AArch64
      – Targeting PowerPC
      – Targeting SystemZ
      – Clang version: 4.0.0
      – Configuring done
      – Generating done
      – Build files have been written to: /home/erg/build/buildbot_incremental/llvm-linux-x86_64

      Linker step:

      FAILED: : && /home/erg/build/buildbot_incremental/llvm-linux-x86_64/./bin/clang++ -fPIC -Wall -std=c+11 -Wno-unused-parameter -O3 -DNDEBUG -m32 -shared -Wl,-soname,libclang_rt.asan-i386.so -o /home/erg/build/buildbot_incremental/llvm-linux-x86_64/lib/clang/4.0.0/lib/linux/libclang_rt.asan-i386.so lib/interception/CMakeFiles/RTInterception.i386.dir/interception_linux.cc.o lib/interception/CMakeFiles/RTInterception.i386.dir/interception_mac.cc.o lib/interception/CMakeFiles/RTInterception.i386.dir/interception_win.cc.o lib/interception/CMakeFiles/RTInterception.i386.dir/interception_type_test.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_allocator.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_common.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_deadlock_detector1.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_deadlock_detector2.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_flags.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_flag_parser.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_libc.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_libignore.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_linux.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_linux_s390.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_mac.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_persistent_allocator.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_platform_limits_linux.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_platform_limits_posix.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_posix.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_printf.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_procmaps_common.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_procmaps_freebsd.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_procmaps_linux.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_procmaps_mac.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_stackdepot.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_stacktrace.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_stacktrace_printer.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_suppressions.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_symbolizer.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_symbolizer_libbacktrace.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_symbolizer_mac.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_symbolizer_win.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_tls_get_addr.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_thread_registry.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_win.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_linux_x86_64.S.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_termination.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_common_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_coverage_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_coverage_mapping_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_linux_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_posix_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_stacktrace_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_stoptheworld_linux_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_symbolizer_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_symbolizer_posix_libcdep.cc.o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.i386.dir/sanitizer_unwind_linux_libcdep.cc.o lib/lsan/CMakeFiles/RTLSanCommon.i386.dir/lsan_common.cc.o lib/lsan/CMakeFiles/RTLSanCommon.i386.dir/lsan_common_linux.cc.o lib/ubsan/CMakeFiles/RTUbsan.i386.dir/ubsan_diag.cc.o lib/ubsan/CMakeFiles/RTUbsan.i386.dir/ubsan_init.cc.o lib/ubsan/CMakeFiles/RTUbsan.i386.dir/ubsan_flags.cc.o lib/ubsan/CMakeFiles/RTUbsan.i386.dir/ubsan_handlers.cc.o lib/ubsan/CMakeFiles/RTUbsan.i386.dir/ubsan_value.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_allocator.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_activation.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_debugging.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_descriptions.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_errors.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_fake_stack.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_flags.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_globals.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_interceptors.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_linux.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_mac.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_malloc_linux.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_malloc_mac.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_malloc_win.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_memory_profile.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_poisoning.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_posix.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_report.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_rtl.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_stack.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_stats.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_suppressions.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_thread.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_win.cc.o lib/asan/CMakeFiles/RTAsan_dynamic.i386.dir/asan_new_delete.cc.o lib/asan/CMakeFiles/RTAsan_dynamic_version_script_dummy.i386.dir/dummy.cc.o lib/ubsan/CMakeFiles/RTUbsan_cxx.i386.dir/ubsan_handlers_cxx.cc.o lib/ubsan/CMakeFiles/RTUbsan_cxx.i386.dir/ubsan_type_hash.cc.o lib/ubsan/CMakeFiles/RTUbsan_cxx.i386.dir/ubsan_type_hash_itanium.cc.o lib/ubsan/CMakeFiles/RTUbsan_cxx.i386.dir/ubsan_type_hash_win.cc.o -lc -ldl -lrt -lm -lpthread -lstdc+ && :
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5.4.0/libstdc+.so when searching for -lstdc+
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5.4.0/libstdc+.a when searching for -lstdc+
      /usr/bin/ld: cannot find -lstdc++
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5.4.0/libstdc+.so when searching for -lstdc+
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5.4.0/libstdc+.a when searching for -lstdc+
      /usr/bin/ld: cannot find -lstdc++
      clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)

        Attachments

          Activity

            People

            Assignee:
            erg Doug Coleman
            Reporter:
            erg Doug Coleman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: