<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 - Darwin -fsanitize=cfi -flto=thin causes raw bitcode to be emitted, instead of Mach-O-wrapped bitcode"
   href="https://bugs.llvm.org/show_bug.cgi?id=32741">32741</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Darwin -fsanitize=cfi -flto=thin causes raw bitcode to be emitted, instead of Mach-O-wrapped bitcode
          </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>All
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ahmed.bougacha@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>r301016 enabled CFI tests using ThinLTO on Darwin, but those are failing:

ld: warning: ignoring file
/var/folders/09/r4vw4v8n5kb67jl66zvlbljw0000gn/T/lit_tmp_j2NEGY/nvcall-1477f4.o,
file was built for unsupported file format ( 0x42 0x43 0xC0 0xDE 0x35 0x14 0x00
0x00 0x05 0x00 0x00 0x00 0x62 0x0C 0x30 0x24 ) which is not the architecture
being linked (x86_64):
/var/folders/09/r4vw4v8n5kb67jl66zvlbljw0000gn/T/lit_tmp_j2NEGY/nvcall-1477f4.o
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64

<a href="http://green.lab.llvm.org/green/job/clang-stage1-configure-RA_check/30480/consoleFull#-121919748349ba4694-19c4-4d7e-bec5-911270d8a58c">http://green.lab.llvm.org/green/job/clang-stage1-configure-RA_check/30480/consoleFull#-121919748349ba4694-19c4-4d7e-bec5-911270d8a58c</a>


It seems that -fsanitize=cfi somehow causes -flto=thin to emit bitcode instead
of mach-o:

 $ ./bin/clang -flto=thin -fvisibility=hidden -fsanitize=cfi /tmp/t.cpp -c &&
file t.o
t.o: LLVM IR bitcode
 $ ./bin/clang -flto=thin -fvisibility=hidden /tmp/t.cpp -c && file t.o
t.o: LLVM bitcode, wrapper x86_64

And it seems that ld64 doesn't accept raw bitcode.</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>