Move libffi configuration after basic toolchain setup
ClosedPublic

Authored by rwbarton on Dec 27 2014, 9:42 PM.

Details

Summary

The relevant aspect is that the libffi configuration's AC_CHECK_LIB
and AC_CHECK_HEADERS are moved after FIND_GCC. There are two reasons
to do this:

  1. We should detect the presence of libffi using the C compiler

that we are eventually going to use to build GHC.

  1. Running AC_CHECK_HEADERS before FIND_GCC pollutes the CPP variable

with "gcc -E" (wrong when cross-compiling), and CPP is not reset
by FIND_GCC. Thus this patch fixes x86_64 -> i386 cross-compilation
of integer-gmp2.

Test Plan

Local x86_64 -> i386 cross-compiling validate; Harbormaster

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rwbarton updated this revision to Diff 2033.Dec 27 2014, 9:42 PM
rwbarton retitled this revision from to Move libffi configuration after basic toolchain setup.
rwbarton updated this object.
rwbarton edited the test plan for this revision. (Show Details)

Actually I'm doing a quick build/fast testsuite run instead of validate, since I hit Trac #9457. Well, there were

23 caused framework failures
 0 unexpected passes
33 unexpected failures
19 unexpected stat failures

so I guess that is a success for a cross-compile.

erikd added a subscriber: erikd.Dec 29 2014, 3:26 AM

Seems like a reasonable change to make.

I do however notice that if I try to specify a specific C compiler using say:

CC=gcc-4.4 ./configure

the configure script finds and uses gcc (in this case 4.9) anyway. That however is a separate issue to this one.

In D597#16791, @erikd wrote:

Seems like a reasonable change to make.

I do however notice that if I try to specify a specific C compiler using say:

CC=gcc-4.4 ./configure

the configure script finds and uses gcc (in this case 4.9) anyway. That however is a separate issue to this one.

Interesting, never tried this before. You're "supposed" to use --with-gcc=gcc-4.4 but it would be nice if setting CC worked too.

austin accepted this revision.Jan 12 2015, 4:11 AM
austin edited edge metadata.

lol @ shell scripts. OK, LGTM.

This revision is now accepted and ready to land.Jan 12 2015, 4:11 AM
This revision was automatically updated to reflect the committed changes.