<div dir="ltr">The binary will be useful.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 27, 2019 at 2:38 PM Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The command is just the Sanitizer-x86_64-Test-Nolibc binary with no args. You can see it failed here:<div><a href="https://ci.chromium.org/p/chromium/builders/try/linux_upload_clang/740" target="_blank">https://ci.chromium.org/p/chromium/builders/try/linux_upload_clang/740</a><br></div><div> The binary would crash on startup in the loader.<br></div><div><br></div><div>Eric says he was able to reproduce it as well. I can send you the binary offline if it's useful to inspect it.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 27, 2019 at 1:34 PM Fangrui Song <<a href="mailto:maskray@google.com" target="_blank">maskray@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Do you have a reproduce command line?<br>
<br>
I am at commit c3dbd782f1e0578c7ebc342f2e92f54d9644cff7 (your revert).<br>
With it rolled forward locally, check-sanitizer works here. (-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=on)<br>
<br>
Running projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-x86_64-Test-Nolibc directly is also fine.<br>
<br>
On 2019-12-27, Reid Kleckner wrote:<br>
>I ended up reverting this because it causes some check-sanitizer nolibc test to<br>
>fail, hopefully it reproduces for you locally, let me know if it doesn't. The<br>
>"nolibc" version crashes on startup.<br>
><br>
>On Thu, Dec 26, 2019 at 1:28 PM Fangrui Song via llvm-commits <<br>
><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
>    Author: Fangrui Song<br>
>    Date: 2019-12-26T13:26:43-08:00<br>
>    New Revision: 1417558e4a61794347c6bfbafaff7cd96985b2c3<br>
><br>
>    URL: <a href="https://github.com/llvm/llvm-project/commit/" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/</a><br>
>    1417558e4a61794347c6bfbafaff7cd96985b2c3<br>
>    DIFF: <a href="https://github.com/llvm/llvm-project/commit/" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/</a><br>
>    1417558e4a61794347c6bfbafaff7cd96985b2c3.diff<br>
><br>
>    LOG: [ELF] Improve the condition to create .interp<br>
><br>
>    Similar to rL362355, but with the `!config->shared` guard.<br>
><br>
>    (1) {gcc,clang} -fuse-ld=bfd -pie -fPIE -nostdlib a.c => .interp created<br>
>    (2) {gcc,clang} -fuse-ld=lld -pie -fPIE -nostdlib a.c => .interp not<br>
>    created<br>
>    (3) {gcc,clang} -fuse-ld=lld -pie -fPIE -nostdlib a.c a.so => .interp<br>
>    created<br>
><br>
>    The inconsistency of (2) is due to the condition `!Config-><br>
>    SharedFiles.empty()`.<br>
>    To make lld behave more like ld.bfd, we could change the condition to:<br>
><br>
>        config->hasDynSymTab && !config->dynamicLinker.empty() && script-><br>
>    needsInterpSection();<br>
><br>
>    However, that would bring another inconsistency as can be observed with:<br>
><br>
>    (4) {gcc,clang} -fuse-ld=bfd -no-pie -nostdlib a.c => .interp not created<br>
><br>
>    Added:<br>
><br>
>    Modified:<br>
>        lld/ELF/Writer.cpp<br>
>        lld/test/ELF/dynamic-linker.s<br>
>        lld/test/ELF/ppc64-func-entry-points.s<br>
><br>
>    Removed:<br>
><br>
>    ###########################################################################<br>
>    #####<br>
>    diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp<br>
>    index c0ad33473747..c20b74821d9c 100644<br>
>    --- a/lld/ELF/Writer.cpp<br>
>    +++ b/lld/ELF/Writer.cpp<br>
>    @@ -135,7 +135,7 @@ StringRef getOutputSectionName(const InputSectionBase<br>
>    *s) {<br>
>     }<br>
><br>
>     static bool needsInterpSection() {<br>
>    -  return !sharedFiles.empty() && !config->dynamicLinker.empty() &&<br>
>    +  return !config->shared && !config->dynamicLinker.empty() &&<br>
>              script->needsInterpSection();<br>
>     }<br>
><br>
>    diff  --git a/lld/test/ELF/dynamic-linker.s b/lld/test/ELF/dynamic-linker.s<br>
>    index d0da77fab295..b5e9f5f55e98 100644<br>
>    --- a/lld/test/ELF/dynamic-linker.s<br>
>    +++ b/lld/test/ELF/dynamic-linker.s<br>
>    @@ -1,6 +1,4 @@<br>
>     # REQUIRES: x86<br>
>    -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/shared.s -o<br>
>    %t1.o<br>
>    -# RUN: ld.lld -shared %t1.o -o %t.so<br>
>     # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o<br>
><br>
>     # RUN: ld.lld --dynamic-linker foo %t.o %t.so -o %t<br>
>    @@ -11,11 +9,11 @@<br>
><br>
>     # CHECK: [Requesting program interpreter: foo]<br>
><br>
>    -# RUN: ld.lld %t.o %t.so -o %t<br>
>    +# RUN: ld.lld %t.o -o %t<br>
>     # RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s<br>
><br>
>    -# RUN: ld.lld --dynamic-linker foo --no-dynamic-linker %t.o %t.so -o %t<br>
>    -# RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s<br>
>    +# RUN: ld.lld --dynamic-linker foo --no-dynamic-linker %t.o -o %t<br>
>    +# RUN: llvm-readelf --program-headers %t | FileCheck --check-prefix=NO %s<br>
><br>
>     # NO-NOT: PT_INTERP<br>
><br>
>    diff  --git a/lld/test/ELF/ppc64-func-entry-points.s b/lld/test/ELF/<br>
>    ppc64-func-entry-points.s<br>
>    index 1411cbe1c058..c322f6563426 100644<br>
>    --- a/lld/test/ELF/ppc64-func-entry-points.s<br>
>    +++ b/lld/test/ELF/ppc64-func-entry-points.s<br>
>    @@ -3,13 +3,13 @@<br>
>     // RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o<br>
>     // RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/<br>
>    ppc64-func-global-entry.s -o %t2.o<br>
>     // RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/<br>
>    ppc64-func-local-entry.s -o %t3.o<br>
>    -// RUN: ld.lld -dynamic-linker /lib64/ld64.so.2 %t.o %t2.o %t3.o -o %t<br>
>    +// RUN: ld.lld %t.o %t2.o %t3.o -o %t<br>
>     // RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s<br>
><br>
>     // RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o<br>
>     // RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/<br>
>    ppc64-func-global-entry.s -o %t2.o<br>
>     // RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/<br>
>    ppc64-func-local-entry.s -o %t3.o<br>
>    -// RUN: ld.lld -dynamic-linker /lib64/ld64.so.2 %t.o %t2.o %t3.o -o %t<br>
>    +// RUN: ld.lld %t.o %t2.o %t3.o -o %t<br>
>     // RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s<br>
><br>
>            .text<br>
><br>
>    _______________________________________________<br>
>    llvm-commits mailing list<br>
>    <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
>    <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
><br>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">宋方睿</div></div>