New issue
Advanced search Search tips

Issue 747113 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Sep 2017
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 724628



Sign in to add a comment

Update libcxx and libcxxabi to remove libgcc_s dependency

Project Member Reported by manojgupta@chromium.org, Jul 20 2017

Issue description

Currently libcxx and libcxxabi libraries have dependency on libgcc_s. this dependency should be removed (with a new USE flag?) and the libaries should be able to use compiler_rt.

$ ldd /usr/lib64/libc++abi.so.1.0 
	linux-vdso.so.1 (0x00007ffc261ae000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f29a6dc5000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f29a6a1d000)
	libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/libgcc_s.so.1 (0x00007f29a6805000)
	/lib64/ld-linux-x86-64.so.2 (0x00005584a217b000)


$ ldd /usr/lib64/libc++.so.1.0 
	linux-vdso.so.1 (0x00007ffef8eed000)
	libc++abi.so.1 => /usr/lib64/libc++abi.so.1 (0x00007f7e4f525000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7e4f309000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f7e4ef60000)
	libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/libgcc_s.so.1 (0x00007f7e4ed49000)

Also, libc++.so is really a linker script and adds libgcc_s dependency. It should also be fixed.

$ cat /usr/lib64/libc++.so
/* GNU ld script
   Include missing dependencies
*/
OUTPUT_FORMAT ( elf64-x86-64 )
GROUP ( libc++_shared.so libc++abi.so libgcc_s.so )

 

Comment 1 by vapier@chromium.org, Jul 20 2017

i'm not sure what the end goal is, but you won't be able to purge libgcc_s.so from the image ... at least glibc uses that directly for unwinding
Owner: manojgupta@chromium.org
To use compiler-rt, libgcc_eh must be linked as well. llvm's libunwind is not being right now because of some crashes that were seen ( https://crbug.com/723417 )
Status: Started (was: Untriaged)
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/0a3df1b1d37e76a9e906ac5cbe8dca1b1f05573d

commit 0a3df1b1d37e76a9e906ac5cbe8dca1b1f05573d
Author: Manoj Gupta <manojgupta@google.com>
Date: Fri Sep 01 21:41:50 2017

libc++: Link with compiler-rt instead of libgcc_s.

Remove libgcc_s dependency from libc++ and use compiler-rt instead
by default. Also, patch libc++ to use libgcc_eh instead of llvm's
libunwind since crashes were reported when libunwind
was used  ( https://crbug.com/723417 ).

The new behavior is guarded by compiler-rt USE flag. Building libc++ without
this use flag will restore the previous libgcc_s dependency.

Does not impact any host/target package since libc++ is not yet used in ChromeOS.

BUG= chromium:747113 
TEST=libc++abi.so and libc++.so do not show libgcc_s.
TEST=ldd /opt/google/chrome/chrome does not show libgcc_s.
TEST=kevin-llvm-toolchain passed with libc++.
TEST=arm-llvm-next-toolchain passed with libc++.
TEST=lumpy-llvm-toolchain passed with libc++ (excluding a known
unit test fail).

Lumpy: https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/llvm_toolchain/builds/249
arm-llvm-next-toolchain: https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/llvm_next_toolchain/builds/645
kevin-llvm-toolchain: https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/llvm_toolchain/builds/247

Change-Id: I48c6ae8882dcc7ed92f1585fda32841c70ef2771
Reviewed-on: https://chromium-review.googlesource.com/641316
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>

[rename] https://crrev.com/0a3df1b1d37e76a9e906ac5cbe8dca1b1f05573d/sys-libs/libcxx/libcxx-4.0.0-r9.ebuild
[add] https://crrev.com/0a3df1b1d37e76a9e906ac5cbe8dca1b1f05573d/sys-libs/libcxx/files/libcxx-use-libgcc_eh.patch
[modify] https://crrev.com/0a3df1b1d37e76a9e906ac5cbe8dca1b1f05573d/sys-libs/libcxxabi/libcxxabi-9999.ebuild
[add] https://crrev.com/0a3df1b1d37e76a9e906ac5cbe8dca1b1f05573d/sys-libs/libcxxabi/files/libcxxabi-use-libgcc_eh.patch

Status: Verified (was: Started)

Sign in to add a comment