#7686 closed bug (fixed)

--with-libffi-header=<value> is not propagated to compiler/ghci/LibFFI.hsc compilation

Reported by: kgardas Owned by: trommler
Priority: normal Milestone:
Component: Build System Version: 7.7
Keywords: Cc: ptrommler@…, pho@…, kazu@…, carter.schonwald@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Building GHC failed Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets: #7465

Description

While experimenting with GHC HEAD compilation on Solaris 11 using system provided libffi I've noticed that actual value of configure parameter --with-libffi-includes is not propagated to compilation of compiler/ghci/LibFFI.hsc file.
For example on Solaris 11 I'm configuring with this:

./configure --with-gmp-includes=/usr/include/gmp/ --with-system-libffi --with-ffi-includes=/usr/lib/libffi-3.0.9/include/ --with-nm=/usr/gnu/bin/nm

and the build fails with:

"inplace/bin/hsc2hs" --cc=/usr/bin/gcc --ld=/usr/bin/gcc  --cross-safe --cflag=-fno-stack-protector -I/usr/include/gmp/  --cflag=-D__GLASGOW_HASKELL__=707 --cflag=-Di386_HOST_ARCH=1 --cflag=-Dsolaris2_HOST_OS=1 '--cflag=-fno-stack-protector' '--cflag=-Icompiler/../rts/dist/build' '--cflag=-Icompiler/stage2' '--cflag=-Icompiler/.' '--cflag=-Icompiler/parser' '--cflag=-Icompiler/utils' '--cflag=-DGHCI' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/process/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/directory/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/unix/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/time/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/containers/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/bytestring/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/array/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/libraries/base/include' '--cflag=-I/usr/include/gmp/' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/rts/dist/build' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/includes' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-head/includes/dist-derivedconstants/header' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/transformers/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/template-haskell/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/hpc/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/hoopl/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/bin-package-db/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/binary/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/Cabal/Cabal/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/process/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/pretty/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/directory/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/unix/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/time/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/old-locale/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/filepath/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/containers/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/bytestring/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/deepseq/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/array/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/base/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/integer-gmp/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/libraries/ghc-prim/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-head/rts/dist/build' '--lflag=-lrt' '--lflag=-ldl' '--lflag=-lgmp' '--lflag=-lm' '--lflag=-lrt' '--lflag=-ldl' '--lflag=-lffi' --cflag=-Icompiler/stage2/build/autogen --cflag=-include --cflag=compiler/stage2/build/autogen/cabal_macros.h   compiler/ghci/LibFFI.hsc -o compiler/stage2/build/LibFFI.hs
LibFFI.hsc:9:17: fatal error: ffi.h: No such file or directory
compilation terminated.
compiling compiler/stage2/build/LibFFI_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c compiler/stage2/build/LibFFI_hsc_make.c -o compiler/stage2/build/LibFFI_hsc_make.o -fno-stack-protector -I/export/home/karel/vcs/ghc-src/ghc-head/includes -fno-stack-protector -I/usr/include/gmp/ -D__GLASGOW_HASKELL__=707 -Di386_HOST_ARCH=1 -Dsolaris2_HOST_OS=1 -fno-stack-protector -Icompiler/../rts/dist/build -Icompiler/stage2 -Icompiler/. -Icompiler/parser -Icompiler/utils -DGHCI -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/process/include -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/directory/include -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/unix/include -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/time/include -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/containers/include -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/bytestring/include -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/array/include -I/export/home/karel/vcs/ghc-src/ghc-head/libraries/base/include -I/usr/include/gmp/ -I/export/home/karel/vcs/ghc-src/ghc-head/rts/dist/build -I/export/home/karel/vcs/ghc-src/ghc-head/includes -I/export/home/karel/vcs/ghc-src/ghc-head/includes/dist-derivedconstants/header -Icompiler/stage2/build/autogen -include compiler/stage2/build/autogen/cabal_macros.h -I/export/home/karel/vcs/ghc-src/ghc-head/inplace/lib/include/
gmake[1]: *** [compiler/stage2/build/LibFFI.hs] Error 1
gmake: *** [all] Error 2

when I add appropriate --cflag=-I/usr/lib/libffi-3.0.9/include/ to the hsc2hs command line compilation went fine.

Attachments (1)

0001-Propagate-ffi-includes-to-compiler-ghci-LibFFI.hsc-F.patch (753 bytes) - added by trommler 14 months ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 months ago by trommler

  • Architecture changed from x86 to Unknown/Multiple
  • Cc ptrommler@… added
  • Operating System changed from Solaris to Unknown/Multiple
  • Owner set to trommler

The issue affects all operating systems where libffi is not installed in a standard location.

Ticket #7465 deals with linking libffi from a directory not on the system linker path.

I hope I get around to fixing those two tickets soon.

comment:2 Changed 14 months ago by trommler

  • Status changed from new to patch

The attached patch passes --with-libffi-includes argument to hsc2cs and gcc in compiler/ghc.

Note: --with-libffi-libraries is not passed to the linker, yet. This will be fixed in ticket #7465.

comment:3 Changed 13 months ago by PHO

  • Cc pho@… added

comment:4 Changed 13 months ago by kazu-yamamoto

  • Cc kazu@… added

comment:5 Changed 13 months ago by kazu-yamamoto

I confirmed that this patch also fixes the hsc2hs problem in ticket #7806. Please merge this patch.

comment:6 Changed 13 months ago by carter

  • Cc carter.schonwald@… added

comment:7 Changed 12 months ago by ptrommler@…

commit e3abb5ac8cd068ee6a7cd2d078da2c595861687c

Author: Peter Trommler <ptrommler@acm.org>
Date:   Tue Mar 5 07:39:19 2013 +0100

    Propagate ffi includes to compiler/ghci/LibFFI.hsc (Fixes #7686)

 compiler/ghc.cabal.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

comment:8 Changed 12 months ago by igloo

  • Difficulty set to Unknown
  • Resolution set to fixed
  • Status changed from patch to closed

Applied, thanks!

Note: See TracTickets for help on using tickets.