[Haskell-iPhone] cabal arch function

Stefan Kersten sk at k-hornz.de
Tue Dec 18 18:03:15 CET 2012


hi again,

i am trying to compile the primitive library, which includes the following in its cabal file:

  if arch(i386) || arch(x86_64) {
    cc-options: -msse2
  }

during configuration the arm cross compiler (rightly) complains about the unsupported -msse2 option (see below). but why is that option even added to cc-options? shouldn't arch be arm or something similar when cross-compiling?

the cabal docs are saying:

"arch(name)
Tests if the current architecture is name. The argument is matched against System.Info.arch on the target system. If the arch names match, this test evaluates to true, otherwise false. The match is case-insensitive."

any help appreciated!

thanks,
<sk>

runOutput /Users/skersten/dev/samplecount/ghc-ios/bin/arm-apple-darwin10-gcc ["-fno-stack-protector","-isysroot","/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk","-march=armv7","-mcpu=cortex-a8","-mfpu=neon","-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/","/var/folders/O8/O8mOkxWPErOOmiDsQeAl2E+++TI/-Tmp-/92247.c","-o","/var/folders/O8/O8mOkxWPErOOmiDsQeAl2E+++TI/-Tmp-/92247","-D__GLASGOW_HASKELL__=705","-Ddarwin_HOST_OS=1","-Dx86_64_HOST_ARCH=1","-Idist/build/autogen","-Icbits","-I.","-msse2","-O3","-ftree-vectorize","-fomit-frame-pointer","-I/usr/local/ghc-iphone//lib/ghc-7.5.20121127/base-4.5.0.0/include","-I/usr/local/ghc-iphone//lib/ghc-7.5.20121127/include","-msse2","-O3","-ftree-vectorize","-fomit-frame-pointer","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127/base-4.5.0.0","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127/integer-simple-0.1.0.0","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127/ghc-prim-0.2.0.0","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127"]
("/Users/skersten/dev/samplecount/ghc-ios/bin/arm-apple-darwin10-gcc",["-fno-stack-protector","-isysroot","/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk","-march=armv7","-mcpu=cortex-a8","-mfpu=neon","-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/","/var/folders/O8/O8mOkxWPErOOmiDsQeAl2E+++TI/-Tmp-/92247.c","-o","/var/folders/O8/O8mOkxWPErOOmiDsQeAl2E+++TI/-Tmp-/92247","-D__GLASGOW_HASKELL__=705","-Ddarwin_HOST_OS=1","-Dx86_64_HOST_ARCH=1","-Idist/build/autogen","-Icbits","-I.","-msse2","-O3","-ftree-vectorize","-fomit-frame-pointer","-I/usr/local/ghc-iphone//lib/ghc-7.5.20121127/base-4.5.0.0/include","-I/usr/local/ghc-iphone//lib/ghc-7.5.20121127/include","-msse2","-O3","-ftree-vectorize","-fomit-frame-pointer","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127/base-4.5.0.0","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127/integer-simple-0.1.0.0","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127/ghc-prim-0.2.0.0","-L/usr/local/ghc-iphone//lib/ghc-7.5.20121127"])
/Users/skersten/dev/samplecount/ghc-ios/bin/arm-apple-darwin10-gcc returned
ExitFailure 1 with error message:
cc1: error: unrecognized command line option "-msse2"
cc1: error: unrecognized command line option "-msse2"
program: int main(int argc, char** argv) { return 0; }




More information about the iPhone mailing list