New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 708405 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 705071
Owner:
Closed: Apr 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

compiler-rt support in CrOS toolchain

Project Member Reported by bcf@chromium.org, Apr 5 2017

Issue description

Just wondering, is there any plan to support LLVM's compiler-rt?
https://compiler-rt.llvm.org/
 
Labels: OS-Chrome
We are evaluating compiler-rt (https://bugs.chromium.org/p/chromium/issues/detail?id=705071). 

If you want to try it out, add -rtlib=compiler-rt to clang command line.

Comment 2 by bcf@chromium.org, Apr 5 2017

Mergedinto: 705071
Status: Duplicate (was: Untriaged)

Comment 3 by bcf@chromium.org, Apr 5 2017

Cool, thanks for the info!

Comment 4 by bcf@chromium.org, Apr 5 2017

I just tried this on the 2017.04.03.221904 snapshot
https://pantheon.corp.google.com/storage/browser/chromiumos-sdk/2017/04/

But, I'm getting some errors:
/tmp/test-4dac1f.o:/usr/local/google/home/bcf/src/scratch/test.cc:function main: error: undefined reference to '_Unwind_Resume'
/tmp/test-4dac1f.o(.ARM.exidx.text._ZNKSt8functionIFviEEclEi+0x0): error: undefined reference to '__aeabi_unwind_cpp_pr0'

Am I missing something?

% cat ~/src/scratch/test.cc                                                                                                                                                  [22:33 1]
#include <iostream>

int main() {
  std::cout << "hello\n";
}

% ./prebuilt/toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-clang++ -std=c++11 -rtlib=compiler-rt ~/src/scratch/test.cc                                                      [22:33 0]
/tmp/test-71e940.o(.ARM.exidx.text.startup+0x0): error: undefined reference to '__aeabi_unwind_cpp_pr0'
/tmp/test-71e940.o(.ARM.exidx+0x0): error: undefined reference to '__aeabi_unwind_cpp_pr0'
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
compiler-rt needs libunwind or libgcc_s for c++ or if asan is used. Upstream bug: 
https://bugs.llvm.org//show_bug.cgi?id=28681

Right now, standalone sdk does not include libunwind. We will try to add it as part of  bug 705071  but may take a while.

For the time being, can you try one of the following: 
emerge-${BOARD} libunwind
clang++ --sysroot=/build/${BOARD} -rtlib=compiler-rt -lunwind ...

Or 

For standalone sdk, Adding -lgcc_s should work but I am not sure if doing so will make clang use everything from gcc_s instead of compiler-rt.
i.e. clang++ -rtlib=compiler-rt -lgcc_s 

Labels: compiler-rt-migration

Sign in to add a comment