Combining multi-architecture binaries with lipo and libtool
来源:互联网 发布:金10数据官网 双十一 编辑:程序博客网 时间:2024/06/06 05:58
Combining multi-architecture binaries with lipo and libtool
A problem you don't have every day is finding a way to merge two multi-architecture binary files. In case you find yourself in need for a solution to that particular problem, here is one using lipo andlibtool, both tools available on MacOS X.
Let's assume you have two binary files libFirst.a and libSecond.a. Each contains object files for different architectures. To find out which architectures exactly those are, run lipo -info on them:
> lipo -info libFirst.a libSecond.a
Architectures in the fat file: libFirst.a are: armv7 armv7s
Architectures in the fat file: libSecond.a are: armv7 armv7s
Now, to combine the two library files, you first have to extract individual architectures from each one using lipo -extract:
> lipo -extract armv7 libFirst.a -o libFirst_armv7.a
> lipo -extract armv7s libFirst.a -o libFirst_armv7s.a
> lipo -extract armv7 libSecond.a -o libSecond_armv7.a
> lipo -extract armv7s libSecond.a -o libSecond_armv7s.a
The next step is to use libtool -static to combine the results of the same architecture:
> libtool -static libFirst_armv7.a libSecond_armv7.a -o libCombined_armv7.a
> libtool -static libFirst_armv7s.a libSecond_armv7s.a -o libCombined_armv7s.a
And finally you can use lipo -create to get your final result:
> lipo -create libCombined_armv7.a libCombined_armv7s.a -o libCombined.a
That's it! You have successfully combined two multi-architecture binaries into one.
> lipo -info libCombined.a
Architectures in the fat file: libCombined.a are: armv7 armv7s
Oh, and just in case you're curious how the source code for lipo and libtool look like, here are the links:
- http://www.opensource.apple.com/source/cctools/cctools-667.3/misc/lipo.c
- http://www.opensource.apple.com/source/cctools/cctools-667.3/misc/libtool.c
- Combining multi-architecture binaries with lipo and libtool
- Combining Images with Photoshop Elements: Selecting, Layering, Masking, and Compositing
- Combining Qt Widgets and QML with QWidget::createWindowContainer()
- Combining Navigation Drawer with ViewPager and TabLayout in one screen
- MDX + T-SQL: Combining relational and multi-dimensional data into one query result set
- SQL Queries and Multi-Org Architecture in Release 12
- ar命令解压.a时候,报错 is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
- lipo (dumplicate symbols for architecture XXXX)
- Combining Hive and Python
- Combining weightSum and layout_weight
- Placeholder for AMDU binaries and using with ASM 10g (Doc ID 553639.1)
- DLLs with Libtool
- 【机器学习系列】《Combining Labeled and Unlabeled Data with Co-Training》读书笔记
- Bitstrings and Binaries 的不同
- Multi-process Architecture
- chromium Multi-process Architecture
- lipo
- lipo
- SQL存储位置修改
- OpenCV 矩阵(图像)操作函数
- 房间安排
- 一些tableView的基础Knowledge(2015414)
- Android DrawerLayout 高仿QQ5.2双向侧滑菜单
- Combining multi-architecture binaries with lipo and libtool
- CSDN-markdown编辑器
- 杭电2535(Vote)
- android时间对话框TimePickerDialog介绍
- Hadoop编程调用HDFS
- 模仿,类比,移植技法(创新技法5)
- 如何定义和实现一个类的成员函数为回调函数
- poj 2154 Color (polya,欧拉函数|容斥原理)
- 输入一个数倒序输出