<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Regression Sep 16 2020] Build fails, if NT_X86_XSTATE is not defined, in sanitizer_common/tests/sanitizer_stoptheworld_linux_libcdep.cpp"
   href="https://bugs.llvm.org/show_bug.cgi?id=47896">47896</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Regression Sep 16 2020]  Build fails, if NT_X86_XSTATE is not defined, in sanitizer_common/tests/sanitizer_stoptheworld_linux_libcdep.cpp
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>build-problem, portability
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>burnus@net-b.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, vitalybuka@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Regression caused by <a href="https://reviews.llvm.org/D87754">https://reviews.llvm.org/D87754</a>
  [Lsan] Use fp registers to search for pointers
<a href="https://github.com/llvm/llvm-project/commit/5813fca1076089c835de737834955a0fe7eb3898">https://github.com/llvm/llvm-project/commit/5813fca1076089c835de737834955a0fe7eb3898</a>

Using an older GLIBC 2.11.1 as cross-build symroot causes the fail:
  sanitizer_common/tests/sanitizer_stoptheworld_linux_libcdep.cpp:490:39:
    error: 'NT_X86_XSTATE' was not declared in this scope

as elf.h does not yet include NT_X86_XSTATE

Possible patch:

--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
@@ -490 +490,5 @@ typedef user_regs_struct regs_struct;
-static constexpr uptr kExtraRegs[] = {NT_X86_XSTATE, NT_FPREGSET};
+static constexpr uptr kExtraRegs[] = {
+#ifdef NT_X86_XSTATE
+                                      NT_X86_XSTATE,
+#endif
+                                      NT_FPREGSET};</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>