<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 - ARM: extraneous unwinder reference with -fprofile-arcs"
   href="https://bugs.llvm.org/show_bug.cgi?id=43234">43234</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ARM: extraneous unwinder reference with -fprofile-arcs
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </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>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>arnd@linaro.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I got a link error on a 32-bit ARM kernel build with CONFIG_GCOV_KERNEL and
CONFIG_UNWIND_FRAME_POINTER set:

kernel/trace/trace_clock.o:(.ARM.exidx+0x0): undefined reference to
`__aeabi_unwind_cpp_pr0'
kernel/trace/trace_clock.o:(.ARM.exidx+0x8): undefined reference to
`__aeabi_unwind_cpp_pr0'
kernel/trace/trace_clock.o:(.ARM.exidx+0x10): undefined reference to
`__aeabi_unwind_cpp_pr0'

I created a reduced test case at <a href="https://godbolt.org/z/gBQtAP">https://godbolt.org/z/gBQtAP</a>

Basically, clang inserts
__llvm_gcov_writeout/__llvm_gcov_flush/__llvm_gcov_init functions into any file
it compiles, even for an empty C file input. These functions contain
.fnstart/.fnend statements even when building with "-fno-omit-frame-pointer
-fno-unwind-tables", which then results in unresolved references to
__aeabi_unwind_cpp_pr0.</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>