[GHC] #9257: CC_CLANG_BACKEND not reconfigured during bindist install

#9257: CC_CLANG_BACKEND not reconfigured during bindist install -------------------------------------+------------------------------------- Reporter: MtnViewMark | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.8.2 Keywords: clang | Operating System: MacOS X Architecture: Unknown/Multiple | Type of failure: Installing GHC Difficulty: Moderate (less | failed than a day) | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- 1) build GHC is built on a machine with clang -- project.mk ends up with the macro CC_CLANG_BACKEND=1 2) make binary-dist on that machine 3) bring that bindist to a machine that doesn't use clang 4) unpack the bindist, ./configure, make install This error ensues: cc1: error: unrecognized command line option "-Wno-invalid-pp-token" cc1: error: unrecognized command line option "-Wno-unicode" The problem rests in that there is on gcc invocation during that make install: /usr/bin/gcc -E ... rts/package.conf.in -o rts/dist/package.conf.install.raw This call is picking up arguments from RAWCPP_FLAGS, set in mk/config.mk, based on CC_CLANG_BACKEND, set in mk/project.mk... which was computed at build time. carter has hypothesized that adding the macro FP_CC_LLVM_BACKEND to distrib/configure.ac.in might fix this. In theory that will cause the config file that is bunded into the bindist to recompute the CC_CLANG_BACKEND flag at dist config time. However, this may not work because the only file that emits CC_CLANG_BACKEND is project.mk and that doesn't seem to get re-written during dist time config. -- so something else will be needed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9257 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9257: CC_CLANG_BACKEND not reconfigured during bindist install -------------------------------------+------------------------------------- Reporter: MtnViewMark | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.8.2 Resolution: | Keywords: clang Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: Installing GHC | Difficulty: Moderate (less failed | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by MtnViewMark): Just a note for future readers: The reverse situation works fine. That is, a bindist built on a non-clang system will install fine on a clang system. The one invocation of gcc -E, for rts/dist/package.conf.install.raw, builds fine without the special clang preprocessor flags (-Wno-invalid-pp-token and -Wno-unicode). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9257#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9257: CC_CLANG_BACKEND not reconfigured during bindist install -------------------------------------+------------------------------------- Reporter: | Owner: MtnViewMark | Status: new Type: bug | Milestone: Priority: normal | Version: 7.8.2 Component: Build | Keywords: clang System | Architecture: Unknown/Multiple Resolution: | Difficulty: Moderate (less Operating System: MacOS X | than a day) Type of failure: Installing | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by ezyang): Here is a workaround to solve this problem, especially if you're trying to bootstrap GHC from an old buggy bindist but your GCC is the wrong version. Create a file named gcc with the following contents: {{{ #!/usr/bin/python import sys import os os.execv("/usr/bin/gcc", ["/usr/bin/gcc"] + [i for i in sys.argv[1:] if i != "-Wno-invalid-pp-token" and i != "-Wno-unicode"]) }}} Replace both instances of `/usr/bin/gcc` if your GCC is in an unusual place. Chmod it executable. Now, when configuring your bindist, pass the configure flag `--with-gcc=/path/to/your/gcc`. This will strip out the warning flags and make things work. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9257#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9257: CC_CLANG_BACKEND not reconfigured during bindist install -------------------------------------+------------------------------------- Reporter: MtnViewMark | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.8.2 Resolution: fixed | Keywords: clang Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #8683 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed * related: => #8683 Comment: Thanks to a patch by carter in #8683, the bindist configure script now figures out which C preprocessor to use, and which flags to pass it. Those settings are written to the `settings` file. I just tested all this with HEAD, and it seems to work fine. Please reopen if something is still not working. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9257#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC