[llvm-bugs] [Bug 38025] New: Wrong ABI used when building compiler-rt

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 2 16:55:14 PDT 2018


            Bug ID: 38025
           Summary: Wrong ABI used when building compiler-rt
           Product: compiler-rt
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: llozano at chromium.org
                CC: llvm-bugs at lists.llvm.org

Created attachment 20510
  --> https://bugs.llvm.org/attachment.cgi?id=20510&action=edit
log of compiler-rt build failure

While trying to build ToT compiler-rt, I get the following errors:

/usr/x86_64-pc-linux-gnu/binutils-bin/2.27.0/ld.bfd.real: i386:x86-64
architecture of input file
3.c.o)' is incompatible with i386 output
/usr/x86_64-pc-linux-gnu/binutils-bin/2.27.0/ld.bfd.real: i386:x86-64
architecture of input file
ddi4.c.o)' is incompatible with i386 output
In function `__sanitizer::Unwind_GetIP(_
undefined reference to `_Unwind_GetIP'
In function `Unwind_GetIP':
undefined reference to `_Unwind_GetIP

It seems the build process is trying to use 64-bit ABI object files to build a
32-bit compiler-rt. 

To reproduce you need to use a clang to build compiler-rt and that clang must
use compiler-rt by default and support generating 32-ABI objects.

you can try to build your own clang build compiler or use the following from
the Chrome OS sdk.

$ gsutil cp
gs://chromiumos-sdk/2018/07/x86_64-cros-linux-gnu-2018.07.01.081213.tar.xz .
$ tar -Jxf x86_64-cros-linux-gnu-2018.07.01.081213.tar.xz


cmake -G Ninja -DCMAKE_C_COMPILER=/path/to/sdk/usr/bin/clang

and then:

ninja ubsan

I did a bisect on compiler-rt and found that the problem is with this commit:

Author: Petr Hosek <phosek at chromium.org>
Date:   Tue May 22 22:58:48 2018 +0000

    [CMake] Support builtins as Clang default rtlib in compiler-rt

    Use compiler-rt builtins when selected as default Clang rtlib and avoid
    explicitly passing -rtlib= flag to avoid the "argument unused during
    compilation" warning.

    This is a partial alternative to D47094 that does not rely on compiler
    runtime checks.

    Differential Revision: https://reviews.llvm.org/D47115

    git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333037

Therefore, I will assign to Petr. 

Attached a detailed log of the failure.

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/20180702/672b2f0f/attachment-0001.html>

More information about the llvm-bugs mailing list