[GHC] #10456: Wrong CPP during cross-compilation

#10456: Wrong CPP during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build | Version: 7.11 System | Operating System: Unknown/Multiple Keywords: | Type of failure: Building GHC Architecture: | failed Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- It appears that during cross-compilation the build system uses the wrong compiler as C preprocessor. It may cause errors by passing incompatible flags to the cross-compiler --- for example when trying to cross-compile using 32-bit clang on a 64-bit system (sample output attached below). {{{ /Users/jakub/src/nacl_sdk/pepper_canary/toolchain/mac_pnacl/bin/pnacl- clang -E -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES -m64 -fno-stack-protector -Wall -Icompiler/stage1/build/autogen -Icompiler/. -Icompiler/parser -Icompiler/utils -Icompiler/stage1 -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/proce_0hwN3CTKynhHQqQkChnSdH/include' -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/direc_3TcTyYedch32o1zTH2MR00/include' -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/unix_G4Yo1pNtYrk8nCq1cx8P9d/include' -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/time_Hh2clZW6in4HpYHx5bLtb7/include' -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/bytes_6vj5EoliHgNHISHCVCb069/include' -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/base_I5BErHzyOm07EBNpKBEeUv/include' -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include' -isystem'/Applications/ghc-7.10.1.app/Contents/lib/ghc-7.10.1/include' -Wno-unknown-pragmas -MM -x c compiler/ghci/keepCAFsForGHCi.c -MF compiler/stage1/build/.depend-v.c_asm.bit pnacl-clang: Unrecognized option: -m64 Use '--help' for more information. make[1]: *** [compiler/stage1/build/.depend-v.c_asm] Error 255 make: *** [all] Error 2 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10456 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10456: Wrong CPP during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): Would probably help if you could attach your `mk/build.mk` file and the arguments you passed to the `./configure` script. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10456#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10456: Wrong CPP during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: Unknown/Multiple | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by erikd): * keywords: => cross-compiling -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10456#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10456: Wrong CPP during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: Unknown/Multiple | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by erikd): * cc: erikd (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10456#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10456: Wrong CPP during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: Unknown/Multiple | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): I can reproduce this with just `./configure --target=i386-unknown-linux`, though using the wrong CPP to build dependencies has no visibly bad effects in my case. The OP's immediate issue is that the build system knows it is doing a build for the host system, so it added `-m64`, but then actually used the cross-compiler for CPP. I wonder whether, until recently (when the stage1 compiler gained some TH support), it was the case that there was no C code in the compiler proper (as opposed to the rts and libraries)? I guess we need separate CPP_STAGEn variables, or to have the dependency generation use CC rather than CPP... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10456#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10456: Wrong CPP during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: jakzale Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: Unknown/Multiple | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by jakzale): * owner: => jakzale -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10456#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10456: Wrong CPP during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: jakzale Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: Unknown/Multiple | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D998 -------------------------------------+------------------------------------- Changes (by jakzale): * differential: => Phab:D998 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10456#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC