[Haskell-iPhone] Build error with ghc-8.2.2 for iOS

Moritz Angermann moritz.angermann at gmail.com
Fri Nov 24 09:49:29 UTC 2017


Hi Torsten,

I believe those notes are bit dated. You might find
https://medium.com/@zw3rk/a-haskell-cross-compiler-for-ios-7cc009abe208
https://medium.com/@zw3rk/ghc-cross-compiler-binary-distributions-490bb2c0c411
helpful.

I hope to have a fresh set of better cross compiler binary distributions
ready by the end of next week.

Cheers,
 Moritz

> On Nov 24, 2017, at 5:06 PM, Torsten Kemps-Benedix <tkx68 at icloud.com> wrote:
> 
> Hello all,
> 
> I try to build ghc-8.2.2 based on a brew installed ghc (8.2.1) on macOS 10.13.1 with current Xcode. I follow the guidelines at https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS and come to an error at step 5 where 
> 
> ./configure CC=arm-apple-darwin10-clang --target=arm-apple-darwin10; make
> 
> is being executed.
> 
> The error reads…
> 
> arm-apple-darwin10-clang -E  -DPROFILING -DTHREADED_RTS -DDEBUG  -fno-stack-protector -Wall  -Wall -Wextra -Wstrict-prototypes  -Wmissing-prototypes  -Wmissing-declarations -Winline -Waggregate-return -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls  -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -DUSE_LIBFFI_FOR_ADJUSTORS -fno-strict-aliasing -fno-common -Irts/dist/build/./autogen        -Wno-unknown-pragmas -O2 -fomit-frame-pointer -g -DRtsWay=\"rts_v\" -Wno-strict-prototypes      -MM -x c rts/linker/LoadArchive.c -MF rts/dist/build/.depend-v-l-debug-thr-thr_debug-thr_l.c_asm.bit
> clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
> rts/linker/LoadArchive.c:57:2: error: Unknown Darwin architecture
> #error Unknown Darwin architecture
>  ^
> 1 error generated.
> make[1]: *** [rts/dist/build/.depend-v-l-debug-thr-thr_debug-thr_l.c_asm] Error 1
> make: *** [all] Error 2
> 
> This stems from the following code in rts/linker/LoadArchive.c…
> 
> static StgBool loadFatArchive(char tmp[static 20], FILE* f, pathchar* path)
> {
>     uint32_t nfat_arch, nfat_offset, cputype, cpusubtype;
> #if defined(i386_HOST_ARCH)
>     const uint32_t mycputype = CPU_TYPE_X86;
>     const uint32_t mycpusubtype = CPU_SUBTYPE_X86_ALL;
> #elif defined(x86_64_HOST_ARCH)
>     const uint32_t mycputype = CPU_TYPE_X86_64;
>     const uint32_t mycpusubtype = CPU_SUBTYPE_X86_64_ALL;
> #elif defined(powerpc_HOST_ARCH)
>     const uint32_t mycputype = CPU_TYPE_POWERPC;
>     const uint32_t mycpusubtype = CPU_SUBTYPE_POWERPC_ALL;
> #elif defined(powerpc64_HOST_ARCH)
>     const uint32_t mycputype = CPU_TYPE_POWERPC64;
>     const uint32_t mycpusubtype = CPU_SUBTYPE_POWERPC_ALL;
> #elif defined(aarch64_HOST_ARCH)
>     const uint32_t mycputype = CPU_TYPE_ARM64;
>     const uint32_t mycpusubtype = CPU_SUBTYPE_ARM64_ALL;
> #else
> #error Unknown Darwin architecture
> #endif
> 
> It seems that the necessary architecture is not provided here?
> 
> Any help would be very much appreciated!
> 
> Thanks!
> 
> Torsten
> _______________________________________________
> iPhone mailing list
> iPhone at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/iphone



More information about the iPhone mailing list