forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-lipo] Support object files with bitcode asm
llvm-lipo crashes when trying to use inputs that contain bitcode asm instructions. This happens when trying to create universal binaries for LLVM with LTO. https://reviews.llvm.org/D118575 is a similar change that ran into this same issue, and I'm mirroring the same change by registering the targets to fix this issue. Reviewed By: alexander-shaposhnikov, keith Differential Revision: https://reviews.llvm.org/D133729
- Loading branch information
1 parent
41182a6
commit 61e5438
Showing
4 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
target triple = "arm64-apple-macosx11.0.0" | ||
|
||
module asm ".desc ___crashreporter_info__, 0x10" | ||
|
||
define void @somesymbol() { | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
target triple = "x86_64-apple-macosx11.0.0" | ||
|
||
module asm ".desc ___crashreporter_info__, 0x10" | ||
|
||
define void @somesymbol() { | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# RUN: llvm-as %p/Inputs/arm64-asm.ll -o %t-arm64-asm.o | ||
# RUN: llvm-as %p/Inputs/x86_64-asm.ll -o %t-x86_64-asm.o | ||
|
||
# RUN: llvm-lipo %t-arm64-asm.o %t-x86_64-asm.o -create -output %t-universal.o | ||
# RUN: llvm-lipo %t-arm64-asm.o -arch x86_64 %t-x86_64-asm.o -create -output %t-universal-1.o | ||
# RUN: cmp %t-universal.o %t-universal-1.o | ||
# RUN: llvm-lipo -arch arm64 %t-arm64-asm.o -arch x86_64 %t-x86_64-asm.o -create -output %t-universal-2.o | ||
# RUN: cmp %t-universal.o %t-universal-2.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters