[llvm-bugs] [Bug 32741] New: Darwin -fsanitize=cfi -flto=thin causes raw bitcode to be emitted, instead of Mach-O-wrapped bitcode

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 21 17:16:49 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=32741

            Bug ID: 32741
           Summary: Darwin -fsanitize=cfi -flto=thin causes raw bitcode to
                    be emitted, instead of Mach-O-wrapped bitcode
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ahmed.bougacha at gmail.com
                CC: llvm-bugs at lists.llvm.org

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

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


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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170422/c4c9ecfb/attachment.html>


More information about the llvm-bugs mailing list