21 Commits

Author SHA1 Message Date
Alexander Shaposhnikov
54a7baee20 [llvm-lipo] Add missing cast
Add missing cast (to correctly sum 32-bit integers).

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374945 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 20:10:34 +00:00
Alexander Shaposhnikov
9636371b61 [llvm-lipo] Pass ArrayRef by value.
Pass ArrayRef by value, fix formatting. NFC.

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374637 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-12 06:14:02 +00:00
Heejin Ahn
ef83d68cd3 [llvm-lipo] Add TextAPI to LINK_COMPONENTS
Summary:
D68319 uses `MachO::getCPUTypeFromArchitecture` and without this builds
with `-DBUILD_SHARED_LIBS=ON` fail.

Reviewers: alexshap

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68594

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373974 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-07 22:11:30 +00:00
Alexander Shaposhnikov
f6c27eb345 [llvm-lipo] Relax the check of the specified input file architecture
cctools lipo only compares the cputypes when it verifies that
the specified (via -arch) input file and the architecture match.
This diff adjusts the behavior of llvm-lipo accordingly. 

Differential revision: https://reviews.llvm.org/D68319

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373966 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-07 21:14:22 +00:00
Alexander Shaposhnikov
7719600776 [llvm-lipo] Add support for -arch
Add support for -arch.

Differential revision: https://reviews.llvm.org/D68116

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373132 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 22:33:18 +00:00
Alexander Shaposhnikov
f11e5b4be6 [llvm-lipo] Add support for archives
Add support for creating universal binaries which 
can contain an archive.

Differential revision: https://reviews.llvm.org/D67758

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372666 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-23 22:22:55 +00:00
Alexander Shaposhnikov
b239f0547f [Object] Extend MachOUniversalBinary::getObjectForArch
Make the method MachOUniversalBinary::getObjectForArch return MachOUniversalBinary::ObjectForArch
and add helper methods MachOUniversalBinary::getMachOObjectForArch, MachOUniversalBinary::getArchiveForArch
for those who explicitly expect to get a MachOObjectFile or an Archive.

Differential revision: https://reviews.llvm.org/D67700

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372278 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-19 00:02:12 +00:00
Anusha Basana
c506cad892 [llvm-lipo] Implement -segalign
Sets section alignments of the specified architecture slices to the
alignment values.
Alignment values are hexadecimal values that are powers of 2.

Differential Revision: https://reviews.llvm.org/D65420

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367908 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 19:06:55 +00:00
Anusha Basana
d174e9120d [build] Add the ability to create a symlink for lipo
Add user enabled option to create lipo with symlink to llvm-lipo
Used rL326381 for reference.

Differential Revision: https://reviews.llvm.org/D65477

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367444 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-31 16:46:57 +00:00
Anusha Basana
a803ec4c39 [llvm-lipo] Implement -replace
Replaces specified architecture in universal binary input file with
slice from the file_name argument passed into the replace command.

Differential Revision: https://reviews.llvm.org/D65247

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367248 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-29 18:46:34 +00:00
Shoaib Meenai
51e124d8c8 [llvm-lipo] Implement alignment function in -create
Summary:
Removes hard coded valuse for alignment in -create.

Patch by Anusha Basana <anusha.basana@gmail.com>

Differential Revision: https://reviews.llvm.org/D64871

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366970 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-25 00:29:19 +00:00
Shoaib Meenai
0e98b2621d [llvm-lipo] Implement -info
Prints architecture type of all input files.

Patch by Anusha Basana <anusha.basana@gmail.com>

Differential Revision: https://reviews.llvm.org/D64668

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-23 00:42:03 +00:00
Simon Pilgrim
ab56dc92bf Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366563 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-19 11:18:46 +00:00
Shoaib Meenai
b9b17950ef Reapply [llvm-lipo] Implement -create (with hardcoded alignments)
This reapplies r366142 with a fix for the failing Windows test.

Original commit message:

Creates universal binary output file from input files. Currently uses
hard coded value for alignment.  Want to get the create functionality
approved before implementing the alignment function.

Patch by Anusha Basana <anusha.basana@gmail.com>

Differential Revision: https://reviews.llvm.org/D64102

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366512 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-18 22:48:38 +00:00
Shoaib Meenai
a7eae67847 Revert [llvm-lipo] Implement -create (with hardcoded alignments)
This reverts r366142 (git commit 67cee1dc7ee285b03372eb818a3894d35efa7394)

The test is failing on the Windows buildbots. Reverting while I
investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366144 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-15 22:44:08 +00:00
Shoaib Meenai
d62ea46def [llvm-lipo] Implement -create (with hardcoded alignments)
Creates universal binary output file from input files. Currently uses
hard coded value for alignment.  Want to get the create functionality
approved before implementing the alignment function.

Patch by Anusha Basana <anusha.basana@gmail.com>

Differential Revision: https://reviews.llvm.org/D64102

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366142 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-15 22:29:30 +00:00
Shoaib Meenai
134d93de29 [MachO] Add valid architecture function
Added array of valid architectures and function returning array.
Modified llvm-lipo to include list of valid architectures in error message for invalid arch.

Patch by Anusha Basana <anusha.basana@gmail.com>

Differential Revision: https://reviews.llvm.org/D63735

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365099 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-04 00:17:02 +00:00
Shoaib Meenai
cd4206f809 [llvm-lipo] Implement -thin
Creates thin output file of specified arch_type from the fat input file.

Patch by Anusha Basana <anushabasana@fb.com>

Differential Revision: https://reviews.llvm.org/D63341

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364107 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-21 21:59:01 +00:00
Shoaib Meenai
29689844ec [llvm-lipo] Drop unneeded braces. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362841 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-07 20:52:17 +00:00
Shoaib Meenai
6a45b693a1 [llvm-lipo] Implement -archs
Displays the architecture names of an input file.
Unknown architectures are represented by unknown(cputype,cpusubtype).

Patch by Anusha Basana <anusha.basana@gmail.com>

Differential Revision: https://reviews.llvm.org/D62753

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362840 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-07 20:47:58 +00:00
Alexander Shaposhnikov
59db388889 [tools] Introduce llvm-lipo
This diff starts the implementation of llvm-lipo 
which is supposed to be a drop-in replacement for the well-known tool lipo.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D61927


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361896 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 23:22:12 +00:00