I believe I have the JS project prepared but still struggling with compiling the SpiderMonkey.
@elvman and @ricardo did a lot of good work on this.
I’m using the master branch from here: https://github.com/ricardoquesada/Spidermonkey/tree/master
BTW, is this proper version?
This is how I’ve modified the build.sh:
MIN_IOS_VERSION=9.0
IOS_SDK=9.0
LIPO="xcrun -sdk AppleTVOS lipo"
STRIP="xcrun -sdk AppleTVOS strip"
../configure --with-ios-target=AppleTVOS --with-ios-version=$IOS_SDK --with-ios-min-version=$MIN_IOS_VERSION --with-ios-arch=arm64 \
--disable-shared-js --disable-tests --disable-ion --disable-jm --disable-tm --enable-llvm-hacks --disable-methodjit --disable-monoic --disable-polyic --disable-yarr-jit \
--enable-optimize=-O3 --with-thumb=yes --enable-strip --enable-install-strip --without-intl-api --disable-debug --disable-threadsafe \
--disable-gcgenerational --disable-exact-rooting --enable-fembed-bitcode
if [ -e js/src/libjs_static.arm64.a ] ; then
echo "creating fat version of the library"
$LIPO -create -output libjs_static.a js/src/libjs_static.arm64.a
# remove debugging info
$STRIP -S libjs_static.a
$LIPO -info libjs_static.a
fi
And this is how I’ve modified the js/src/configure:
case "$ios_target" in
iPhoneOS|iPhoneSimulator|AppleTVOS)
When it runs it throws long error description. What I believe is the problem is that it is compiled for iPhone target.
See the error: ld: building for iOS, but linking against dylib built for tvOS
.
How can I fix it?
This is my env dump inside the configure
:
ios_sdk_version=9.0
CPU_ARCH=
ios_arch=arm64
TARGET_CPU=x86_64
target_os=darwin
target_name=arm
xcode_base=/Applications/Xcode.app/Contents/Developer/Platforms
ios_toolchain=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ios_target=AppleTVOS
ios_sdk_root=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk
This is the complete error text. I also attach the two modified files tvos.zip (81.8 KB). The attached files contain my attempt to set TARGET_CPU=arm64
which did not work:
checking for gcc… /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking whether the C compiler (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -arch arm64 -miphoneos-version-min=9.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include -pipe -Wno-implicit-int -Wno-return-type -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -arch arm64 -v) works… no
configure: error: installation or configuration problem: C compiler cannot create executables.
------ config.log ------
Thread model: posix
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang” -cc1 -triple arm64-apple-ios9.0.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name conftest.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -target-cpu cyclone -target-feature +neon -target-feature +crc -target-feature +crypto -target-feature +zcm -target-feature +zcz -target-abi darwinpcs -target-linker-version 253.6 -v -dwarf-column-info -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/7.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include -I /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include -Wno-implicit-int -Wno-return-type -Wno-implicit-int -Wno-return-type -fdebug-compilation-dir /pp/src/work/spiderMonkey/Spidermonkey-2015-03-18–91cf703–v34–HACKED/js/src/build-tvos -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fallow-half-arguments-and-returns -fblocks -fobjc-runtime=ios-9.0.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -o /var/folders/49/yy4_svhx0s57y2d178hswnym0000gn/T/conftest-4e9429.o -x c conftest.c
clang -cc1 version 7.0.0 based upon LLVM 3.7.0svn default target x86_64-apple-darwin14.5.0
ignoring nonexistent directory “/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/local/include”
ignoring nonexistent directory “/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/Library/Frameworks”
ignoring duplicate directory “/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include”
ignoring duplicate directory “/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include”
as it is a non-system directory that duplicates a system directory
#include “…” search starts here:
#include <…> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/7.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks (framework directory)
End of search list.
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld” -demangle -dynamic -arch arm64 -iphoneos_version_min 9.0.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -o conftest /var/folders/49/yy4_svhx0s57y2d178hswnym0000gn/T/conftest-4e9429.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/7.0.0/lib/darwin/libclang_rt.ios.a
ld: building for iOS, but linking against dylib built for tvOS (/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/lib/libSystem.tbd). file ‘/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/lib/libSystem.tbd’ for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure: failed program was:
#line 2301 “configure”
#include “confdefs.h”
main(){return(0);}
configure: error: installation or configuration problem: C compiler cannot create executables.