<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Module-level inline assembly ThinLTO failures"
   href="https://llvm.org/bugs/show_bug.cgi?id=30610">30610</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Module-level inline assembly ThinLTO failures
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tejohnson@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jbc.engelen@gmail.com, llvm-bugs@lists.llvm.org, mehdi.amini@apple.com, peter@pcc.me.uk, tejohnson@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As reported by Johan here:
   <a href="http://lists.llvm.org/pipermail/llvm-dev/2016-October/105526.html">http://lists.llvm.org/pipermail/llvm-dev/2016-October/105526.html</a>

when we import from a module containing module-level inline assembly, the
IRLinker will concatenate any module level inline assembly from the module we
are importing from (IRLinker::run). This is correct for full LTO, but not for
ThinLTO.

I have a patch to disable this when IR linking due to ThinLTO importing.

However, if the module-level inline assembly contains a def of a referenced
local symbol, this actually causes things to stop working because we don't pull
in the definition.

I also see issues with module-level inline assembly defining local symbols and
full LTO compilation: if two modules define the local symbols with the same
name, no renaming is performed and there are duplicate symbols.

This is similar to issues I found with LTO and inline assembly:
   <a href="http://lists.llvm.org/pipermail/llvm-dev/2016-April/098047.html">http://lists.llvm.org/pipermail/llvm-dev/2016-April/098047.html</a>
which will fail with full LTO but I am working around with ThinLTO by
preventing generation of a module summary index.

Couple possibilities:
1) Use my patch to prevent concatenation of these strings when importing, which
solves the global symbol def issue originally reported
2) Use the same workaround for ThinLTO when module level inline assembly
defines referenced local symbols (prevent generation of module summary to avoid
importing)</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>