-
November 23rd, 2020, 10:30 PM
#1
Lightstreamer support for ARM macOS
I am encountering linking errors when building macOS 11 apps/frameworks which use the Lightstreamer dynamic libraries. The exact error I get in the Xcode 12.2 build is:
ld: warning: ignoring file /Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Release/Lightstreamer_macOS_Client.framework/Lightstreamer_macOS_Client, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_LSLightstreamerClient", referenced from:
objc-class-ref in StreamerLowlevelTests.o
objc-class-ref in IG.o
"_OBJC_CLASS_$_LSSubscription", referenced from:
objc-class-ref in StreamerLowlevelTests.o
objc-class-ref in IG.o
The error references some of my test files, but if I understand it correctly, Xcode cannot link to the binary framework due to incompatibilities between the app architecture (arm64) and the dynamic library architecture (x86_64).
I am trying to find solutions by tweaking my Swift Package Manifest and using Rosetta 2 for emulation. So far I am unsuccessful, but I am trying to contact people on the Swift forums. I will post any solution I find here. It would save me a lot of pain, though; if Lightstreamer would just release their dynamic libraries with both x86_64 and arm64 as fat binaries. Lightstreamer already does this with iOS and tvOS, so I don't think it would be much more than a recompile with the new Xcode toolchain from your side.
-
November 24th, 2020, 09:37 AM
#2
Hello dehesa,
To provide support for arm64 architecture on macOS for our client library, we depend on the same support from J2ObjC. At the moment it is not yet available, but I'm sure they are working on it.
As a temporary workaround, you can exclude the arm64 architecture from the build settings of your macOS target. Follow these steps:
- Go to Build Settings.
- Open Architectures (the first group).
- Open the Excluded Architectures subgroup.
- Add a line for Debug.
- Select "Any SDK" and enter "arm64" as the setting value.
- Add a line for Release.
- Select "Any SDK" and enter "arm64" as the setting value.
This should fix the build errors, but of course it will also exclude support for ARM processors from your target. It will still run on ARM Macs through Rosetta, though.
As soon as J2ObjC provides support for the arm64 architecture, we will add it to our client library.
-
November 25th, 2020, 09:31 AM
#3
Hi Gianluca,
Thank you for the response and indications. I am aware of those project settings; however things get a bit more complicated when you are delivering frameworks through SPM (which is my case). I am currently solving the issue through compiler directives and telling/forcing my clients to not use arm64 binaries, but this is obviously not ideal. Hopefully J2ObjC provides support soon or you find other ways to compile for arm64.
Regards.
Similar Threads
-
By hpang in forum Client SDKs
Replies: 3
Last Post: September 19th, 2017, 07:14 PM
-
By sachinpatel2 in forum Client SDKs
Replies: 1
Last Post: September 10th, 2010, 10:01 AM
-
By pacesie in forum General
Replies: 1
Last Post: March 26th, 2008, 09:01 AM
-
By rsouissi in forum General
Replies: 1
Last Post: May 30th, 2007, 04:15 PM
-
By ratsey in forum Client SDKs
Replies: 3
Last Post: April 20th, 2007, 01:42 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 06:09 AM.
Bookmarks