Skip to content

ghc-8.10.1-alpha1 fails to build with --with-system-libffi --with-ffi-includes= when built with ghc-8.6.5

Gentoo has libffi headers in a location not seen by compiler by default, for example in /usr/lib64/libffi-3.3/include.

Build attempt against external libffi fails as:

$ ./configure --with-system-libffi --with-ffi-includes=/usr/lib64/libffi-3.3/include
...
$ make
...
x86_64-pc-linux-gnu-gcc -E  -DPROFILING -DTHREADED_RTS -DDEBUG   -march=sandybridge -mtune=sandybridge -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -Wall -Wextra -Wstack-protector -g -march=sandybridge -march=sandybridge -mtune=sandybridge -mtune=sandybridge -g -Wall  -Wall -Wextra -Wstrict-prototypes  -Wmissing-prototypes  -Wmissing-declarations -Winline -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Wno-aggregate-return -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts -fno-strict-aliasing -fno-common -Irts/dist/build/./autogen        -Werror=unused-but-set-variable -Wno-error=inline -O2 -fomit-frame-pointer -g -DRtsWay=\"rts_v\"    -ffunction-sections -fdata-sections -Wno-strict-prototypes -MM -x c rts/Interpreter.c -MF rts/dist/build/.depend-v-dyn-l-debug-thr-thr_debug-thr_l-debug_dyn-thr_dyn-thr_debug_dyn-l_dyn-thr_l_dyn.c_asm.bit
rts/Interpreter.c:41:10: fatal error: ffi.h: No such file or directory
   41 | #include "ffi.h"
      |          ^~~~~~~

Reverting commit 3ce18700 restores ability to boot with ghc-8.6.5.

I guess these flags will become redundant only after lower booter ghc version is guaranteed to ember libffi flags.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information