
#12555: bindist configure checks involving the compiler are broken -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Commit 6554dc60304bbd4b2edb93be7e1658bff237e067 added this code to `distrib/configure.ac.in`: {{{ BinDistNeedsLibdw=@HaveLibdw@ if test "x$BinDistNeedsLibdw" = "xyes" ; then AC_CHECK_LIB(dw, dwfl_attach_state, [HaveLibdw=YES], [AC_MSG_ERROR([Binary distribution was built with libdw support but target system doesn't have supported libdw version (needs at least 0.158)])] )]; fi }}} It occurs before any other autoconf command involving the compiler. So apparently the expansion of `AC_CHECK_LIB` includes the code responsible for checking how to invoke the compiler, checking the object file suffix, etc. (Yes, this is a crazy way to do it.) Since the official bindist has `BinDistNeedsLibdw=NO`, none of that code ever actually runs. Later (in `FPTOOLS_SET_HASKELL_PLATFORM_VARS`) the configure script uses ` AC_COMPILE_IFELSE` to check for features of the compiler like non- executable stack support, but these checks are broken because autoconf never actually determined basic information about the compiler. So the 8.0.1 bindist produces binaries with executable stacks, which is a problem on some systems. It would be better anyways to move this `AC_CHECK_LIB` later in `distrib/configure.ac.in`, to after where we select flags to be used when invoking the compiler. There are also some other bugs in this code: there is an extra `];` and the correct value of `BinDistNeedsLibdw` is `YES` (not `yes`) so the code currently can never run anyways. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12555 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler