Issue metadata
Sign in to add a comment
|
nacl does not work when linking with lld |
||||||||||||||||||||||
Issue descriptionWith chrome binary builds with lld, go to https://gonativeclient.appspot.com/demo and play a demo It complains that it failed to load. In the log, it says ui.20180913-142321:libgcc_s.so.1 must be installed for pthread_cancel to work
,
Sep 14
As per https://reviews.llvm.org/D45536, Rui's change was reverted because it broke Chromium. Can you check if he made another fix?
,
Sep 14
Please also attach output of -Wl,-t and check where are the builtins coming from. This is important because we want builtins to come from libgcc, not any other library that might be carrying the compiler-rt implementation (We had an issue with clear_cache compiler-rt builtin on ARM).
,
Sep 14
https://reviews.llvm.org/rL330788 relanded that patch and we have that already.
,
Sep 14
By the way, the error is rather misleading because NaCl does not use pthread_cancel(). The error arises because glibc's libpthread has some dependency on stack unwinding functions from libgcc_s.so such as _Unwind_Resume(). Note that NaCl does not use stack unwinding either. Some C++ libraries depend on stack unwinding for C++ exception handling, which we also don't use.
,
Sep 21
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/17a40397711ee604334d86f9533f1ea1cc327c3f commit 17a40397711ee604334d86f9533f1ea1cc327c3f Author: Yunlian Jiang <yunlian@google.com> Date: Fri Sep 21 16:09:26 2018 nacl_helper: force to link with lgcc_s on ChromeOS. When linking with lld, the lgcc_s is removed from linkage and this makes Nacl failed to load. This cl adds -lgcc_s before --as-needed so that libgcc_s is kept. BUG= chromium:884017 TEST=nacl_helper works when linking with lld. Change-Id: I3a8503787c4b05b7f777c82bc279ae1005d604d1 Reviewed-on: https://chromium-review.googlesource.com/1226452 Commit-Queue: Yunlian Jiang <yunlian@chromium.org> Reviewed-by: Mark Seaborn <mseaborn@chromium.org> Cr-Commit-Position: refs/heads/master@{#593207} [modify] https://crrev.com/17a40397711ee604334d86f9533f1ea1cc327c3f/components/nacl/loader/BUILD.gn
,
Sep 21
I suspect what is happening here is the following: * Something triggers a stack unwind, either in Chromium or a system library, maybe by throwing a C++ exception. * There is a function on the call stack that uses __attribute__((cleanup)), which in turn uses __gcc_personality_v0() as its personality function (for doing cleanup when an exception is thrown). This is probably a function in glibc (libc or libpthread). * This calls the copy of __gcc_personality_v0() defined in glibc. (See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/gnu/unwind-resume.c;h=9283d925decb31f6cccbdde5fa117bcb5b983910;hb=f0458cf4f9ff3d870c43b624e6dccaaf657d5e83) * This tries to redirect to the real implementation of __gcc_personality_v0() in libgcc_s.so. It tries to dlopen() that library. The library wasn't loaded at startup, so the dynamic linker tries to open() it from the filesystem. But Chrome's sandbox is enabled at this point, and so opening the library fails, producing the error message in the issue report. In newer versions of glibc, the error message has been changed to "libgcc_s.so.1 must be installed for unwinding to work" (see https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=08c6e95234c60a5c2f37532d1111acf084f39345;hp=d8b778907e5270fdeb70459842ffbc20bd2ca5e1).
,
Oct 10
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by yunlian@chromium.org
, Sep 14