<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 4, 2017 at 9:59 AM, Tom Stellard <span dir="ltr"><<a href="mailto:tstellar@redhat.com" target="_blank">tstellar@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 12/01/2017 10:47 AM, Andrew Kelley wrote:<br>
> Zig tests using Debug build of 5.0.1rc2 hit this bug: <a href="https://bugs.llvm.org/show_bug.cgi?id=34452" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=34452</a> <<a href="https://bugs.llvm.org/show_bug.cgi?id=34452" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=34452</a>><br>
<span class="gmail-">> I suppose the fix has not been backported to 5.0.1.<br>
><br>
<br>
<br>
</span>At this point in the release process, we usually only accept critical fixes<br>
or fixes for regressions.<br></blockquote><div><br></div><div>That's fair; I'm content to wait for llvm 6 for this patch. Currently, zig officially depends on a non-assertions-enabled build of LLVM 5 due to this bug, but we will support LLVM assertions when 6 is released.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I'm not familiar with Zig tests, can you give me a little more information<br>
about these tests and how these failures will impact users.<br></blockquote><div><br></div><div>Zig is a frontend to LLVM just like clang. The tests do a reasonably thorough job of testing the LLVM API, libclang API, and LLD test cases that the zig compiler depends on. There are no new regressions since 5.0.0, so users will continue to use zig like normal after 5.0.1 is released.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Also are these 4 lld patches backports from trunk?  If so, which revsions are they?<br></blockquote><div><br></div><div>2 of them are from trunk. <br></div><div><br></div><div>rL311734: <span class="gmail-"> Fix the ASM code generated for __stub_helpers section<br></span></div><div>rL316370: COFF: better behavior when using as a library</div><div><br></div><div>2 of them are not:<br></div><div><span class="gmail-"> * workaround for buggy MACH-O code: This is not a high enough quality patch to go into trunk; when someone on the zig team has time we will do a better fix for the root cause and send the patch upstream. No one on the LLD team has had motivation to fix this bug, which is <a href="https://bugs.llvm.org/show_bug.cgi?id=32254">https://bugs.llvm.org/show_bug.cgi?id=32254</a><br></span></div><div> * <span class="gmail-"><span class="gmail-">Fix for LLD on linker scripts with empty sections: The bug this fixes is not present in trunk, and this patch will be removed when llvm 6 is released.<br></span></span></div><div><br></div><div>I'll send the c header patches upstream separately.<br></div><div><span class="gmail-"></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks,<br>
Tom<br>
<span class="gmail-"><br>
> So I created a Release build of 5.0.1rc2 and all zig tests pass, with the following patches:<br>
><br>
> * Patches to LLD:<br>
><br>
> commit a206ef34bbbc46017e471063a4a183<wbr>2c1ddafb0a<br>
</span>> Author: Andrew Kelley <<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a> <mailto:<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a>>><br>
<span class="gmail-">> Date:   Fri Dec 1 12:11:55 2017 -0500<br>
><br>
>     LLD patch: Fix the ASM code generated for __stub_helpers section<br>
><br>
>     This applies 93ca847862af07632197dcf2d8a68b<wbr>9b27a26d7a<br>
>     from the llvm-project git monorepo to the embedded LLD.<br>
><br>
> commit ddca67a2b94f68985789fc8254fd13<wbr>26e26269f6<br>
</span>> Author: Andrew Kelley <<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a> <mailto:<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a>>><br>
<span class="gmail-">> Date:   Fri Dec 1 12:09:55 2017 -0500<br>
><br>
>     LLD patch: workaround for buggy MACH-O code<br>
><br>
>     This reapplies 1a1414fc42c7beb25b6de4134d9988<wbr>4ea6544b57<br>
>     to the embedded LLD.<br>
> diff --git a/deps/lld/lib/ReaderWriter/<wbr>MachO/ArchHandler_x86_64.cpp b/deps/lld/lib/ReaderWriter/<wbr>MachO/ArchHandler_x86_64.cpp<br>
> index d687ca5d..07958da4 100644<br>
> --- a/deps/lld/lib/ReaderWriter/<wbr>MachO/ArchHandler_x86_64.cpp<br>
> +++ b/deps/lld/lib/ReaderWriter/<wbr>MachO/ArchHandler_x86_64.cpp<br>
> @@ -617,7 +617,6 @@ void ArchHandler_x86_64::<wbr>applyFixupFinal(<br>
>      // Fall into llvm_unreachable().<br>
>      break;<br>
>    }<br>
> -  llvm_unreachable("invalid x86_64 Reference Kind");<br>
>  }<br>
><br>
>  void ArchHandler_x86_64::<wbr>applyFixupRelocatable(const Reference &ref,<br>
><br>
><br>
> commit fa45407e78c7a20281bf063f659d74<wbr>f86c127ea1<br>
</span>> Author: Andrew Kelley <<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a> <mailto:<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a>>><br>
<span class="gmail-">> Date:   Fri Dec 1 12:08:16 2017 -0500<br>
><br>
>     LLD patch: Fix for LLD on linker scripts with empty sections<br>
><br>
>     This reapplies 569cf286ff79a10126b9f20f39fa8c<wbr>64df9b8b25<br>
>     to the embedded LLD.<br>
> diff --git a/deps/lld/ELF/LinkerScript.<wbr>cpp b/deps/lld/ELF/LinkerScript.<wbr>cpp<br>
> index 8bdbd8db..614f5e2c 100644<br>
> --- a/deps/lld/ELF/LinkerScript.<wbr>cpp<br>
> +++ b/deps/lld/ELF/LinkerScript.<wbr>cpp<br>
> @@ -751,7 +751,7 @@ void LinkerScript::<wbr>adjustSectionsAfterSorting() {<br>
>      if (auto *Cmd = dyn_cast<OutputSectionCommand><wbr>(Base)) {<br>
>        Cmd->MemRegion = findMemoryRegion(Cmd);<br>
>        // Handle align (e.g. ".foo : ALIGN(16) { ... }").<br>
> -      if (Cmd->AlignExpr)<br>
> +      if (Cmd->AlignExpr && Cmd->Sec)<br>
>          Cmd->Sec->updateAlignment(Cmd-<wbr>>AlignExpr().getValue());<br>
>      }<br>
>    }<br>
><br>
><br>
> commit 9ea23272fac7f4580d29f7ee557108<wbr>883f127a5d<br>
</span>> Author: Andrew Kelley <<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a> <mailto:<a href="mailto:superjoe30@gmail.com">superjoe30@gmail.com</a>>><br>
<div><div class="gmail-h5">> Date:   Fri Dec 1 12:06:33 2017 -0500<br>
><br>
>     LLD patch: COFF: better behavior when using as a library<br>
><br>
>     This applies de776439b61fb71c1256ad86238799<wbr>c758c66048<br>
>     from the LLVM git monorepo to the embedded LLD.<br>
><br>
><br>
><br>
> * Patches to clang headers:<br>
><br>
> diff --git a/c_headers/stdarg.h b/c_headers/stdarg.h<br>
> index d603d353..101426ff 100644<br>
> --- a/c_headers/stdarg.h<br>
> +++ b/c_headers/stdarg.h<br>
> @@ -26,14 +26,10 @@<br>
>  #ifndef __STDARG_H<br>
>  #define __STDARG_H<br>
><br>
> -/* zig: added because macos _va_list.h was duplicately defining va_list<br>
> - */<br>
>  #ifndef _VA_LIST<br>
> -#ifndef _VA_LIST_T<br>
>  typedef __builtin_va_list va_list;<br>
>  #define _VA_LIST<br>
>  #endif<br>
> -#endif<br>
>  #define va_start(ap, param) __builtin_va_start(ap, param)<br>
>  #define va_end(ap)          __builtin_va_end(ap)<br>
>  #define va_arg(ap, type)    __builtin_va_arg(ap, type)<br>
> @@ -50,9 +46,6 @@ typedef __builtin_va_list va_list;<br>
>  #ifndef __GNUC_VA_LIST<br>
>  #define __GNUC_VA_LIST 1<br>
>  typedef __builtin_va_list __gnuc_va_list;<br>
> -/* zig: added because glibc stdio.h was duplicately defining va_list<br>
> - */<br>
> -#define _VA_LIST_DEFINED<br>
>  #endif<br>
><br>
>  #endif /* __STDARG_H */<br>
> diff --git a/c_headers/stddef.h b/c_headers/stddef.h<br>
> index 3b55d42c..73549967 100644<br>
> --- a/c_headers/stddef.h<br>
> +++ b/c_headers/stddef.h<br>
> @@ -48,13 +48,7 @@<br>
>  #if !__has_feature(modules)<br>
>  #define _PTRDIFF_T<br>
>  #endif<br>
> -<br>
> -/* Zig: wrap in _PTRDIFF_T_DEFINED to protect against mingw defining it twice */<br>
> -#if !defined(_PTRDIFF_T_DEFINED)<br>
>  typedef __PTRDIFF_TYPE__ ptrdiff_t;<br>
> -#define _PTRDIFF_T_DEFINED<br>
> -#endif<br>
> -<br>
>  #endif<br>
>  #undef __need_ptrdiff_t<br>
>  #endif /* defined(__need_ptrdiff_t) */<br>
> @@ -65,24 +59,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;<br>
>  #if !__has_feature(modules)<br>
>  #define _SIZE_T<br>
>  #endif<br>
> -<br>
> -/* Zig: added to avoid collisions with mingw */<br>
> -#if !defined(_SIZE_T_DEFINED_)<br>
> -#if !defined(_SIZE_T_DEFINED)<br>
> -#if !defined(_BSD_SIZE_T_DEFINED_)<br>
> -#if !defined(_SIZE_T_DECLARED)<br>
>  typedef __SIZE_TYPE__ size_t;<br>
> -#define _SIZE_T_DEFINED_<br>
> -#define _SIZE_T_DEFINED<br>
> -#define _BSD_SIZE_T_DEFINED_<br>
> -#define _SIZE_T_DECLARED<br>
> -#endif<br>
> -#endif<br>
> -#endif<br>
> -#endif<br>
> -<br>
> -<br>
> -<br>
>  #endif<br>
>  #undef __need_size_t<br>
>  #endif /*defined(__need_size_t) */<br>
> @@ -110,22 +87,7 @@ typedef __SIZE_TYPE__ rsize_t;<br>
>  #define _WCHAR_T_DEFINED<br>
>  #endif<br>
>  #endif<br>
> -<br>
> -/* zig added to prevent duplicate definition with mingw */<br>
> -#if !defined(__INT_WCHAR_T_H)<br>
> -#if !defined(_GCC_WCHAR_T)<br>
> -#if !defined(_WCHAR_T_DECLARED)<br>
> -#if !defined(_WCHAR_T_DEFINED)<br>
> -#define __INT_WCHAR_T_H<br>
> -#define _GCC_WCHAR_T<br>
> -#define _WCHAR_T_DECLARED<br>
> -#define _WCHAR_T_DEFINED<br>
>  typedef __WCHAR_TYPE__ wchar_t;<br>
> -#endif<br>
> -#endif<br>
> -#endif<br>
> -#endif<br>
> -<br>
>  #endif<br>
>  #endif<br>
>  #undef __need_wchar_t<br>
><br>
><br>
><br>
><br>
><br>
</div></div><span class="gmail-">> On Fri, Dec 1, 2017 at 10:30 AM, Sylvestre Ledru via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.<wbr>org</a>>> wrote:<br>
><br>
>     On 30/11/2017 01:19, Tom Stellard via Release-testers wrote:<br>
>     > Hi,<br>
>     ><br>
>     > I've tagged the 5.0.1-rc2 release, go ahead and start testing and report<br>
>     > your results.<br>
>     Besides an intermittent issue with mips64el (not a recent regression), looks great!<br>
>     Thanks<br>
>     S<br>
><br>
>     ______________________________<wbr>_________________<br>
>     LLVM Developers mailing list<br>
</span>>     <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.<wbr>org</a>><br>
>     <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a> <<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-<wbr>bin/mailman/listinfo/llvm-dev</a>><br>
><br>
><br>
<br>
</blockquote></div><br></div></div>