[GHC] #9983: configure script invokes ghc with LDFLAGS during cross-builds

#9983: configure script invokes ghc with LDFLAGS during cross-builds -------------------------------------+------------------------------------- Reporter: newsham | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.4 System | Operating System: Unknown/Multiple Keywords: | Type of failure: Building GHC Architecture: | failed Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- When building ghc, the aclocal.m4 settings direct "configure" to use the provided LDFLAGS as GHC_LDFLAGS, which are later used to invoke the host's GHC: https://github.com/ghc/ghc/blob/ghc-7.8/aclocal.m4#L1820 This is undesirable when performing a cross-build, in which case the LDFLAGS are used to specify the flags for use when linking for the target and not when linking on the build host. rwbarton@freenode believes that the normal CFLAGS, LDFLAGS, LIBS, etc. should never have an affect on the build host behavior. Either this policy needs to be enforced or a separate set of flags needs to be introduced to allow setting the target flags separately from the build host flags. To reproduce, "./configure LDFLAGS=bogus" and observe the failure in ghc- pwd, which is used on the build host. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9983 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9983: configure script invokes ghc with LDFLAGS during cross-builds -------------------------------------+------------------------------------- Reporter: newsham | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.8.4 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 newsham): Besides using LDFLAGS for ghc, configure seems to expect to use the following settings for building binaries on the build host that can be run on the build host: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS. Defining any of these to target-appropriate settings causes configure to fail early with: checking whether the C compiler works... no or configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. This includes builds in which --host and --build and --target were all specified where --target is a different value, and --host and --build are the same values. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9983#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9983: configure script invokes ghc with LDFLAGS during cross-builds -------------------------------------+------------------------------------- Reporter: newsham | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #11231 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by hvr): * related: => #11231 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9983#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC