<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 - KCOV broke when LTO enabled: inlinable function call in a function with debug info must have a !dbg location"
   href="https://bugs.llvm.org/show_bug.cgi?id=39531">39531</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>KCOV broke when LTO enabled: inlinable function call in a function with debug info must have a !dbg location
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dcoughlin@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>joeyjiaojg@163.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dcoughlin@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21069" name="attach_21069" title="IR for kcov.c which contains __sanitizer_cov_trace_pc">attachment 21069</a> <a href="attachment.cgi?id=21069&action=edit" title="IR for kcov.c which contains __sanitizer_cov_trace_pc">[details]</a></span>
IR for kcov.c which contains __sanitizer_cov_trace_pc

When I'm building linux kernel with clang and LTO enabled for CONFIG_KOV=y, I'm
facing below error: (I added --verbose to ld in order to show where it stopped)

The make failed at ld stage inside kernel/script/link-vmlinux.sh:  ${LD}
--verbose ${LDFLAGS} -r -o ${1} $(modversions) ${objects}


==Build Log==
aarch64-linux-android-ld.gold: Closed descriptor 11 for
"net/ipc_router/ipc_router_socket.o"
aarch64-linux-android-ld.gold: Opened new descriptor 12 for
"net/ipc_router/ipc_router_security.o"
aarch64-linux-android-ld.gold: Attempt to open
net/ipc_router/ipc_router_security.o succeeded
aarch64-linux-android-ld.gold: Unlocking file
"net/ipc_router/ipc_router_security.o"
aarch64-linux-android-ld.gold: Released descriptor 12 for
"net/ipc_router/ipc_router_security.o"
inlinable function call in a function with debug info must have a !dbg location
  call void @__sanitizer_cov_trace_pc()
inlinable function call in a function with debug info must have a !dbg location
  call void @__sanitizer_cov_trace_pc()
inlinable function call in a function with debug info must have a !dbg location
  call void @__sanitizer_cov_trace_pc()
inlinable function call in a function with debug info must have a !dbg location
  call void @__sanitizer_cov_trace_pc()
inlinable function call in a function with debug info must have a !dbg location
  call void @__sanitizer_cov_trace_pc()
inlinable function call in a function with debug info must have a !dbg location
  call void @__sanitizer_cov_trace_pc()
LLVM ERROR: Broken module found, compilation aborted!
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory
`/local/mnt/workspace/jiangenj/la/asan/out/target/product/msm8953_64/obj/kernel/msm-4.9'
make: *** [sub-make] Error 2
make: Leaving directory `/local/mnt/workspace/jiangenj/la/asan/kernel/msm-4.9'
ninja: build stopped: subcommand failed.
16:18:10 ninja failed with: exit status 1


Can you help me understand what the issue is actually and how to fix?</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>