GaloisInc / HaLVM

The Haskell Lightweight Virtual Machine (HaLVM): GHC running on Xen
BSD 3-Clause "New" or "Revised" License
1.05k stars 88 forks source link

HaLVM doesn't build on Archlinux #30

Closed svenkeidel closed 9 years ago

svenkeidel commented 10 years ago

I problems compiling HaLVM on Archlinux. I have created a gist with the whole build log: https://gist.github.com/svenkeidel/77cf0323c221c8a592b1. The error was that gcc cannot find ffi.h which should be in the halvm-ghc directory somewhere. Also the last call to gcc looks a bit weird:

/usr/bin/gcc -c compiler/stage1/build/LibFFI_hsc_make.c -o compiler/stage1/build/LibFFI_hsc_make.o -fno-unit-at-a-time -fno-stack-protector -fomit-frame-pointer -fno-asynchronous-unwind-tables -mno-red-zone -fno-builtin -DCONFIG_X86_64 -fno-stack-protector -Dx86_64_HOST_ARCH=1 -Dlinux_HOST_OS=1 -D__GLASGOW_HASKELL__=708 -fno-stack-protector -fno-unit-at-a-time -fno-stack-protector -fomit-frame-pointer -fno-asynchronous-unwind-tables -mno-red-zone -fno-builtin -DCONFIG_X86_64
    -Icompiler/.
    -Icompiler/parser
    -Icompiler/utils
    -Icompiler/../rts/dist/build
    -Icompiler/stage1
    -DGHCI
    -isystem/usr/lib/ghc-7.8.2/process-1.2.0.0/include
    -isystem/usr/lib/ghc-7.8.2/directory-1.2.1.0/include
    -isystem/usr/lib/ghc-7.8.2/unix-2.7.0.1/include
    -isystem/usr/lib/ghc-7.8.2/time-1.4.2/include
    -isystem/usr/lib/ghc-7.8.2/bytestring-0.10.4.0/include
    -isystem/usr/lib/ghc-7.8.2/base-4.7.0.0/include
    -isystem/usr/lib/ghc-7.8.2/integer-gmp-0.5.1.0/include
    -isystem/usr/lib/ghc-7.8.2/include
    -isystem/usr/lib/libffi-3.0.13/include
    -Icompiler/stage1/build/autogen
    -include compiler/stage1/build/autogen/cabal_macros.h
    -I/home/sven/haskell-halvm/src/haskell-halvm-git/halvm-ghc/inplace/lib/include/

The last included directory halvm-ghc/inplace/lib/include/ does not exists. Any ideas how to fix this?

Best, Sven

acw commented 10 years ago

Hrm. I don't have an Arch machine handy to test anything, so this is going to be trouble. However, step one would be to confirm that libffi (and any -devel/-dev packages) is installed on the machine.

svenkeidel commented 10 years ago

Yes, libffi is installed, but it is version 3.1 instead of 3.0.13. But I thought autotools would use the version inside the ghc directory:

$ find . -name 'libffi*' -type f
./halvm-ghc/libffi-tarballs/libffi-3.0.11.tar.gz

Does ghc build with libffi 3.1 and how can I configure the project to use it?

wayofthepie commented 10 years ago

Any luck building on Arch? I came across the same issue.

I'm not sure if GHC can build with libffi 3.1 (I will try later) but you can force GHC to build against the system version by configuring with "--with-system-libffi", "--with-ffi-includes" and "--with-ffi-libraries" - check the options for configure when configuring ghc - the issue that added this change is https://ghc.haskell.org/trac/ghc/ticket/5743. Will update if I find a solution to this.

sheyll commented 9 years ago

I have successfully built and tested HaLVM on archlinux, I also installed xen (4.4) and tested some simple hello world programs.

acw commented 9 years ago

Awesome. Thanks for the update. Perhaps this was a transient bug based on particular Arch / GHC versions?

I'm going to close this for now. Wayofthepie and svenkeidel: if you still have problems, can you reopen this bug?