Skip to content

bindist configure checks involving the compiler are broken

Commit 6554dc60 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.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information