As I discuss in this ticket, the Assembler available on the Mac OS X platform does not support AVX instructions, though the operating system/ platform does.
Clang, because it uses LLVM as a backend, supports AVX, and can generate AVX simd ops in the object code directly, or AVX assembly, or assemble assembly that uses AVX. Clang will select AVX instructions on SandyBridge or newer macs when given the -march=native flag.
There is another subtlety: the Apple Developer tools version of gcc 4.2 is old enough that it doesn't understand -march=native / doesn't support avx, and while newer versions of gcc (eg gcc 4.8), understand -march=native, and can choose -march=corei7-avx as appropriate (which corresponds to most new macs of the past 2 years), and while these newer gcc's can generate assembly that uses AVX instructions, these newer gcc's still seem to try to use the system assembler.
Now, one would think/hope that passing -pgma clang -pgmc clang to ghc would resolve this build problem, however, this does not seem to work,
though as documented in the related ticket,
calling clang directly with the flags that ghc would generate DOES work correctly,
(but calling clang by hand is no substitute for a compilation driver)
what *does* work is change the settings file that gets installed with ghc (for me this file is at /user/local/lib/ghc-7.6.2/settings) to have clang as the default ghc compiler rather than gcc. This makes the build work on the toy test case, but because of the clang cpp problem ticket, clang is not a viable default compiler setting for ghc as yet.
The fact that changing the settings file compiler from gcc -> clang worked,
but doing -pgma clang -pgmc clang does not, suggest either those flags are incorrectly implemented for OS X ghcs, or there is some switch that isn't toggled by the currently exposed compiler passes.
I can work around these corner cases, at the cost of some complexity in my build tooling, but the fact that the -pgma clang -pgmc clang bits didn't work, but changing the settings file did work (something that really isn't a good idea given how clang and ghc interact wrt c pre processor), suggests that some part of the build process for the c -> object code path in the ghc driver isn't being configured properly by the standard program flags, but is changed by the settings file.
So this suggests that semantically there is some bug in the driver, or a part of the build process that doesn't have a flag exposed yet, but which behaves different subject to change the compiler choice in the ghc settings file. This seems like a misfeature.
If you pass GHC the -v flag, then you can see what commands it's running, so you will be able to see the difference between using the -pgm* flags and changing the compiler in the settings file.
I suspect that what you're running into is that using a -pgmX flag empties the flag list for X, so you will need to use -optX flags to add any necessary flags again. This is deliberate, as the current flag list is designed for a different X, so you may not want to use these flags with the new X (the new X may not even support them).
If you still think there's a bug, please reopen and give more details about what's happening, and what you think should happen.
i get the following, with the relevant bit at the end when the c code gets compiled.
carter code/test » cabal clean ; cabal build -v3 1 ↵cleaning...Package has never been configured. Configuring with default flags. If thisfails, please run configure manually.searching for ghc in path.found ghc at /usr/local/bin/ghc("/usr/local/bin/ghc",["--numeric-version"])/usr/local/bin/ghc is version 7.6.2looking for tool "ghc-pkg" near compiler in /usr/local/binfound ghc-pkg in /usr/local/bin/ghc-pkg("/usr/local/bin/ghc-pkg",["--version"])/usr/local/bin/ghc-pkg is version 7.6.2("/usr/local/bin/ghc",["--supported-languages"])("/usr/local/bin/ghc",["--info"])Reading installed packages...("/usr/local/bin/ghc-pkg",["dump","--global","-v0"])("/usr/local/bin/ghc-pkg",["dump","--user","-v0"])("/usr/local/bin/ghc",["--print-libdir"])Reading available packages...Choosing modular solver.Resolving dependencies...[__0] trying: test-0.1.0.0 (user goal)[__1] trying: base-4.6.0.1/installed-251... (dependency of test-0.1.0.0)[__2] trying: rts-1.0/installedbuil... (dependency ofbase-4.6.0.1/installed-251...)[__3] trying: integer-gmp-0.5.0.0/installed-49d... (dependency ofbase-4.6.0.1/installed-251...)[__4] trying: ghc-prim-0.3.0.0/installed-bd1... (dependency ofbase-4.6.0.1/installed-251...)[__5] trying: vector-0.10.0.1/installed-04d... (dependency of test-0.1.0.0)[__6] trying: primitive-0.5.0.1/installed-4ec... (dependency ofvector-0.10.0.1/installed-04d...)[__7] trying: deepseq-1.3.0.1/installed-5a5... (dependency ofvector-0.10.0.1/installed-04d...)[__8] next goal: array (dependency of deepseq-1.3.0.1/installed-5a5...)[__8] trying: array-0.4.0.1/installed-bfd...[__9] doneUsing internal setup method with build-type Simple and args:["configure","--verbose=3","--builddir=dist","--ghc","--prefix=/Users/carter/Library/Haskell/","--bindir=$prefix/bin","--libdir=$prefix/lib","--libsubdir=$arch-$os-$compiler/$pkgid","--libexecdir=$prefix/libexec","--datadir=$prefix/share","--datasubdir=$arch-$os-$compiler/$pkgid","--docdir=$datadir/doc/$arch-$os-$compiler/$pkgid","--htmldir=$docdir/html","--haddockdir=$htmldir","--enable-library-profiling","--enable-shared","--enable-library-for-ghci","--user","--constraint=vector==0.10.0.1","--constraint=base==4.6.0.1","--disable-tests","--disable-benchmarks"]Configuring test-0.1.0.0...creating distsearching for ghc in path.found ghc at /usr/local/bin/ghc("/usr/local/bin/ghc",["--numeric-version"])/usr/local/bin/ghc is version 7.6.2looking for tool "ghc-pkg" near compiler in /usr/local/binfound ghc-pkg in /usr/local/bin/ghc-pkg("/usr/local/bin/ghc-pkg",["--version"])/usr/local/bin/ghc-pkg is version 7.6.2("/usr/local/bin/ghc",["--supported-languages"])("/usr/local/bin/ghc",["--info"])Reading installed packages...("/usr/local/bin/ghc-pkg",["dump","--global","-v0"])("/usr/local/bin/ghc-pkg",["dump","--user","-v0"])("/usr/local/bin/ghc",["--print-libdir"])Warning: The 'license-file' field refers to the file 'LICENSE' which does notexist.Dependency base ==4.6.0.1: using base-4.6.0.1Dependency vector ==0.10.0.1: using vector-0.10.0.1searching for alex in path.found alex at /Users/carter/Library/Haskell/bin/alex("/Users/carter/Library/Haskell/bin/alex",["--version"])/Users/carter/Library/Haskell/bin/alex is version 3.0.5searching for ar in path.found ar at /usr/bin/arsearching for c2hs in path.found c2hs at /Users/carter/Library/Haskell/bin/c2hs("/Users/carter/Library/Haskell/bin/c2hs",["--numeric-version"])/Users/carter/Library/Haskell/bin/c2hs is version 0.16.3searching for cpphs in path.found cpphs at /Users/carter/Library/Haskell/bin/cpphs("/Users/carter/Library/Haskell/bin/cpphs",["--version"])/Users/carter/Library/Haskell/bin/cpphs is version 1.16searching for ffihugs in path.Cannot find ffihugs on the pathsearching for gcc in path.found gcc at /usr/local/bin/gcc("/usr/local/bin/gcc",["-dumpversion"])/usr/local/bin/gcc is version 4.8.0searching for greencard in path.Cannot find greencard on the pathsearching for haddock in path.found haddock at /Users/carter/Library/Haskell/bin/haddock("/Users/carter/Library/Haskell/bin/haddock",["--version"])/Users/carter/Library/Haskell/bin/haddock is version 2.13.1searching for happy in path.found happy at /Users/carter/Library/Haskell/bin/happy("/Users/carter/Library/Haskell/bin/happy",["--version"])/Users/carter/Library/Haskell/bin/happy is version 1.18.10searching for hmake in path.Cannot find hmake on the pathsearching for hpc in path.found hpc at /usr/local/bin/hpc("/usr/local/bin/hpc",["version"])/usr/local/bin/hpc is version 0.6looking for tool "hsc2hs" near compiler in /usr/local/binfound hsc2hs in /usr/local/bin/hsc2hs("/usr/local/bin/hsc2hs",["--version"])/usr/local/bin/hsc2hs is version 0.67searching for HsColour in path.found HsColour at /Users/carter/Library/Haskell/bin/HsColour("/Users/carter/Library/Haskell/bin/HsColour",["-version"])/Users/carter/Library/Haskell/bin/HsColour is version 1.20searching for hugs in path.Cannot find hugs on the pathsearching for jhc in path.Cannot find jhc on the pathsearching for ld in path.found ld at /usr/bin/ld("/usr/local/bin/ghc",["-c","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13324.c","-o","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13324.o"])("/usr/bin/ld",["-x","-r","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13324.o","-o","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13325.o"])searching for lhc in path.Cannot find lhc on the pathsearching for lhc-pkg in path.Cannot find lhc-pkg on the pathsearching for nhc98 in path.Cannot find nhc98 on the pathsearching for pkg-config in path.found pkg-config at /usr/local/bin/pkg-config("/usr/local/bin/pkg-config",["--version"])/usr/local/bin/pkg-config is version 0.28searching for ranlib in path.found ranlib at /usr/bin/ranlibsearching for strip in path.found strip at /usr/bin/stripsearching for tar in path.found tar at /usr/bin/tarsearching for uhc in path.Cannot find uhc on the path("/usr/local/bin/ghc",["--info"])Using Cabal-1.17.0 compiled by ghc-7.6Using compiler: ghc-7.6.2Using install prefix: /Users/carter/Library/Haskell/Binaries installed in: /Users/carter/Library/Haskell//binLibraries installed in:/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/test-0.1.0.0Private binaries installed in: /Users/carter/Library/Haskell//libexecData files installed in:/Users/carter/Library/Haskell//share/x86_64-osx-ghc-7.6.2/test-0.1.0.0Documentation installed in:/Users/carter/Library/Haskell//share/doc/x86_64-osx-ghc-7.6.2/test-0.1.0.0Using alex version 3.0.5 found on system at:/Users/carter/Library/Haskell/bin/alexUsing ar found on system at: /usr/bin/arUsing c2hs version 0.16.3 found on system at:/Users/carter/Library/Haskell/bin/c2hsUsing cpphs version 1.16 found on system at:/Users/carter/Library/Haskell/bin/cpphsNo ffihugs foundUsing gcc version 4.8.0 found on system at: /usr/local/bin/gccUsing ghc version 7.6.2 found on system at: /usr/local/bin/ghcUsing ghc-pkg version 7.6.2 found on system at: /usr/local/bin/ghc-pkgNo greencard foundUsing haddock version 2.13.1 found on system at:/Users/carter/Library/Haskell/bin/haddockUsing happy version 1.18.10 found on system at:/Users/carter/Library/Haskell/bin/happyNo hmake foundUsing hpc version 0.6 found on system at: /usr/local/bin/hpcUsing hsc2hs version 0.67 found on system at: /usr/local/bin/hsc2hsUsing hscolour version 1.20 found on system at:/Users/carter/Library/Haskell/bin/HsColourNo hugs foundNo jhc foundUsing ld found on system at: /usr/bin/ldNo lhc foundNo lhc-pkg foundNo nhc98 foundUsing pkg-config version 0.28 found on system at: /usr/local/bin/pkg-configUsing ranlib found on system at: /usr/bin/ranlibUsing strip found on system at: /usr/bin/stripUsing tar found on system at: /usr/bin/tarNo uhc found("/usr/local/bin/gcc",["-m64","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13324.c","-o","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13324","-D__GLASGOW_HASKELL__=706","-Ddarwin_HOST_OS=1","-Dx86_64_HOST_ARCH=1","-Idist/build/autogen","-I.","-march=native","-O3","-I/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/vector-0.10.0.1/include","-I/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/primitive-0.5.0.1/include","-I/usr/local/lib/ghc-7.6.2/base-4.6.0.1/include","-I/usr/local/lib/ghc-7.6.2/include","-march=native","-O3","-L/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/vector-0.10.0.1","-L/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/primitive-0.5.0.1","-L/usr/local/lib/ghc-7.6.2/deepseq-1.3.0.1","-L/usr/local/lib/ghc-7.6.2/array-0.4.0.1","-L/usr/local/lib/ghc-7.6.2/base-4.6.0.1","-L/usr/local/lib/ghc-7.6.2/integer-gmp-0.5.0.0","-L/usr/local/lib/ghc-7.6.2/ghc-prim-0.3.0.0","-L/usr/local/lib/ghc-7.6.2"])Using internal setup method with build-type Simple and args:["build","--verbose=3","--builddir=dist"]Component build order: executable 'test'creating dist/buildcreating dist/build/autogenBuilding test-0.1.0.0...Preprocessing executable 'test' for test-0.1.0.0...Building executable test...creating dist/build/testcreating dist/build/test/test-tmp("/usr/local/bin/ghc",["--make","-no-link","-v","-fbuilding-cabal-package","-O","-static","-odir","dist/build/test/test-tmp","-hidir","dist/build/test/test-tmp","-stubdir","dist/build/test/test-tmp","-i","-idist/build/test/test-tmp","-isrc","-idist/build/autogen","-Idist/build/autogen","-Idist/build/test/test-tmp","-optP-include","-optPdist/build/autogen/cabal_macros.h","-hide-all-packages","-package-db","dist/package.conf.inplace","-package-id","base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29","-package-id","vector-0.10.0.1-04d4a4538e7c444d2821bb98877cda5f","-XHaskell2010","src/main.hs","-fllvm","-v","-pgma","clang","-pgmc","clang","-pgml","clang","-opta","-mavx","-opta","-march=native","-optc","-mavx","-optc","-march=native","-optc","-O2"])Glasgow Haskell Compiler, Version 7.6.2, stage 2 booted by GHC version 7.4.2Using binary package database: /usr/local/lib/ghc-7.6.2/package.conf.d/package.cacheUsing binary package database: /Users/carter/.ghc/x86_64-darwin-7.6.2/package.conf.d/package.cacheUsing package config file: dist/package.conf.inplacepackage Cabal-1.17.0-38434fa60f61a5b61574f6aba8367e79 is shadowed by package Cabal-1.17.0-b9e1bc8708d659bcedd2261fc5afabdcwired-in package ghc-prim mapped to ghc-prim-0.3.0.0-bd1d393903577692a5ef2aa7027b71f6wired-in package integer-gmp mapped to integer-gmp-0.5.0.0-49dcb29a60dab14e03e6dd01e871a242wired-in package base mapped to base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29wired-in package rts mapped to builtin_rtswired-in package template-haskell mapped to template-haskell-2.8.0.0-0ad833f8876aca146ee7fa686b5bc01awired-in package dph-seq not found.wired-in package dph-par not found.Hsc static flags: -static -static*** Chasing dependencies:Chasing modules from: *src/main.hsStable obj: []Stable BCO: []Ready for upsweep [NONREC ModSummary { ms_hs_date = 2013-05-21 18:00:15 UTC ms_mod = main:Main, ms_textual_imps = [import (implicit) Prelude, import qualified Data.Vector.Storable as S, import Foreign.C.Types, import Foreign (), import Foreign.Ptr, import qualified Data.Vector.Storable.Mutable as SM] ms_srcimps = [] }]*** Deleting temp files:Deleting: compile: input file src/main.hsCreated temporary directory: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0*** Checking old interface for main:Main:[1 of 1] Compiling Main ( src/main.hs, dist/build/test/test-tmp/Main.o )*** Parser:*** Renamer/typechecker:*** Desugar:Result size of Desugar (after optimization) = {terms: 140, types: 153, coercions: 26}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 168, types: 187, coercions: 45}Result size of Simplifier iteration=2 = {terms: 156, types: 191, coercions: 45}Result size of Simplifier iteration=3 = {terms: 152, types: 182, coercions: 45}Result size of Simplifier = {terms: 152, types: 182, coercions: 45}*** Specialise:Result size of Specialise = {terms: 152, types: 182, coercions: 45}*** Float out(FOS {Lam = Just 0, Consts = True, PAPs = False}):Result size of Float out(FOS {Lam = Just 0, Consts = True, PAPs = False}) = {terms: 194, types: 254, coercions: 45}*** Float inwards:Result size of Float inwards = {terms: 194, types: 254, coercions: 45}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 552, types: 698, coercions: 291}Result size of Simplifier iteration=2 = {terms: 338, types: 346, coercions: 69}Result size of Simplifier iteration=3 = {terms: 315, types: 309, coercions: 59}Result size of Simplifier iteration=4 = {terms: 315, types: 309, coercions: 59}Result size of Simplifier = {terms: 315, types: 309, coercions: 59}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 289, types: 278, coercions: 59}Result size of Simplifier = {terms: 289, types: 278, coercions: 59}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 301, types: 306, coercions: 115}Result size of Simplifier iteration=2 = {terms: 233, types: 226, coercions: 45}Result size of Simplifier = {terms: 233, types: 226, coercions: 45}*** Demand analysis:Result size of Demand analysis = {terms: 233, types: 226, coercions: 45}*** Worker Wrapper binds:Result size of Worker Wrapper binds = {terms: 233, types: 226, coercions: 45}*** Simplifier:Result size of Simplifier = {terms: 233, types: 226, coercions: 45}*** Float out(FOS {Lam = Just 0, Consts = True, PAPs = True}):Result size of Float out(FOS {Lam = Just 0, Consts = True, PAPs = True}) = {terms: 235, types: 228, coercions: 45}*** Common sub-expression:Result size of Common sub-expression = {terms: 235, types: 228, coercions: 45}*** Float inwards:Result size of Float inwards = {terms: 235, types: 228, coercions: 45}*** Simplifier:Result size of Simplifier = {terms: 235, types: 228, coercions: 45}*** Tidy Core:Result size of Tidy Core = {terms: 235, types: 228, coercions: 45}writeBinIface: 13 NameswriteBinIface: 62 dict entries*** CorePrep:Result size of CorePrep = {terms: 263, types: 254, coercions: 45}*** Stg2Stg:*** CodeOutput:*** CodeGen:*** LlVM CodeGen:You are using a new version of LLVM that hasn't been tested yet!We will try though...*** LLVM Optimiser:'opt' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.ll' '-o' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.bc' '-O1' '--enable-tbaa=true'*** LLVM Compiler:'llc' '-O2' '-relocation-model=pic' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.bc' '-o' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.lm_s' '--enable-tbaa=true'*** LlVM Mangler:*** Clang (Assembler):'clang' '-m64' '-Isrc' '-Idist/build/test/test-tmp' '-Idist/build/autogen' '-Idist/build/test/test-tmp' '-c' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.s' '-o' 'dist/build/test/test-tmp/Main.o'Upsweep completely successful.*** Deleting temp files:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.s /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.lm_s /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.bc /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.c /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.llWarning: deleting non-existent /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0/ghc13365_0.c*** Deleting temp files:Deleting: *** Deleting temp dirs:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13365_0Building C Sources...creating dist/build/test/test-tmp("/usr/local/bin/ghc",["-c","-v","-static","-odir","dist/build/test/test-tmp","-Idist/build/test/test-tmp","-optc-march=native","-optc-O3","-optc-O2","-package-db","dist/package.conf.inplace","-package-id","base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29","-package-id","vector-0.10.0.1-04d4a4538e7c444d2821bb98877cda5f","cbits/daft.c"])Glasgow Haskell Compiler, Version 7.6.2, stage 2 booted by GHC version 7.4.2Using binary package database: /usr/local/lib/ghc-7.6.2/package.conf.d/package.cacheUsing binary package database: /Users/carter/.ghc/x86_64-darwin-7.6.2/package.conf.d/package.cacheUsing package config file: dist/package.conf.inplacepackage Cabal-1.17.0-38434fa60f61a5b61574f6aba8367e79 is shadowed by package Cabal-1.17.0-b9e1bc8708d659bcedd2261fc5afabdchiding package hashable-1.1.2.5 to avoid conflict with later version hashable-1.2.0.5hiding package unordered-containers-0.2.3.0 to avoid conflict with later version unordered-containers-0.2.3.1wired-in package ghc-prim mapped to ghc-prim-0.3.0.0-bd1d393903577692a5ef2aa7027b71f6wired-in package integer-gmp mapped to integer-gmp-0.5.0.0-49dcb29a60dab14e03e6dd01e871a242wired-in package base mapped to base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29wired-in package rts mapped to builtin_rtswired-in package template-haskell mapped to template-haskell-2.8.0.0-0ad833f8876aca146ee7fa686b5bc01awired-in package dph-seq not found.wired-in package dph-par not found.Hsc static flags: -static -staticCreated temporary directory: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0*** C Compiler:'gcc' '-m64' '-fno-stack-protector' '-m64' '-x' 'c' 'cbits/daft.c' '-o' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0/ghc13373_0.s' '-fno-common' '-U __PIC__' '-D__PIC__' '-Wimplicit' '-S' '-O' '-D__GLASGOW_HASKELL__=706' '-DTABLES_NEXT_TO_CODE' '-march=native' '-O3' '-O2' '-I' 'dist/build/test/test-tmp' '-I' '/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/vector-0.10.0.1/include' '-I' '/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/primitive-0.5.0.1/include' '-I' '/usr/local/lib/ghc-7.6.2/base-4.6.0.1/include' '-I' '/usr/local/lib/ghc-7.6.2/include'*** Assembler:'gcc' '-m64' '-fno-stack-protector' '-m64' '-Idist/build/test/test-tmp' '-c' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0/ghc13373_0.s' '-o' 'dist/build/test/test-tmp/cbits/daft.o'/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0/ghc13373_0.s:6:0: no such instruction: `vmovupd (%rdi), %xmm0'/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0/ghc13373_0.s:7:0: no such instruction: `vaddpd %xmm0, %xmm0,%xmm0'/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0/ghc13373_0.s:8:0: no such instruction: `vmovupd %xmm0, (%rsi)'*** Deleting temp files:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0/ghc13373_0.s*** Deleting temp dirs:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13373_0/usr/local/bin/ghc returned ExitFailure 1
in contrast, when I change the ghc settings file to point to clang rather than gcc
i get the following (successful) build output trace
carter code/test » cabal clean ; cabal build -v3cleaning...Package has never been configured. Configuring with default flags. If thisfails, please run configure manually.searching for ghc in path.found ghc at /usr/local/bin/ghc("/usr/local/bin/ghc",["--numeric-version"])/usr/local/bin/ghc is version 7.6.2looking for tool "ghc-pkg" near compiler in /usr/local/binfound ghc-pkg in /usr/local/bin/ghc-pkg("/usr/local/bin/ghc-pkg",["--version"])/usr/local/bin/ghc-pkg is version 7.6.2("/usr/local/bin/ghc",["--supported-languages"])("/usr/local/bin/ghc",["--info"])Reading installed packages...("/usr/local/bin/ghc-pkg",["dump","--global","-v0"])("/usr/local/bin/ghc-pkg",["dump","--user","-v0"])("/usr/local/bin/ghc",["--print-libdir"])Reading available packages...Choosing modular solver.Resolving dependencies...[__0] trying: test-0.1.0.0 (user goal)[__1] trying: base-4.6.0.1/installed-251... (dependency of test-0.1.0.0)[__2] trying: rts-1.0/installedbuil... (dependency ofbase-4.6.0.1/installed-251...)[__3] trying: integer-gmp-0.5.0.0/installed-49d... (dependency ofbase-4.6.0.1/installed-251...)[__4] trying: ghc-prim-0.3.0.0/installed-bd1... (dependency ofbase-4.6.0.1/installed-251...)[__5] trying: vector-0.10.0.1/installed-04d... (dependency of test-0.1.0.0)[__6] trying: primitive-0.5.0.1/installed-4ec... (dependency ofvector-0.10.0.1/installed-04d...)[__7] trying: deepseq-1.3.0.1/installed-5a5... (dependency ofvector-0.10.0.1/installed-04d...)[__8] next goal: array (dependency of deepseq-1.3.0.1/installed-5a5...)[__8] trying: array-0.4.0.1/installed-bfd...[__9] doneUsing internal setup method with build-type Simple and args:["configure","--verbose=3","--builddir=dist","--ghc","--prefix=/Users/carter/Library/Haskell/","--bindir=$prefix/bin","--libdir=$prefix/lib","--libsubdir=$arch-$os-$compiler/$pkgid","--libexecdir=$prefix/libexec","--datadir=$prefix/share","--datasubdir=$arch-$os-$compiler/$pkgid","--docdir=$datadir/doc/$arch-$os-$compiler/$pkgid","--htmldir=$docdir/html","--haddockdir=$htmldir","--enable-library-profiling","--enable-shared","--enable-library-for-ghci","--user","--constraint=vector==0.10.0.1","--constraint=base==4.6.0.1","--disable-tests","--disable-benchmarks"]Configuring test-0.1.0.0...creating distsearching for ghc in path.found ghc at /usr/local/bin/ghc("/usr/local/bin/ghc",["--numeric-version"])/usr/local/bin/ghc is version 7.6.2looking for tool "ghc-pkg" near compiler in /usr/local/binfound ghc-pkg in /usr/local/bin/ghc-pkg("/usr/local/bin/ghc-pkg",["--version"])/usr/local/bin/ghc-pkg is version 7.6.2("/usr/local/bin/ghc",["--supported-languages"])("/usr/local/bin/ghc",["--info"])Reading installed packages...("/usr/local/bin/ghc-pkg",["dump","--global","-v0"])("/usr/local/bin/ghc-pkg",["dump","--user","-v0"])("/usr/local/bin/ghc",["--print-libdir"])Warning: The 'license-file' field refers to the file 'LICENSE' which does notexist.Dependency base ==4.6.0.1: using base-4.6.0.1Dependency vector ==0.10.0.1: using vector-0.10.0.1searching for alex in path.found alex at /Users/carter/Library/Haskell/bin/alex("/Users/carter/Library/Haskell/bin/alex",["--version"])/Users/carter/Library/Haskell/bin/alex is version 3.0.5searching for ar in path.found ar at /usr/bin/arsearching for c2hs in path.found c2hs at /Users/carter/Library/Haskell/bin/c2hs("/Users/carter/Library/Haskell/bin/c2hs",["--numeric-version"])/Users/carter/Library/Haskell/bin/c2hs is version 0.16.3searching for cpphs in path.found cpphs at /Users/carter/Library/Haskell/bin/cpphs("/Users/carter/Library/Haskell/bin/cpphs",["--version"])/Users/carter/Library/Haskell/bin/cpphs is version 1.16searching for ffihugs in path.Cannot find ffihugs on the pathsearching for gcc in path.found gcc at /usr/local/bin/gcc("/usr/local/bin/gcc",["-dumpversion"])/usr/local/bin/gcc is version 4.8.0searching for greencard in path.Cannot find greencard on the pathsearching for haddock in path.found haddock at /Users/carter/Library/Haskell/bin/haddock("/Users/carter/Library/Haskell/bin/haddock",["--version"])/Users/carter/Library/Haskell/bin/haddock is version 2.13.1searching for happy in path.found happy at /Users/carter/Library/Haskell/bin/happy("/Users/carter/Library/Haskell/bin/happy",["--version"])/Users/carter/Library/Haskell/bin/happy is version 1.18.10searching for hmake in path.Cannot find hmake on the pathsearching for hpc in path.found hpc at /usr/local/bin/hpc("/usr/local/bin/hpc",["version"])/usr/local/bin/hpc is version 0.6looking for tool "hsc2hs" near compiler in /usr/local/binfound hsc2hs in /usr/local/bin/hsc2hs("/usr/local/bin/hsc2hs",["--version"])/usr/local/bin/hsc2hs is version 0.67searching for HsColour in path.found HsColour at /Users/carter/Library/Haskell/bin/HsColour("/Users/carter/Library/Haskell/bin/HsColour",["-version"])/Users/carter/Library/Haskell/bin/HsColour is version 1.20searching for hugs in path.Cannot find hugs on the pathsearching for jhc in path.Cannot find jhc on the pathsearching for ld in path.found ld at /usr/bin/ld("/usr/local/bin/ghc",["-c","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13405.c","-o","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13405.o"])/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13405.c:1:12: warning: control reaches end of non-void function [-Wreturn-type]int foo() {} ^1 warning generated.("/usr/bin/ld",["-x","-r","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13405.o","-o","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13406.o"])searching for lhc in path.Cannot find lhc on the pathsearching for lhc-pkg in path.Cannot find lhc-pkg on the pathsearching for nhc98 in path.Cannot find nhc98 on the pathsearching for pkg-config in path.found pkg-config at /usr/local/bin/pkg-config("/usr/local/bin/pkg-config",["--version"])/usr/local/bin/pkg-config is version 0.28searching for ranlib in path.found ranlib at /usr/bin/ranlibsearching for strip in path.found strip at /usr/bin/stripsearching for tar in path.found tar at /usr/bin/tarsearching for uhc in path.Cannot find uhc on the path("/usr/local/bin/ghc",["--info"])Using Cabal-1.17.0 compiled by ghc-7.6Using compiler: ghc-7.6.2Using install prefix: /Users/carter/Library/Haskell/Binaries installed in: /Users/carter/Library/Haskell//binLibraries installed in:/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/test-0.1.0.0Private binaries installed in: /Users/carter/Library/Haskell//libexecData files installed in:/Users/carter/Library/Haskell//share/x86_64-osx-ghc-7.6.2/test-0.1.0.0Documentation installed in:/Users/carter/Library/Haskell//share/doc/x86_64-osx-ghc-7.6.2/test-0.1.0.0Using alex version 3.0.5 found on system at:/Users/carter/Library/Haskell/bin/alexUsing ar found on system at: /usr/bin/arUsing c2hs version 0.16.3 found on system at:/Users/carter/Library/Haskell/bin/c2hsUsing cpphs version 1.16 found on system at:/Users/carter/Library/Haskell/bin/cpphsNo ffihugs foundUsing gcc version 4.8.0 found on system at: /usr/local/bin/gccUsing ghc version 7.6.2 found on system at: /usr/local/bin/ghcUsing ghc-pkg version 7.6.2 found on system at: /usr/local/bin/ghc-pkgNo greencard foundUsing haddock version 2.13.1 found on system at:/Users/carter/Library/Haskell/bin/haddockUsing happy version 1.18.10 found on system at:/Users/carter/Library/Haskell/bin/happyNo hmake foundUsing hpc version 0.6 found on system at: /usr/local/bin/hpcUsing hsc2hs version 0.67 found on system at: /usr/local/bin/hsc2hsUsing hscolour version 1.20 found on system at:/Users/carter/Library/Haskell/bin/HsColourNo hugs foundNo jhc foundUsing ld found on system at: /usr/bin/ldNo lhc foundNo lhc-pkg foundNo nhc98 foundUsing pkg-config version 0.28 found on system at: /usr/local/bin/pkg-configUsing ranlib found on system at: /usr/bin/ranlibUsing strip found on system at: /usr/bin/stripUsing tar found on system at: /usr/bin/tarNo uhc found("/usr/local/bin/gcc",["-m64","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13405.c","-o","/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/13405","-D__GLASGOW_HASKELL__=706","-Ddarwin_HOST_OS=1","-Dx86_64_HOST_ARCH=1","-Idist/build/autogen","-I.","-march=native","-O3","-I/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/vector-0.10.0.1/include","-I/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/primitive-0.5.0.1/include","-I/usr/local/lib/ghc-7.6.2/base-4.6.0.1/include","-I/usr/local/lib/ghc-7.6.2/include","-march=native","-O3","-L/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/vector-0.10.0.1","-L/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/primitive-0.5.0.1","-L/usr/local/lib/ghc-7.6.2/deepseq-1.3.0.1","-L/usr/local/lib/ghc-7.6.2/array-0.4.0.1","-L/usr/local/lib/ghc-7.6.2/base-4.6.0.1","-L/usr/local/lib/ghc-7.6.2/integer-gmp-0.5.0.0","-L/usr/local/lib/ghc-7.6.2/ghc-prim-0.3.0.0","-L/usr/local/lib/ghc-7.6.2"])Using internal setup method with build-type Simple and args:["build","--verbose=3","--builddir=dist"]Component build order: executable 'test'creating dist/buildcreating dist/build/autogenBuilding test-0.1.0.0...Preprocessing executable 'test' for test-0.1.0.0...Building executable test...creating dist/build/testcreating dist/build/test/test-tmp("/usr/local/bin/ghc",["--make","-no-link","-v","-fbuilding-cabal-package","-O","-static","-odir","dist/build/test/test-tmp","-hidir","dist/build/test/test-tmp","-stubdir","dist/build/test/test-tmp","-i","-idist/build/test/test-tmp","-isrc","-idist/build/autogen","-Idist/build/autogen","-Idist/build/test/test-tmp","-optP-include","-optPdist/build/autogen/cabal_macros.h","-hide-all-packages","-package-db","dist/package.conf.inplace","-package-id","base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29","-package-id","vector-0.10.0.1-04d4a4538e7c444d2821bb98877cda5f","-XHaskell2010","src/main.hs","-fllvm","-v","-pgma","clang","-pgmc","clang","-pgml","clang","-opta","-mavx","-opta","-march=native","-optc","-mavx","-optc","-march=native","-optc","-O2"])Glasgow Haskell Compiler, Version 7.6.2, stage 2 booted by GHC version 7.4.2Using binary package database: /usr/local/lib/ghc-7.6.2/package.conf.d/package.cacheUsing binary package database: /Users/carter/.ghc/x86_64-darwin-7.6.2/package.conf.d/package.cacheUsing package config file: dist/package.conf.inplacepackage Cabal-1.17.0-38434fa60f61a5b61574f6aba8367e79 is shadowed by package Cabal-1.17.0-b9e1bc8708d659bcedd2261fc5afabdcwired-in package ghc-prim mapped to ghc-prim-0.3.0.0-bd1d393903577692a5ef2aa7027b71f6wired-in package integer-gmp mapped to integer-gmp-0.5.0.0-49dcb29a60dab14e03e6dd01e871a242wired-in package base mapped to base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29wired-in package rts mapped to builtin_rtswired-in package template-haskell mapped to template-haskell-2.8.0.0-0ad833f8876aca146ee7fa686b5bc01awired-in package dph-seq not found.wired-in package dph-par not found.Hsc static flags: -static -static*** Chasing dependencies:Chasing modules from: *src/main.hsStable obj: []Stable BCO: []Ready for upsweep [NONREC ModSummary { ms_hs_date = 2013-05-21 18:00:15 UTC ms_mod = main:Main, ms_textual_imps = [import (implicit) Prelude, import qualified Data.Vector.Storable as S, import Foreign.C.Types, import Foreign (), import Foreign.Ptr, import qualified Data.Vector.Storable.Mutable as SM] ms_srcimps = [] }]*** Deleting temp files:Deleting: compile: input file src/main.hsCreated temporary directory: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0*** Checking old interface for main:Main:[1 of 1] Compiling Main ( src/main.hs, dist/build/test/test-tmp/Main.o )*** Parser:*** Renamer/typechecker:*** Desugar:Result size of Desugar (after optimization) = {terms: 140, types: 153, coercions: 26}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 168, types: 187, coercions: 45}Result size of Simplifier iteration=2 = {terms: 156, types: 191, coercions: 45}Result size of Simplifier iteration=3 = {terms: 152, types: 182, coercions: 45}Result size of Simplifier = {terms: 152, types: 182, coercions: 45}*** Specialise:Result size of Specialise = {terms: 152, types: 182, coercions: 45}*** Float out(FOS {Lam = Just 0, Consts = True, PAPs = False}):Result size of Float out(FOS {Lam = Just 0, Consts = True, PAPs = False}) = {terms: 194, types: 254, coercions: 45}*** Float inwards:Result size of Float inwards = {terms: 194, types: 254, coercions: 45}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 552, types: 698, coercions: 291}Result size of Simplifier iteration=2 = {terms: 338, types: 346, coercions: 69}Result size of Simplifier iteration=3 = {terms: 315, types: 309, coercions: 59}Result size of Simplifier iteration=4 = {terms: 315, types: 309, coercions: 59}Result size of Simplifier = {terms: 315, types: 309, coercions: 59}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 289, types: 278, coercions: 59}Result size of Simplifier = {terms: 289, types: 278, coercions: 59}*** Simplifier:Result size of Simplifier iteration=1 = {terms: 301, types: 306, coercions: 115}Result size of Simplifier iteration=2 = {terms: 233, types: 226, coercions: 45}Result size of Simplifier = {terms: 233, types: 226, coercions: 45}*** Demand analysis:Result size of Demand analysis = {terms: 233, types: 226, coercions: 45}*** Worker Wrapper binds:Result size of Worker Wrapper binds = {terms: 233, types: 226, coercions: 45}*** Simplifier:Result size of Simplifier = {terms: 233, types: 226, coercions: 45}*** Float out(FOS {Lam = Just 0, Consts = True, PAPs = True}):Result size of Float out(FOS {Lam = Just 0, Consts = True, PAPs = True}) = {terms: 235, types: 228, coercions: 45}*** Common sub-expression:Result size of Common sub-expression = {terms: 235, types: 228, coercions: 45}*** Float inwards:Result size of Float inwards = {terms: 235, types: 228, coercions: 45}*** Simplifier:Result size of Simplifier = {terms: 235, types: 228, coercions: 45}*** Tidy Core:Result size of Tidy Core = {terms: 235, types: 228, coercions: 45}writeBinIface: 13 NameswriteBinIface: 62 dict entries*** CorePrep:Result size of CorePrep = {terms: 263, types: 254, coercions: 45}*** Stg2Stg:*** CodeOutput:*** CodeGen:*** LlVM CodeGen:You are using a new version of LLVM that hasn't been tested yet!We will try though...*** LLVM Optimiser:'opt' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.ll' '-o' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.bc' '-O1' '--enable-tbaa=true'*** LLVM Compiler:'llc' '-O2' '-relocation-model=pic' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.bc' '-o' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.lm_s' '--enable-tbaa=true'*** LlVM Mangler:*** Clang (Assembler):'clang' '-m64' '-Isrc' '-Idist/build/test/test-tmp' '-Idist/build/autogen' '-Idist/build/test/test-tmp' '-c' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.s' '-o' 'dist/build/test/test-tmp/Main.o'Upsweep completely successful.*** Deleting temp files:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.s /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.lm_s /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.bc /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.c /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.llWarning: deleting non-existent /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0/ghc13446_0.c*** Deleting temp files:Deleting: *** Deleting temp dirs:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13446_0Building C Sources...creating dist/build/test/test-tmp("/usr/local/bin/ghc",["-c","-v","-static","-odir","dist/build/test/test-tmp","-Idist/build/test/test-tmp","-optc-march=native","-optc-O3","-optc-O2","-package-db","dist/package.conf.inplace","-package-id","base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29","-package-id","vector-0.10.0.1-04d4a4538e7c444d2821bb98877cda5f","cbits/daft.c"])Glasgow Haskell Compiler, Version 7.6.2, stage 2 booted by GHC version 7.4.2Using binary package database: /usr/local/lib/ghc-7.6.2/package.conf.d/package.cacheUsing binary package database: /Users/carter/.ghc/x86_64-darwin-7.6.2/package.conf.d/package.cacheUsing package config file: dist/package.conf.inplacepackage Cabal-1.17.0-38434fa60f61a5b61574f6aba8367e79 is shadowed by package Cabal-1.17.0-b9e1bc8708d659bcedd2261fc5afabdchiding package hashable-1.1.2.5 to avoid conflict with later version hashable-1.2.0.5hiding package unordered-containers-0.2.3.0 to avoid conflict with later version unordered-containers-0.2.3.1wired-in package ghc-prim mapped to ghc-prim-0.3.0.0-bd1d393903577692a5ef2aa7027b71f6wired-in package integer-gmp mapped to integer-gmp-0.5.0.0-49dcb29a60dab14e03e6dd01e871a242wired-in package base mapped to base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29wired-in package rts mapped to builtin_rtswired-in package template-haskell mapped to template-haskell-2.8.0.0-0ad833f8876aca146ee7fa686b5bc01awired-in package dph-seq not found.wired-in package dph-par not found.Hsc static flags: -static -staticCreated temporary directory: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13454_0*** C Compiler:'clang' '-m64' '-fno-stack-protector' '-m64' '-x' 'c' 'cbits/daft.c' '-o' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13454_0/ghc13454_0.s' '-fno-common' '-U __PIC__' '-D__PIC__' '-Wimplicit' '-S' '-O' '-D__GLASGOW_HASKELL__=706' '-DTABLES_NEXT_TO_CODE' '-march=native' '-O3' '-O2' '-I' 'dist/build/test/test-tmp' '-I' '/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/vector-0.10.0.1/include' '-I' '/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/primitive-0.5.0.1/include' '-I' '/usr/local/lib/ghc-7.6.2/base-4.6.0.1/include' '-I' '/usr/local/lib/ghc-7.6.2/include'*** Assembler:'clang' '-m64' '-fno-stack-protector' '-m64' '-Idist/build/test/test-tmp' '-c' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13454_0/ghc13454_0.s' '-o' 'dist/build/test/test-tmp/cbits/daft.o'*** Deleting temp files:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13454_0/ghc13454_0.s*** Deleting temp dirs:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13454_0Linking...("/usr/local/bin/ghc",["--make","-v","-fbuilding-cabal-package","-O","-static","-odir","dist/build/test/test-tmp","-hidir","dist/build/test/test-tmp","-stubdir","dist/build/test/test-tmp","-i","-idist/build/test/test-tmp","-isrc","-idist/build/autogen","-Idist/build/autogen","-Idist/build/test/test-tmp","-optP-include","-optPdist/build/autogen/cabal_macros.h","-hide-all-packages","-package-db","dist/package.conf.inplace","-package-id","base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29","-package-id","vector-0.10.0.1-04d4a4538e7c444d2821bb98877cda5f","-XHaskell2010","src/main.hs","dist/build/test/test-tmp/cbits/daft.o","-o","dist/build/test/test","-fllvm","-v","-pgma","clang","-pgmc","clang","-pgml","clang","-opta","-mavx","-opta","-march=native","-optc","-mavx","-optc","-march=native","-optc","-O2"])Glasgow Haskell Compiler, Version 7.6.2, stage 2 booted by GHC version 7.4.2Using binary package database: /usr/local/lib/ghc-7.6.2/package.conf.d/package.cacheUsing binary package database: /Users/carter/.ghc/x86_64-darwin-7.6.2/package.conf.d/package.cacheUsing package config file: dist/package.conf.inplacepackage Cabal-1.17.0-38434fa60f61a5b61574f6aba8367e79 is shadowed by package Cabal-1.17.0-b9e1bc8708d659bcedd2261fc5afabdcwired-in package ghc-prim mapped to ghc-prim-0.3.0.0-bd1d393903577692a5ef2aa7027b71f6wired-in package integer-gmp mapped to integer-gmp-0.5.0.0-49dcb29a60dab14e03e6dd01e871a242wired-in package base mapped to base-4.6.0.1-2514ecbfe6573e639515d3e91d6e1f29wired-in package rts mapped to builtin_rtswired-in package template-haskell mapped to template-haskell-2.8.0.0-0ad833f8876aca146ee7fa686b5bc01awired-in package dph-seq not found.wired-in package dph-par not found.Hsc static flags: -static -static*** Chasing dependencies:Chasing modules from: *src/main.hsStable obj: [Main]Stable BCO: []Ready for upsweep [NONREC ModSummary { ms_hs_date = 2013-05-21 18:00:15 UTC ms_mod = main:Main, ms_textual_imps = [import (implicit) Prelude, import qualified Data.Vector.Storable as S, import Foreign.C.Types, import Foreign (), import Foreign.Ptr, import qualified Data.Vector.Storable.Mutable as SM] ms_srcimps = [] }]*** Deleting temp files:Deleting: compile: input file src/main.hsCreated temporary directory: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0*** Checking old interface for main:Main:[1 of 1] Skipping Main ( src/main.hs, dist/build/test/test-tmp/Main.o )Upsweep completely successful.*** Deleting temp files:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0/ghc13460_0.llWarning: deleting non-existent /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0/ghc13460_0.lllink: linkables are ...LinkableM (2013-05-26 03:40:55 UTC) main:Main [DotO dist/build/test/test-tmp/Main.o]Linking dist/build/test/test ...*** C Compiler:'clang' '-c' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0/ghc13460_0.c' '-o' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0/ghc13460_0.o' '-DTABLES_NEXT_TO_CODE' '-mavx' '-march=native' '-O2' '-I/usr/local/lib/ghc-7.6.2/include'*** Linker:'clang' '-o' 'dist/build/test/test' '-Wl,-no_compact_unwind' 'dist/build/test/test-tmp/Main.o' 'dist/build/test/test-tmp/cbits/daft.o' '-L/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/vector-0.10.0.1' '-L/Users/carter/Library/Haskell//lib/x86_64-osx-ghc-7.6.2/primitive-0.5.0.1' '-L/usr/local/lib/ghc-7.6.2/deepseq-1.3.0.1' '-L/usr/local/lib/ghc-7.6.2/array-0.4.0.1' '-L/usr/local/lib/ghc-7.6.2/base-4.6.0.1' '-L/usr/local/lib/ghc-7.6.2/integer-gmp-0.5.0.0' '-L/usr/local/lib/ghc-7.6.2/ghc-prim-0.3.0.0' '-L/usr/local/lib/ghc-7.6.2' '/var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0/ghc13460_0.o' '-lHSvector-0.10.0.1' '-lHSprimitive-0.5.0.1' '-lHSdeepseq-1.3.0.1' '-lHSarray-0.4.0.1' '-lHSbase-4.6.0.1' '-liconv' '-lHSinteger-gmp-0.5.0.0' '-lHSghc-prim-0.3.0.0' '-lHSrts' '-lm' '-ldl' '-u' '_ghczmprim_GHCziTypes_Izh_static_info' '-u' '_ghczmprim_GHCziTypes_Czh_static_info' '-u' '_ghczmprim_GHCziTypes_Fzh_static_info' '-u' '_ghczmprim_GHCziTypes_Dzh_static_info' '-u' '_base_GHCziPtr_Ptr_static_info' '-u' '_ghczmprim_GHCziTypes_Wzh_static_info' '-u' '_base_GHCziInt_I8zh_static_info' '-u' '_base_GHCziInt_I16zh_static_info' '-u' '_base_GHCziInt_I32zh_static_info' '-u' '_base_GHCziInt_I64zh_static_info' '-u' '_base_GHCziWord_W8zh_static_info' '-u' '_base_GHCziWord_W16zh_static_info' '-u' '_base_GHCziWord_W32zh_static_info' '-u' '_base_GHCziWord_W64zh_static_info' '-u' '_base_GHCziStable_StablePtr_static_info' '-u' '_ghczmprim_GHCziTypes_Izh_con_info' '-u' '_ghczmprim_GHCziTypes_Czh_con_info' '-u' '_ghczmprim_GHCziTypes_Fzh_con_info' '-u' '_ghczmprim_GHCziTypes_Dzh_con_info' '-u' '_base_GHCziPtr_Ptr_con_info' '-u' '_base_GHCziPtr_FunPtr_con_info' '-u' '_base_GHCziStable_StablePtr_con_info' '-u' '_ghczmprim_GHCziTypes_False_closure' '-u' '_ghczmprim_GHCziTypes_True_closure' '-u' '_base_GHCziPack_unpackCString_closure' '-u' '_base_GHCziIOziException_stackOverflow_closure' '-u' '_base_GHCziIOziException_heapOverflow_closure' '-u' '_base_ControlziExceptionziBase_nonTermination_closure' '-u' '_base_GHCziIOziException_blockedIndefinitelyOnMVar_closure' '-u' '_base_GHCziIOziException_blockedIndefinitelyOnSTM_closure' '-u' '_base_ControlziExceptionziBase_nestedAtomically_closure' '-u' '_base_GHCziWeak_runFinalizzerBatch_closure' '-u' '_base_GHCziTopHandler_flushStdHandles_closure' '-u' '_base_GHCziTopHandler_runIO_closure' '-u' '_base_GHCziTopHandler_runNonIO_closure' '-u' '_base_GHCziConcziIO_ensureIOManagerIsRunning_closure' '-u' '_base_GHCziConcziSync_runSparks_closure' '-u' '_base_GHCziConcziSignal_runHandlers_closure' '-Wl,-search_paths_first'link: done*** Deleting temp files:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0/ghc13460_0.o /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0/ghc13460_0.c*** Deleting temp dirs:Deleting: /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/ghc13460_0
Aha, thanks for your diagnosis work. However, it looks like the problem here is either a Cabal bug, or a problem in your .cabal file. The output shows that Cabal is calling ghc like this: