[llvm-dev] Adding bitcode to an existing MachO object file

Alexander Shaposhnikov via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 17 14:18:55 PDT 2020


Hi Joseph,
yeah, if you run into any issues with the latest version (built from
master) - please, file a bug on bugs.llvm.org.
Kind regards,
Alexander

On Sat, Aug 15, 2020 at 1:15 PM Joseph via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

> Many thanks for your comment! I was using the one from Brew (llvm 10, I
> believe). I'll build master and run it from there and report back tomorrow
>
> On Sat, 15 Aug 2020, 20:45 Shoaib Meenai, <smeenai at fb.com> wrote:
>
>> What version of llvm-objcopy are you using? I know it’s had many fixes
>> for Mach-O recently. If you’re running into a bug with the latest
>> llvm-objcopy (from the master branch), it’d be great if you could file a
>> bug on bugs.llvm.org with your input file (if possible).
>>
>>
>>
>> *From: *llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Joseph
>> via llvm-dev <llvm-dev at lists.llvm.org>
>> *Reply-To: *Joseph <cybercheesecake2 at gmail.com>
>> *Date: *Saturday, August 15, 2020 at 6:53 AM
>> *To: *llvm-dev <llvm-dev at lists.llvm.org>
>> *Subject: *[llvm-dev] Adding bitcode to an existing MachO object file
>>
>>
>>
>> This is a silly question, but I am in a situation where I need to build
>> x86 and arm assembly sources for some sources while the rest will be built
>> with C. I do know that just adding `-fembed-bitcode` to a C sources would
>> embed bitcode, but doing the same for the assembly files will not do that
>> (at least, it will add the 1-byte `_LLVM,__asm` section, but not the
>> `__LLVM,__bitcode` section). Furthermore, I do need the final output to
>> contain bitcode for all files used.
>>
>> So, my question is if it is possible to add the `__LLVM,__bitcode`
>> section later to the MachO object file. I tried to archive the bitcode
>> using `xar` and run `llvm-objcopy main.o
>> --add-section=__LLVM,__bitcode=main.xar main2.o`, but it failed with an
>> `unsupported load command`. This seems to be the case for all usages of
>> `llvm-objcopy` with MachO files.
>>
>> Cheers and thanks
>>
>> -- Joseph
>>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200817/5e626987/attachment.html>


More information about the llvm-dev mailing list