I'm trying to build fftw for iOS.
I found this question:
How to link third party libraries like fftw3 and sndfile to an iPhone project in Xcode?
And tried running the shell script, but I am getting the errors shown below.
make[2]: *** [bench] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
lipo: unknown architecture specification flag: armv7s in specifying input file -arch armv7s ios-library/libfftw3f_armv7s.a
lipo: known architecture flags are: any little big ppc64 x86_64 ppc970-64 ppc i386 m68k hppa sparc m88k i860 veo arm ppc601 ppc603 ppc603e ppc603ev ppc604 ppc604e ppc750 ppc7400 ppc7450 ppc970 i486 i486SX pentium i586 pentpro i686 pentIIm3 pentIIm5 pentium4 m68030 m68040 hppa7100LC veo1 veo2 veo3 veo4 armv4t armv5 xscale armv6 armv7 armv7f armv7k
lipo: Usage: lipo [input_file] ... [-arch <arch_type> input_file] ... [-info] [-detailed_info] [-output output_file] [-create] [-arch_blank <arch_type>] [-thin <arch_type>] [-remove <arch_type>] ... [-extract <arch_type>] ... [-extract_family <arch_type>] ... [-verify_arch <arch_type> ...] [-replace <arch_type> <file_name>] ...
I am a total nooby when it comes to compiling for iOS so any help is much appreciated.
It looks like it can't find the armv7s architecture specified...
If I leave in only the first part, for the armv7 architecture, I get the following errors:
Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch armv7 -std=gnu99 -mfpu=neon
checking whether the C compiler works... no
configure: error: in `/Users/davidmenard/Desktop/fftw-3.3.3':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
cp: .libs/libfftw3f.a: No such file or directory
I needed to recompile my framework: double check those armv7s to not miss at that 2 place:
For me the problem was solved, hopefully it will help a few of you!
My XCode compilers were not getting along, because I had both XCode 4 and XCode5-DP5 installed. Using the latest compiler fixed my errors.
Related
I am trying to package a Jailbreak Tweak using Theos on Windows 8.1 (64bit). If I do not specify Arm64 it compiles fine and works on my iPhone 5. However not my 6s. The console says a big error which I don't understand. Any help trying to get this tweak to compile with 64bit architecture would be great.
Makefile:
ARCHS = armv7 armv7s arm64
test_FRAMEWORKS = UIKit
include theos/makefiles/common.mk
TWEAK_NAME = Forton
Forton_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += fortonprefs
include $(THEOS_MAKE_PATH)/aggregate.mk
Error Log:
$ make package
/home/AbbottL/forton/theos/makefiles/targets/Cygwin/iphone.mk:38: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak Forton...
Linking tweak Forton...
ld: warning: ignoring file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o, missing required architecture arm64 in file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o (2 slices)
ld: warning: ignoring file /home/AbbottL/forton/theos/lib/libsubstrate.dylib, file was built for armv7 which is not the architecture being linked (arm64): /home/AbbottL/forton/theos/lib/libsubstrate.dylib
Undefined symbols for architecture arm64:
"_MSHookMessageEx", referenced from:
_logosLocalInit() in Tweak.xm.91812798.o
ld: symbol(s) not found for architecture arm64
armv7-apple-darwin11-clang: error: linker command failed with exit code 1 (use -v to see invocation)
/home/AbbottL/forton/theos/makefiles/instance/library.mk:27: recipe for target 'obj/Forton.dylib.1b5b9d6a.unsigned' failed
make[2]: *** [obj/Forton.dylib.1b5b9d6a.unsigned] Error 1
/home/AbbottL/forton/theos/makefiles/instance/library.mk:19: recipe for target 'internal-library-all_' failed
make[1]: *** [internal-library-all_] Error 2
/home/AbbottL/forton/theos/makefiles/master/rules.mk:54: recipe for target 'Forton.all.tweak.variables' failed
make: *** [Forton.all.tweak.variables] Error 2
Using ios 8.1 SDK
Fixed by swapping libsustrate file to a later version.
I have tried to install GMP Library Version 6.1.0 for iOS9.
I need to compile GMP in iOS for a math project. My configuration command was like this.
./configure CC=clang CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E" CPPFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -fembed-bitcode -miphoneos-version-min=7.0 -arch armv7 -target arm-apple-darwin" --host=aarch64-apple-darwin --disable-assembly --enable-static --disable-shared --disable-thread-safe --enable-cxx
Found this configure option in :This link.
Here is my environment details:
Mac OSX 10.11.2; Xcode7.2; iOS SDK 9.2
During "configure" state it shows one warning
configure: WARNING: unrecognized options: --disable-thread-safe
But it configures without any error.
Configure summary:
configure: summary of build options:
Version: GNU MP 6.1.0
Host type: aarch64-apple-darwin
ABI: standard
Install prefix: /usr/local
Compiler: clang
Static libraries: yes
Shared libraries: no
After that I run make command.
Then make check.
While running make check command it gives the following error.
or, in text form:
/bin/sh ../libtool --tag=CC --mode=link clang -mfpu=neon -O2 -pedantic -DNO_ASM -o t-bswap t-bswap.o libtests.la ../libgmp.la
libtool: link: clang -mfpu=neon -O2 -pedantic -DNO_ASM -o t-bswap t-bswap.o ./.libs/libtests.a [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a ../.libs/libgmp.a
ld: warning: ld: warning: ignoring file ./.libs/libtests.a, file was built for archive which is not the architecture being linked (x86_64): ./.libs/libtests.aignoring file t-bswap.o, file was built for armv7 which is not the architecture being linked (x86_64): t-bswap.o
ld: warning: ignoring file [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): /Users/[redacted]/Documents/gmp-6.1.0/.libs/libgmp.a
ld: warning: ignoring file ../.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): ../.libs/libgmp.a
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [t-bswap] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check-recursive] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2
I am stuck here. Your help is highly appreciated.
[EDITED]
I cross compiled the FIPS for armv7 using the instructions from
http://opensslfoundation.com/testing/validation-2.0/platforms/ios/
I am having difficulties cross compiling openssl dependency on fips.
I am getting following error in terminal.
/usr/local/ssl/fips-2.0/bin/fipsld: line 185: ./openssl: Bad CPU type in executable
make[2]: *** [link_app.] Error 1
make[1]: *** [openssl] Error 2
make: *** [build_apps] Error 1
This is because the openssl executable under the "/apps" folder is of architecture armv7.
Since I am cross compiling openssl, I need only the libssl and libcrypto with architecture armv7, other intermediate executables should build with i386 architecture.
Any help with setting up the environment variables is appreciated.
The OpenSSL FIPS User Guide 2.0 has a comprehensive example of building the FIPS Object Module and FIPS Capable Library. It also offers a sample iOS program to test your build against. See Appendix E on p. 122.
From the looks of it (due to link_app error), you did not set your environment properly with setenv-ios-11.sh. That caused your build attempt to build the executables (which should not be built in this configuration).
I am trying to install GraphicsMagick in Xcode4, I am getting this error when i execute command 'make'.
/usr/bin/ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-module.o) has no symbols
/usr/bin/ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-PreRvIcccm.o) has no symbols
libtool: link: ranlib magick/.libs/libGraphicsMagick.a
ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-module.o) has no symbols
ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-PreRvIcccm.o) has no symbols
Undefined symbols for architecture x86_64:
"___builtin_object_size", referenced from:
_BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o)
_XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
_YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [utilities/gm] Error 1
make: *** [install] Error 2
GraphicsMagick won't compile on OS X 10.7 (Lion) or 10.8 (Mountain Lion) with the default LLVM GCC/G++ compilers. The workaround is to use the Clang compiler instead:
./configure CC=clang [...other config options...]
It is also a good idea to run the unit tests with make check after compilation just to be on the safe side.
This trick worked for me, hope it helps.
You can find a solution here.
http://sourceforge.net/projects/graphicsmagick/forums/forum/250738/topic/5221775
In attempting to compile a dummy program for iphoneos, Xcode4, gcc does not appear to reach beyond the initial sysroot directory
$ echo $ISYSROOT
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
$ gcc -arch armv6 --sysroot=$ISYSROOT test.cpp
ld: in /usr/lib/system/libcache.dylib, missing required architecture armv6 in file for architecture armv6
collect2: ld returned 1 exit status
If I leave out sysroot,
$ gcc -arch armv6 test.cpp
ld: warning: ignoring file /usr/lib/crt1.o, missing required architecture armv6 in file
ld: warning: ignoring file /usr/lib/libgcc_s.1.dylib, missing required architecture armv6 in file
ld: warning: ignoring file /usr/lib/libSystem.dylib, missing required architecture armv6 in file
Undefined symbols for architecture armv6:
"start", referenced from:
-u command line option
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status
The following works, but it feels very cheesy, and not scalable. What's going on here?
$ gcc -arch armv6 -L$ISYSROOT/usr/lib/system --sysroot=$ISYSROOT test.cpp
Update. Apparently this is a known issue, though it still is not clear how to pass sysroot to gcc but isysroot to ld
http://www.doitscared.com/?m=201104
When compiling the library, if you see this error “ld: file not found:
/usr/lib/system/libcache.dylib for architecture armv7″, then your
linker command is using “–sysroot” which doesn’t work in Xcode 4.
Instead, change the linker command to use “-isysroot”. (Note: This
only applies to the linker command. The compile commands must continue
to use “–sysroot”. See here for more details.)
Change the Deployment Target of your project to be at least 4.3 and it will work. This is a problem with XCode 4 but there really isn't a need to deploy apps to iOS versions prior to 4.3. iOS users tend to stay pretty up-to-date with their iOS versions.