[GHC] #8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------+---------------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: clang | Operating System: MacOS X Architecture: | Type of failure: Building GHC failed Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | ----------------------------------+---------------------------------------- I'm using GHC 7.6.3 with clang/wrapper (setting is modified). This GHC cannot build GHC head with integer-gmp: {{{ checking for assembler byte directive... .byte checking how to define a 32-bit word... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: can't open file: conftest.o (No such file or directory) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: can't open file: conftest.o (No such file or directory) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: can't open file: conftest.o (No such file or directory) configure: error: cannot determine how to define a 32-bit word make[1]: *** [libraries/integer-gmp/gmp/gmp.h] Error 1 make: *** [all] Error 2 }}} With integer-simple, build is OK. For more information, please see http://d.hatena.ne.jp/kazu- yamamoto/20131028/1382921924 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by hvr): could you please attach the resulting `libraries/integer-gmp/config.log` log file to this ticket? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by kazu-yamamoto): Attached. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by hvr): Ah, now I see.. that error is generated by the GMP source code included in the tarball; could you try installing a GMP library (or is that called Framework in OSX?) in your Xcode environment, so GHC doesn't have to compile its own GMP library? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by kazu-yamamoto): I installed GMP by MacPorts and did: {{{ % ./configure --prefix=/ghc-head --with-gmp-includes=/opt/local/include --with-gmp-libraries=/opt/local/lib % make }}} I got the following error this time: {{{ inplace/bin/dll-split compiler/stage2/build/.depend-v-p-dyn.haskell "DynFlags" " Annotations Avail Bag BasicTypes BinIface Binary Bitmap BlockId BooleanFormula B reakArray BufWrite BuildTyCl ByteCodeAsm ByteCodeInstr ByteCodeItbls CLabel Clas s CmdLineParser Cmm CmmCallConv CmmExpr CmmInfo CmmMachOp CmmNode CmmType CmmUti ls CoAxiom CodeGen.Platform CodeGen.Platform.ARM CodeGen.Platform.NoRegs CodeGen .Platform.PPC CodeGen.Platform.PPC_Darwin CodeGen.Platform.SPARC CodeGen.Platfor m.X86 CodeGen.Platform.X86_64 Coercion Config Constants CoreArity CoreFVs CoreLi nt CoreSubst CoreSyn CoreTidy CoreUnfold CoreUtils CostCentre DataCon Demand Dig raph DriverPhases DsMonad DynFlags Encoding ErrUtils Exception ExtsCompat46 FamI nst FamInstEnv FastBool FastFunctions FastMutInt FastString FastTypes Finder Fin gerprint FiniteMap ForeignCall Hooks Hoopl Hoopl.Dataflow HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit HsPat HsSyn HsTypes HsUtils HscTypes IOEnv Id IdInfo Iface Env IfaceSyn IfaceType InstEnv InteractiveEvalTypes Kind ListSetOps Literal Load Iface Maybes MkCore MkGraph MkId Module MonadUtils Name NameEnv NameSet OccName OccurAnal OptCoercion OrdList Outputable PackageConfig Packages Pair Panic Pipel ineMonad Platform PlatformConstants PprCmm PprCmmDecl PprCmmExpr PprCore PrelInf o PrelNames PrelRules Pretty PrimOp RdrName Reg RegClass Rules SMRep Serialized SrcLoc StaticFlags StgCmmArgRep StgCmmClosure StgCmmEnv StgCmmLayout StgCmmMonad StgCmmProf StgCmmTicky StgCmmUtils StgSyn Stream StringBuffer TcEvidence TcIfac e TcMType TcRnMonad TcRnTypes TcType TcTypeNats TrieMap TyCon Type TypeRep TysPr im TysWiredIn Unify UniqFM UniqSet UniqSupply Unique Util Var VarEnv VarSet" dyld: lazy symbol binding failed: Symbol not found: _locale_charset Referenced from: /Users/kazu/work/ghc/libraries/base/dist- install/build/libHSb ase-4.7.0.0-ghc7.7.20131102.dylib Expected in: flat namespace dyld: Symbol not found: _locale_charset Referenced from: /Users/kazu/work/ghc/libraries/base/dist- install/build/libHSb ase-4.7.0.0-ghc7.7.20131102.dylib Expected in: flat namespace make[1]: *** [compiler/stage2/dll-split.stamp] Trace/BPT trap: 5 make: *** [all] Error 2 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by kazu-yamamoto): My GMP is version 5.1.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by kazu-yamamoto): _locale_charset is a libiconv issue. It's very strange that --with-gmp-xxx influences iconv. Anyway, I tried: {{{ % ./configure --prefix=/ghc-head --with-gmp-includes=/opt/local/include --with-gmp-libraries=/opt/local/lib --with-iconv-includes=/usr/include --with-iconv-libraries=/usr/lib }}} But this time, the version of FFI mismatched. So, I did: {{{ % ./configure --prefix=/ghc-head --with-gmp-includes=/opt/local/include --with-gmp-libraries=/opt/local/lib --with-iconv-includes=/usr/include --with-iconv-libraries=/usr/lib --with-system-libffi --with-ffi- includes=/usr/include/ffi --with-ffi-libraries=/usr/lib }}} This configuration can build GHC head on Mavericks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by kazu-yamamoto): OK. I understand the source of this problem. On Mavericks, "/usr/bin/gcc" is a wrapper for clang: {{{ % /usr/bin/gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix }}} With this gcc, "libraries/integer-gmp/gmp/gmpbuild/configure" fails. If we can pass CC=clang to this configure, it works. To prove this, I modified "libraries/integer-gmp/gmp/ghc.mk" to hard-code "CC=clang". With this hack, I can build GHC head with integer-gmp on Mavericks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by kazu-yamamoto): "ghc-mk-for-clang.patch" solves this problem. This patch checks if "gcc" is real "gcc" or "clang". If "gcc" is "clang", CC=clang is specified to configure. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by kazu-yamamoto): May I ask to merge this patch before GHC 7.8.1? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by George): * cc: george.colpitts@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks
----------------------------------------+----------------------------------
Reporter: kazu-yamamoto | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
Resolution: | Keywords: clang
Operating System: MacOS X | Architecture:
Type of failure: Building GHC failed | Unknown/Multiple
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets:
----------------------------------------+----------------------------------
Comment (by Austin Seipp

#8497: clang/wrapper cannot build GHC head with integer-gmp on Mavericks ----------------------------------------+---------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by thoughtpolice): * status: new => closed * resolution: => fixed Comment: I used Homebrew to install a 64bit GMP, tested that built on Mavericks, then uninstalled it and applied your patch, and the in-tree build worked fine too. Merged - thank you Kazu! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8497#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC