Basically since Xcode 7.1 they have replaced the linker command with a new version:
macbookproloreto:~ admin$ cd /Applications/Xcode.app/Contents/Developer/usr/bin/
macbookproloreto:bin admin$ ls -l ld*
lrwxr-xr-x 1 root wheel 6 25 Nov 16:31 ld -> ld-old
-rwxr-xr-x 1 root wheel 17840 29 Ott 22:36 ld-new
-rwxr-x--x 1 root wheel 1861488 25 Nov 16:30 ld-old
macbookproloreto:bin admin$ ./ld-old -v
@(#)PROGRAM:ld PROJECT:ld64-253.3
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
macbookproloreto:bin admin$ ./ld-new -v
@(#)PROGRAM:ld PROJECT:ld64-253.6
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: Apple LLVM 7.0.0 (clang-700.1.76)
macbookproloreto:bin admin$
And the combination of the ld version ld64-253.3 and Xcode 7.1 causes the error:
ld: in /MyLibrary/SDK/SpotifySDK/Spotify.a(SPTAlbum.o), building for tvOS, but linking in object file built for iOS, for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The last version of ld that worked to link iOS libraries against tvOS build was ld64-253.3.2
macbookproloreto:bin admin$ ./ld_old -v
@(#)PROGRAM:ld PROJECT:ld64-253.3.2 configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) LTO support using: Apple LLVM 7.0.0 (clang-700.1.76)
This was shipped with
XCode Version 7.1 beta (7B60)
and iOS9.0
Using Xcode 7.1 Beta and ld64-253.3.2 is the only option to build for AppleTVKit a iOS built libray. The DMG is this one
11667b8f7d4167c791789f29a44bb375916f93e6 Xcode_7.1_beta.dmg
But it is not available anymore on Apple Developers.