I have two 3rd party libraries. One just has a build for armv6 and the other just has a build for armv7. I need to use both of them in my iOS enterprise application. I've asked the armv6 library vendors to supply a armv7 version, but they haven't been able to do so. (Note: I've already got the answer and will provide it. Someone else asked this in a comment and there wasn't enough room to answer, so I've created its own question, and will provide my answer.)
How to use armv6 third party libraries in an armv7 app?
2k Views Asked by Owen Hartnett At
1
There are 1 best solutions below
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in LIBRARIES
- how to print a receipt to a particular printer
- Android support-v4:22.0.0 Not downloading to correct location?
- Use jstl core as a local resource
- Where are the implementations of the C libraries?
- java.lang.NoClassDefFoundError & Failed resolving ... interface 804 (LibGDX)
- POCO C++ SAX parser: If the xml document encoding is ANSI then next statement is not reading and throwing encoding error exception
- How to use Library from GitHub in android App
- Unable to install PhantomJS
- Trying to write a custom library for a blinking light
- How to make application that stores orders and prints receipts?
- Does adding dependency to gradle in android studio while not using it at all affect apk size?
- Use Linphone in Armv7s, Armv7 and arm64
- Where Should One Place Third Party Libraries?
- Webpack for component library
- cannot include COM reference in Qt C++
Related Questions in ARMV7
- an app supporting arm64 and armv7 running on arm64 and ios 7 ipad air
- UnsatisfiedLinkError on Samsung S6
- armv7 not included in build
- Checking if ARM is in supervisor mode or interrupt mode during kernel bootup
- Printing symbol table like entries during kernel bootup in ARM
- Disable timer interrupts in kernel source for mode switching in ARM
- PRIx64 format macro not defined when compiling for armeabi-v7a
- Apple Mach-O Linker Error in Parse Push Notification Framework
- Undefined symbols for architecture i386/armv7 [cocoapods]
- In ARMv7, is the address used in TTBR0 and TTBR1 physical or virtual
- How to update your iOS app using Cordova without supporting arm64 or having iPhone 6
- armv7s in third party framework
- What is the role of undefined exception handler (__und_svc) in kprobes?
- How to correctly build armv7 static library using xcodebuild
- Ignoring file "path", missing required architecture i386/armv7 in file "path"
Related Questions in ARMV6
- ARMv6 floating point operations per cycle
- Service is auto killed by the system and is later restarted in Android 2.3.4
- "Baking Pi: OK03" - Not understanding a function
- ARM prefetch workaround
- Build f2c for ARMv6, ARMv7 and i386 architecture
- Removing support for iPhone 3G
- Setting up Interrupt Vector Table, ARMv6
- Calling ARM assembly from C, GCC (bare metal)
- ARM11 Translation Lookaside Buffer (TLB) usage?
- Relocate the ARM exception vectors?
- How to exclude some instructions when compiling C code for arm v6 core using gcc?
- How to use armv6 third party libraries in an armv7 app?
- With an ARMv6 only build to I need to include UIRequiredDeviceCapabilities: armv6?
- XCode 4.2 compiling for iPhone 3g (armv6)
- symbol(s) not found for architecture armv6
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The answer is to hack the armv6 library into thinking it's an armv7 library. This will get you running until the vendor supplies the library. The reason this works is because the arm spec requires all arm architectures to be able to run code generated by previous architectures. So if an armv6 library told the linker it's an armv7, the processor should still be able to run the code. Of course, you can't go the other way. Use otool -h on both libraries to see the cputype and cpusubtype. On my libraries it was 12 for both cputypes, and 6 and 9 for the subtypes, indicating armv6 and armv7. Using a hex editor, look for the hex string 0xcefaedfe which is the marker MH_MAGIC (0xfeedface) reversed due to big/little endian.
Following that, there's a whole word with just 0xC. That's the 12 for the cputype. Next is a word for 0x6. Change that to 0x9 for all cases. Now ld will think your library is an armv7, and act accordingly.
You're probably not done, because the armv6 may have linked in some thumbs library routines. If you get link errors (I got some for switch8 and switch16), you need to find the Darwin code that has them. Look for the file lib1funcs.asm on the web. This will probably have your missing functions. They're probably conditionaled out, so adjust the #ifdefs and make sure they're being compiled. This file tries to open some includes at the end, but since they're at the end, they don't affect anything, so just comment them out.
Yes, it is a tremendous hack, but it gets you up and running. If you get your revised library, you just have to drop it in. No code change required. If it works for you, you're still using Apple's code, and it would be the same code you'd be running if you were armv6 only.