Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Missing symbols on ARMv7 #2

Closed
henriqueranj opened this issue Apr 19, 2018 · 6 comments
Closed

Missing symbols on ARMv7 #2

henriqueranj opened this issue Apr 19, 2018 · 6 comments
Labels
bug Something isn't working ios Issues that affect iOS

Comments

@henriqueranj
Copy link

Hello @olokobayusuf ,

I am currently facing an issue with building the NatShare plugin for an iPhone 5c and iPad4 with iOS 10.3 and armv7. The library builds properly for iPhone 5s and iPhone 6s.

When building in XCode the following linking errors occur:

Ld /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos/thor.app/thor normal armv7 cd /Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808 export IPHONEOS_DEPLOYMENT_TARGET=10.0 export PATH="/Applications/Xcode 9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 9.2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode\ 9.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode\ 9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808 -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCorder/Plugins/iOS -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatShare/Plugins/iOS -F/Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos -filelist /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/armv7/thor.LinkFileList -Xlinker -map -Xlinker /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/thor-LinkMap-normal-armv7.txt -miphoneos-version-min=10.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/armv7/thor_lto.o -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lc++ -weak_framework CoreMotion -weak-lSystem -weak_framework Photos -framework AssetsLibrary -framework MobileCoreServices -framework Security -framework MediaToolbox -liPhone-lib -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework MediaPlayer -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -lVuforiaWrapper -lVuforia -lNatCorder -lNatCamRenderPipeline -lNatShare -lNatCam -weak_framework Metal -weak_framework GameController -weak_framework Accelerate -weak_framework CoreImage -weak_framework Photos -Xlinker -dependency_info -Xlinker /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/armv7/thor_dependency_info.dat -o /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos/thor.app/thor ld: warning: ignoring file /Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatShare/Plugins/iOS/libNatShare.a, file was built for archive which is not the architecture being linked (armv7): /Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatShare/Plugins/iOS/libNatShare.a ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCorder/Plugins/iOS/libNatCorder.a(Bridge.o)) was built for newer iOS version (10.2) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCorder/Plugins/iOS/libNatCorder.a(NatCorder.o)) was built for newer iOS version (10.2) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(GLRenderContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(GLTransferContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(MTLTransferContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(RenderContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(RenderTrigger.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(TransferContext.o)) was built for newer iOS version (10.3) than being linked (10.0) Undefined symbols for architecture armv7: "_NSFreeThumbnail", referenced from: _NatShareBridge_FreeThumbnail_m2682538311 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_GetThumbnail_m3910153246 in Bulk_Assembly-CSharp_6.o _U3CGetThumbnailU3Ec__Iterator0_MoveNext_m168441619 in Bulk_Assembly-CSharp_6.o "_NSGetThumbnail", referenced from: _NatShareBridge_GetThumbnail_m1365058599 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_GetThumbnail_m3910153246 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_GetThumbnail_m783373813 in Bulk_Assembly-CSharp_6.o "_NSSaveVideoToCameraRoll", referenced from: _NatShareBridge_SaveToCameraRoll_m3813728512 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_SaveToCameraRoll_m1414728861 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_SaveToCameraRoll_m345998860 in Bulk_Assembly-CSharp_6.o "_NSSaveImageToCameraRoll", referenced from: _NatShareBridge_SaveToCameraRoll_m1715948791 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_SaveToCameraRoll_m293370051 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_SaveToCameraRoll_m3521617472 in Bulk_Assembly-CSharp_6.o "_NSShareVideo", referenced from: _NatShareBridge_Share_m740276308 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_Share_m599193430 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_Share_m3151828097 in Bulk_Assembly-CSharp_6.o "_NSShareImage", referenced from: _NatShareBridge_Share_m2665191448 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_Share_m1414757877 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_Share_m323996880 in Bulk_Assembly-CSharp_6.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

@olokobayusuf
Copy link
Member

I have attached an updated libNatShare.a. Please test it out and let me know if it works.
libNatShare.a.zip

@olokobayusuf olokobayusuf added bug Something isn't working ios Issues that affect iOS labels Apr 19, 2018
@miketalbott
Copy link

miketalbott commented Apr 19, 2018

I might be having a similar issue. I can build to my test devices (iPhone SE iPad Pro) but I cannot create an archive. I tried the updated libNatShare.a without success.

Here's the log:
ld: warning: ignoring file /Users/mike/Documents/Projects/HoloTats/BVAR_Core_Unity730/Builds/ios/AppAR8_v3.5.0_b35006/Libraries/_Core/3rdParty/NatShare/Plugins/iOS/libNatShare.a, file was built for archive which is not the architecture being linked (armv7): /Users/mike/Documents/Projects/HoloTats/BVAR_Core_Unity730/Builds/ios/AppAR8_v3.5.0_b35006/Libraries/_Core/3rdParty/NatShare/Plugins/iOS/libNatShare.a Undefined symbols for architecture armv7: "_NSFreeThumbnail", referenced from: _NatShareBridge_FreeThumbnail_m2682538311 in Bulk_Assembly-CSharp_10.o _NatShareiOS_NatShareU_INatShare_GetThumbnail_m3910153246 in Bulk_Assembly-CSharp_10.o _U3CGetThumbnailU3Ec__Iterator0_MoveNext_m168441619 in Bulk_Assembly-CSharp_10.o "_NSGetThumbnail", referenced from: _NatShareBridge_GetThumbnail_m1365058599 in Bulk_Assembly-CSharp_10.o _NatShareiOS_NatShareU_INatShare_GetThumbnail_m3910153246 in Bulk_Assembly-CSharp_10.o _NatShareWebGL_NatShareU_INatShare_GetThumbnail_m783373813 in Bulk_Assembly-CSharp_10.o "_NSSaveVideoToCameraRoll", referenced from: _NatShareBridge_SaveToCameraRoll_m3813728512 in Bulk_Assembly-CSharp_10.o _NatShareiOS_NatShareU_INatShare_SaveToCameraRoll_m1414728861 in Bulk_Assembly-CSharp_10.o _NatShareWebGL_NatShareU_INatShare_SaveToCameraRoll_m345998860 in Bulk_Assembly-CSharp_10.o "_NSSaveImageToCameraRoll", referenced from: _NatShareBridge_SaveToCameraRoll_m1715948791 in Bulk_Assembly-CSharp_10.o _NatShareiOS_NatShareU_INatShare_SaveToCameraRoll_m293370051 in Bulk_Assembly-CSharp_10.o _NatShareWebGL_NatShareU_INatShare_SaveToCameraRoll_m3521617472 in Bulk_Assembly-CSharp_10.o "_NSShareVideo", referenced from: _NatShareBridge_Share_m740276308 in Bulk_Assembly-CSharp_10.o _NatShareiOS_NatShareU_INatShare_Share_m599193430 in Bulk_Assembly-CSharp_10.o _NatShareWebGL_NatShareU_INatShare_Share_m3151828097 in Bulk_Assembly-CSharp_10.o "_NSShareImage", referenced from: _NatShareBridge_Share_m2665191448 in Bulk_Assembly-CSharp_10.o _NatShareiOS_NatShareU_INatShare_Share_m1414757877 in Bulk_Assembly-CSharp_10.o _NatShareWebGL_NatShareU_INatShare_Share_m323996880 in Bulk_Assembly-CSharp_10.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

@olokobayusuf
Copy link
Member

@miketalbott Download the updated library I attached above and let me know if that fixes it--it should.

@olokobayusuf olokobayusuf changed the title Building for iOS 10 Missing symbols on ARMv7 Apr 19, 2018
@henriqueranj
Copy link
Author

Hi @olokobayusuf , the build linking issue still persists after adding that new library. Does it work your side?

@henriqueranj
Copy link
Author

As a workaround, I am including the NatShare.m file instead of the libNatShare.a. This way I can properly make builds in all iOS platforms and the Sharing features work well.

@olokobayusuf is there an advantage to using a compiled lib instead of the source Objective-C script?

@olokobayusuf
Copy link
Member

@henriqueranj I changed the build configuration in Xcode to build all supported architectures (since this is what we do in other projects) and expected it to work. Using lipo, it turns out that only arm64 was built. After some time, I realized that Xcode doesn't support building for armv7 when the deployment target is iOS 11 or newer. It seems that Apple really wants to get rid of this portion of its past.

I have pushed the fix in 21021d5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working ios Issues that affect iOS
Projects
None yet
Development

No branches or pull requests

3 participants