J2OBJC_ARCHS build libraries question

Skip to first unread message

Raymond Chan

Jul 13, 2023, 10:33:21 PM7/13/23
to j2objc-discuss
Hi all,

I just checked out the latest j2objc source code and compiled j2objc using the following command:

export J2OBJC_ARCHS="iphone64 iphone64e simulator64"
make -j8 all_dist

The build process was successful, and everything runs fine. However, in the /lib folder, I noticed that the .a libraries are split into /iphone and /simulator.

Now, in the Xcode project settings, I need to change the Library search paths accordingly.

Screenshot 2023-07-14 at 10.13.05 AM.png 

I used 'lipo -info' to check the architectures of the libraries:

/lib/simulator/libguava.a has architectures: x86_64 arm64
/lib/iphone/libguava.a has architectures: arm64 arm64e

My question is, can I combine the /iphone and /simulator fat files to build a single.a file with the architectures: x86_64 arm64 arm64e?"


Tom Ball

Jul 14, 2023, 12:00:31 AM7/14/23
to j2objc-...@googlegroups.com
Apple's rules on what archs can and cannot be merged seems to change with every major Xcode release. I'd point you to their docs, but AFAIK, there aren't any. The good news is that the "can or cannot" decision is made by (I think) lipo, so it's easy to experiment to see what this version considers acceptable. The flags we use with lipo are all in j2objc/make/fat_lib_macros.mk, so let us know (or submit a pull request) if you find a more optimal solution.

You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/j2objc-discuss/3dfb34c1-370c-497b-bc7b-a75682f04523n%40googlegroups.com.

Raymond Chan

Jul 17, 2023, 10:53:01 PM7/17/23
to j2objc-discuss
Hi Tom,

I appreciate the tip about the flags in j2objc/make/fat_lib_macros.mk and will keep that in mind. 
I will definitely let you know if I find a more optimal solution or submit a pull request if applicable. 
Thanks again for your input!

Reply all
Reply to author
0 new messages