On Mon, Aug 23, 2021 at 5:37 PM Omer Katz (chromium.org) < [email protected]> wrote:
> There is no built-in way that I know of (probably because, to the best of > my knowledge, it was not meant to be used like you use it). > I think the problem area is at > https://chromium.googlesource.com/chromium/src/third_party/+/refs/heads/main/blink/renderer/platform/heap/v8_wrapper/thread_local.h > . > I'd start with trying to hardcode a different tls model to at least > confirm that that is the issue. > Thanks, changing the BLINK_HEAP_THREAD_LOCAL_MODEL value to "initial-exec" fixed the Linux build error. I do wonder why "local-exec" works on macOS. Perhaps loading "Google Chrome Framework" via dlopen() instead of dynamic linking makes the difference. > > On Mon, Aug 23, 2021 at 11:32 PM Marshall Greenblatt < > [email protected]> wrote: > >> Hi Omer, >> >> Thanks for the response. I'm building a single shared library >> ("libcef.so") that includes Chromium and Blink code on Linux. This library >> will be loaded by a separate exe at runtime, similar in concept to >> "chrome.dll" on Windows and "Google Chrome Framework" on macOS. Since I'm >> not making a component build in the Chromium sense (not setting >> `is_component_build=true`) is there a way to override the tls_model used by >> Blink's GCed heap? >> >> Thanks, >> Marshall >> >> On Mon, Aug 23, 2021 at 5:23 PM Omer Katz (chromium.org) < >> [email protected]> wrote: >> >>> Are you building with chromium's build system (i.e. gn) or your own? >>> I suspect this error is related to the tls_model used by Blink's GCed >>> heap, which is different based on whether it is built as a shared library >>> (i.e. "component build" in chromium) or a single statically linked binary. >>> It seems to me you're building a shared library but with the tls model >>> for a single statically linked binary. >>> The command you posted seems to be different then the one gn generates, >>> so I'm assuming you forgot to set the COMPONENT_BUILD build flag for >>> chromium. >>> >>> On Mon, Aug 23, 2021 at 9:07 PM Marshall Greenblatt < >>> [email protected]> wrote: >>> >>>> Hi All, >>>> >>>> I'm attempting an ASAN build of a Chromium-based project on Linux >>>> (Ubuntu 18.04 64-bit) at the M94 branch point (master #911515) and I'm >>>> getting the below errors [1]. These errors do not reproduce with an ASAN >>>> build at the M93 branch point (master #902210). Any suggestions on how to >>>> fix them would be welcome. >>>> >>>> Thanks, >>>> Marshall >>>> >>>> [1] [51527/51531] SOLINK ./libcef.so >>>> FAILED: libcef.so libcef.so.TOC >>>> python3 "../../build/toolchain/gcc_solink_wrapper.py" >>>> --readelf="readelf" >>>> --nm="../../third_party/llvm-build/Release+Asserts/bin/llvm-nm" >>>> --sofile="./libcef.so" --tocfile="./libcef.so.TOC" --output="./libcef.so" >>>> -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared >>>> -Wl,-soname="libcef.so" >>>> -Wl,--version-script=/home/marshall/code/chromium_git/chromium/src/cef/libcef_dll/libcef.lst >>>> -fuse-ld=lld -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro >>>> -Wl,-z,now -Wl,--color-diagnostics -Wl,--no-call-graph-profile-sort -m64 >>>> -Werror -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ -fsanitize=address >>>> -Wl,-u_sanitizer_options_link_helper -fsanitize=address -o "./libcef.so" >>>> @"./libcef.so.rsp" >>>> ld.lld: error: relocation R_X86_64_TPOFF32 against >>>> blink::g_thread_specific_ cannot be used with -shared >>>> >>> defined in >>>> obj/third_party/blink/renderer/platform/heap/heap/thread_state.o >>>> >>> referenced by thread_state.cc:92 >>>> (../../third_party/blink/renderer/platform/heap/v8_wrapper/thread_state.cc:92) >>>> >>> >>>> obj/third_party/blink/renderer/platform/heap/heap/thread_state.o:(blink::ThreadState::Current()) >>>> >>>> ld.lld: error: relocation R_X86_64_TPOFF32 against >>>> blink::g_thread_specific_ cannot be used with -shared >>>> >>> defined in >>>> obj/third_party/blink/renderer/platform/heap/heap/thread_state.o >>>> >>> referenced by thread_state.cc:155 >>>> (../../third_party/blink/renderer/platform/heap/v8_wrapper/thread_state.cc:155) >>>> >>> >>>> obj/third_party/blink/renderer/platform/heap/heap/thread_state.o:(blink::ThreadState::ThreadState(v8::Platform*)) >>>> clang: error: linker command failed with exit code 1 (use -v to see >>>> invocation) >>>> ninja: build stopped: cannot make progress due to previous errors. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "blink-dev" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFW9UJ8DQSnCAkpsD%3DSRHdwm43YZEV7E3k%2Bz%2Bwi4B5TybPFCqw%40mail.gmail.com >>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFW9UJ8DQSnCAkpsD%3DSRHdwm43YZEV7E3k%2Bz%2Bwi4B5TybPFCqw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "blink-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFW9UJ94fWNbh47SCXJvsDn2z_RB%3DU4vZ40sg%2BB88tGxPB2LxQ%40mail.gmail.com >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFW9UJ94fWNbh47SCXJvsDn2z_RB%3DU4vZ40sg%2BB88tGxPB2LxQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFW9UJ8f0pz9RTitrUg%2BhDg3r6r3aOLGP1%2BorFuosJVPp4dAew%40mail.gmail.com.
