Skip to content

Instantly share code, notes, and snippets.

@looping
Last active August 6, 2020 15:03
Show Gist options
  • Save looping/cd25b16e93b8fa3158cf to your computer and use it in GitHub Desktop.
Save looping/cd25b16e93b8fa3158cf to your computer and use it in GitHub Desktop.
Hack a .a library file
# Using libtool, lipo, ar and otool
lipo -info input.a
lipo -extract_family arm64 -output output.a input.a
# output.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
# lipo output.a -thin arm64 -output output_arm64.a
ar -x output_arm64.a
otool -tv xxx.o
libtool -static -o output_arm64_new.a *.o
lipo -create -output lib.a output_arm64_new.a output_armv7s_new.a output_armv7_new.a output_i386_new.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment