build failure on FreeBSD 9.1

Hi, GHC head cannot be build on FreeBSD 9.1: ---- libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/build/.depend-v.haskell: No such file or directory compiler/ghc.mk:426: compiler/stage1/build/.depend-v.haskell: No such file or directory "cp" -p utils/hsc2hs/dist/build/tmp/hsc2hs inplace/lib/bin/hsc2hs utils/hsc2hs/ghc.mk:15: *** Do not know how to prependLibraryPath on freebsd. Stop. gmake: *** [all] Error 2 ---- I can build GHC head on Linux. --Kazu

Hi Kazu, On Sun, Mar 17, 2013 at 10:04:30PM +0900, Kazu Yamamoto wrote:
GHC head cannot be build on FreeBSD 9.1:
---- libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/build/.depend-v.haskell: No such file or directory compiler/ghc.mk:426: compiler/stage1/build/.depend-v.haskell: No such file or directory "cp" -p utils/hsc2hs/dist/build/tmp/hsc2hs inplace/lib/bin/hsc2hs utils/hsc2hs/ghc.mk:15: *** Do not know how to prependLibraryPath on freebsd. Stop. gmake: *** [all] Error 2
It's trying to do the equivalent of setting LD_LIBRARY_PATH or DYLD_LIBRARY_PATH (see rules/library-path.mk). What's the right thing to do on the BSDs? Thanks Ian

Hello,
"cp" -p utils/hsc2hs/dist/build/tmp/hsc2hs inplace/lib/bin/hsc2hs utils/hsc2hs/ghc.mk:15: *** Do not know how to prependLibraryPath on freebsd. Stop. gmake: *** [all] Error 2
It's trying to do the equivalent of setting LD_LIBRARY_PATH or DYLD_LIBRARY_PATH (see rules/library-path.mk).
OK. I understand.
What's the right thing to do on the BSDs?
It is LD_LIBRARY_PATH. I modified to set LD_LIBRARY_PATH in FreeBSD and confirmed that it works! --Kazu

It is LD_LIBRARY_PATH. I modified to set LD_LIBRARY_PATH in FreeBSD and confirmed that it works!
Thanks. I've pushed a patch for this.
Thank you. Building now works. But "validate" fails. "/usr/home/kazu/work/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/ghc-pkg" --force --global-package-db "/usr/home/kazu/work/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/package.conf.d" update rts/package.conf.install Shared object "libffi.so.6" not found, required by "libHSrts-ghc7.7.20130319.so" --Kazu

On Tue, Mar 19, 2013 at 12:02:37PM +0900, Kazu Yamamoto wrote:
Thank you. Building now works. But "validate" fails.
"/usr/home/kazu/work/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/ghc-pkg" --force --global-package-db "/usr/home/kazu/work/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/package.conf.d" update rts/package.conf.install Shared object "libffi.so.6" not found, required by "libHSrts-ghc7.7.20130319.so"
I can't reproduce this. My ghc-pkg can find libffi: $ ldd "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/ghc-pkg" | grep ffi libffi.so.6 => /home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/../rts-1.0/libffi.so.6 (0x00007fd2faf6e000) The library exists: $ ls -l "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/../rts-1.0/libffi.so.6" -rw-r--r-- 1 ian ian 105366 Mar 19 18:15 /home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/../rts-1.0/libffi.so.6 It was installed earlier, by: for i in rts/dist/build/libHSrts.a [...] rts/dist/build/libffi.so rts/dist/build/libffi.so.6 rts/dist/build/libffi.so.6.0.0 ; do case $i in *.a) /usr/bin/install -c -m 644 $i "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0"; true "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0"/`basename $i` ;; *.dll) /usr/bin/install -c -m 755 $i "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0" ; : "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0"/`basename $i` ;; *.so) /usr/bin/install -c -m 755 $i "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0" ;; *.dylib) /usr/bin/install -c -m 755 $i "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0";; *) /usr/bin/install -c -m 644 $i "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0"; esac; done Which bit is it that goes wrong for you? Thanks Ian

$ ldd "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/ghc-pkg" | grep ffi libffi.so.6 => /home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/../rts-1.0/libffi.so.6 (0x00007fd2faf6e000)
In my case: libffi.so.6 => not found (0)
The library exists:
$ ls -l "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/../rts-1.0/libffi.so.6" -rw-r--r-- 1 ian ian 105366 Mar 19 18:15 /home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/../rts-1.0/libffi.so.6
% find . -name "libffi.so*" ./bindisttest/a/b/c/ghc-7.7.20130319/rts/dist/build/libffi.so.6 ./bindisttest/a/b/c/ghc-7.7.20130319/rts/dist/build/libffi.so ./bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0/libffi.so ./bindisttest/install dir/lib/ghc-7.7.20130319/rts-1.0/libffi.so.6 ./libffi/build/inst/lib/libffi.so.6 ./libffi/build/inst/lib/libffi.so ./libffi/build/x86_64-unknown-freebsd/.libs/libffi.so.6 ./libffi/build/x86_64-unknown-freebsd/.libs/libffi.so ./rts/dist/build/libffi.so.6 ./rts/dist/build/libffi.so P.S. To summarize the current status: Build validate FreeBSD 9.1 OK NG MacOS 10.8.3 NG OK --Kazu

On Wed, Mar 20, 2013 at 04:42:55PM +0900, Kazu Yamamoto wrote:
$ ldd "/home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/ghc-pkg" | grep ffi libffi.so.6 => /home/ian/ghc/git/ghc/bindisttest/install dir/lib/ghc-7.7.20130319/bin/../rts-1.0/libffi.so.6 (0x00007fd2faf6e000)
In my case:
libffi.so.6 => not found (0)
Ah, I'm optimistic that
commit 51bf3653775ba734f7ca3de99234aba722a0c72c
Author: Ian Lynagh

In my case:
libffi.so.6 => not found (0)
Ah, I'm optimistic that
commit 51bf3653775ba734f7ca3de99234aba722a0c72c Author: Ian Lynagh
Date: Wed Mar 20 19:25:27 2013 +0000 Fix build with non-Linux ELF OSes
will fix this.
This fix does not solve the problem and "validate" still has the same problem. Also, it appeared that after building GHC, inplace/lib/bin/ghc-stage2 has the same problem: % ldd ghc-stage2 | grep ffi libffi.so.6 => not found (0) --Kazu

On Thu, Mar 21, 2013 at 09:08:46AM +0900, Kazu Yamamoto wrote:
In my case:
libffi.so.6 => not found (0)
This fix does not solve the problem and "validate" still has the same problem.
OK, I've just pushed another attempt; can you let me know whether HEAD now works for you, please?
Also, it appeared that after building GHC, inplace/lib/bin/ghc-stage2 has the same problem:
% ldd ghc-stage2 | grep ffi libffi.so.6 => not found (0)
That's expected. All the Haskell .so's should also be not found. That's why inplace/bin/ghc-stage2 sets LD_LIBRARY_PATH. Thanks Ian

OK, I've just pushed another attempt; can you let me know whether HEAD now works for you, please?
Thanks.
That's expected. All the Haskell .so's should also be not found. That's why inplace/bin/ghc-stage2 sets LD_LIBRARY_PATH.
I understand. Build finished on FreeBSD and "ghc-stage2" works: ---- ./inplace/bin/ghc-stage2 --interactive GHCi, version 7.7.20130323: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> ---- However, "gmake install" failed: ---- Installing library in /ghc-head/lib/ghc-7.7.20130323/haskell2010-1.1.1.0 "/ghc-head/lib/ghc-7.7.20130323/bin/ghc-pkg" --force --global-package-db "/ghc-head/lib/ghc-7.7.20130323/package.conf.d" update rts/package.conf.install Shared object "libffi.so.6" not found, required by "libHSrts-ghc7.7.20130323.so" gmake[1]: *** [install_packages] Error 1 gmake: *** [install] Error 2 ---- The installed "ghci" says: ---- % ghci Shared object "libffi.so.6" not found, required by "libHSrts_thr-ghc7.7.20130323.so" ---- No LD_LIBRARY_PATH is found from installed scripts. --Kazu

On Sun, Mar 24, 2013 at 12:50 PM, Kazu Yamamoto
% ghci Shared object "libffi.so.6" not found, required by "libHSrts_thr-ghc7.7.20130323.so"
What is the version of your devel/libffi port? Could not adding --with-system-libffi and related flags to the configuration phase fix the problem? Note that you can experience nice problems if the version of the in-tree and system libffi.so files differ.

On Sun, Mar 24, 2013 at 3:51 PM, Páli Gábor János
On Sun, Mar 24, 2013 at 12:50 PM, Kazu Yamamoto
wrote: % ghci Shared object "libffi.so.6" not found, required by "libHSrts_thr-ghc7.7.20130323.so"
What is the version of your devel/libffi port? Could not adding --with-system-libffi and related flags to the configuration phase fix the problem? Note that you can experience nice problems if the version of the in-tree and system libffi.so files differ.
It works for me (i.e. the "binary-dist" and "test_bindist" targets do not give me errors) if I use the --with-system-libffi flags, and ldd(1) shows that everything is okay: $ ldd bindisttest/HelloWorld bindisttest/HelloWorld: libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28126000) libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x2821e000) libm.so.5 => /lib/libm.so.5 (0x28281000) librt.so.1 => /usr/lib/librt.so.1 (0x2829b000) libffi.so.6 => /usr/local/lib/libffi.so.6 (0x282a0000) libc.so.7 => /lib/libc.so.7 (0x282a6000) $ pkg info -x libffi libffi-3.0.11 Foreign Function Interface However, if I do not use --with-system-libffi, but libffi.so.6 is present on the system, the following happens at gmake binary-dist (just for your information): $ gmake binary-dist [snip] tar: ghc-7.7.20130324/rts/dist/build/libffi.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_p.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_l.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_debug.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr_debug.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr_l.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr_p.a: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_debug-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr_debug-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_l-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr_l-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi-6.dll: Cannot stat: No such file or directory tar: Error exit delayed from previous errors. mv bindistprep/*.tar.bz2 .

On Sun, Mar 24, 2013 at 10:08:14PM +0100, Páli Gábor János wrote:
However, if I do not use --with-system-libffi, but libffi.so.6 is present on the system, the following happens at gmake binary-dist (just for your information):
$ gmake binary-dist [snip] tar: ghc-7.7.20130324/rts/dist/build/libffi.a: Cannot stat: No such file or directory
The .a lines probably mean you are missing
commit 8575d01b4205b4545c54f9f1ba1d993a87bac72c
Author: Ian Lynagh
tar: ghc-7.7.20130324/rts/dist/build/libffi_debug-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr_debug-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_l-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi_thr_l-ghc7.7.20130324.so: Cannot stat: No such file or directory tar: ghc-7.7.20130324/rts/dist/build/libffi-6.dll: Cannot stat: No such file or directory
I get these too; they aren't a problem. Thanks Ian

On Sun, Mar 24, 2013 at 10:26 PM, Ian Lynagh
The .a lines probably mean you are missing
commit 8575d01b4205b4545c54f9f1ba1d993a87bac72c Author: Ian Lynagh
Date: Sun Mar 24 17:29:30 2013 +0000 Fix the names of the libffi archives
Yes, I saw your commit later :-)
I get these too; they aren't a problem.
Great! I have just pushed a minor fix for my updated builder clients on -head so now they can hopefully produce working builds.

What is the version of your devel/libffi port?
3.0.9.
Could not adding --with-system-libffi and related flags to the configuration phase fix the problem?
Yes. When I added --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib, this problem does not happen. Summary: building GHC head succeeds both on FreeBSD and Mac. But installing GHC head fails both on FreeBSD and Mac. This is probably because no installed scripts define (DY)LD_LIBRARY_PATH. If --with-system-libffi and etc are specified, both building and installation succeeds on FreeBSD. "validate" with these options still freezes: http://hackage.haskell.org/trac/ghc/ticket/7652 Note that I set "sudo -w vfs.timestamp_precision=1" on FreeBSD according to: http://hackage.haskell.org/trac/ghc/ticket/7592 --Kazu

On Mon, Mar 25, 2013 at 3:42 AM, Kazu Yamamoto
Summary: building GHC head succeeds both on FreeBSD and Mac. But installing GHC head fails both on FreeBSD and Mac. This is probably because no installed scripts define (DY)LD_LIBRARY_PATH.
I tried to install the vanilla binary tarball that the builder client created this morning [1] (i386), but I got the following errors at install: install: rts/dist/build/libCffi_debug-ghc7.7.20130325.so: No such file or directory install: rts/dist/build/libCffi_thr-ghc7.7.20130325.so: No such file or directory install: rts/dist/build/libCffi_thr_debug-ghc7.7.20130325.so: No such file or directory install: rts/dist/build/libCffi_l-ghc7.7.20130325.so: No such file or directory install: rts/dist/build/libCffi_thr_l-ghc7.7.20130325.so: No such file or directory install: rts/dist/build/libffi-6.dll: No such file or directory strip: '/usr/local/ghc-7.7/lib/ghc-7.7.20130325/rts-1.0/libffi-6.dll': No such file gmake[1]: *** [install_packages] Error 1 gmake: *** [install] Error 2 However, the builder itself happily passes the binary-dist and test_bindist targets.
If --with-system-libffi and etc are specified, both building and installation succeeds on FreeBSD. "validate" with these options still freezes:
Yes, I still have not solved this issue but working on it.
Note that I set "sudo -w vfs.timestamp_precision=1" on FreeBSD according to:
This is unrelated to the freezes, it will only help you with concurrently building the sources as it enables to use higher precision for file system timestamps to avoid the previously experienced make(1) problem. [1] http://csupor.inf.elte.hu:8080/ghc/dist/freebsd8/current/dist/ghc-7.7.201303...

I tried to install the vanilla binary tarball that the builder client created this morning [1] (i386), but I got the following errors at install:
I think this kind of errors should not be occurred anyway.
Note that I set "sudo -w vfs.timestamp_precision=1" on FreeBSD according to:
This is unrelated to the freezes, it will only help you with concurrently building the sources as it enables to use higher precision for file system timestamps to avoid the previously experienced make(1) problem.
I guessed so. But I explained what I did just in case. --Kazu

On Sun, Mar 24, 2013 at 08:50:56PM +0900, Kazu Yamamoto wrote:
Build finished on FreeBSD and "ghc-stage2" works:
However, "gmake install" failed:
---- Installing library in /ghc-head/lib/ghc-7.7.20130323/haskell2010-1.1.1.0 "/ghc-head/lib/ghc-7.7.20130323/bin/ghc-pkg" --force --global-package-db "/ghc-head/lib/ghc-7.7.20130323/package.conf.d" update rts/package.conf.install Shared object "libffi.so.6" not found, required by "libHSrts-ghc7.7.20130323.so" gmake[1]: *** [install_packages] Error 1 gmake: *** [install] Error 2
Hmm, I'm not sure what's going wrong then. I think that this will need someone who can reproduce it to debug it. Thanks Ian

Hi, I have created a ticket about "Dynamic linking and libffi": http://hackage.haskell.org/trac/ghc/ticket/7806 --Kazu
OK, I've just pushed another attempt; can you let me know whether HEAD now works for you, please?
Thanks.
That's expected. All the Haskell .so's should also be not found. That's why inplace/bin/ghc-stage2 sets LD_LIBRARY_PATH.
I understand.
Build finished on FreeBSD and "ghc-stage2" works:
---- ./inplace/bin/ghc-stage2 --interactive GHCi, version 7.7.20130323: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> ----
However, "gmake install" failed:
---- Installing library in /ghc-head/lib/ghc-7.7.20130323/haskell2010-1.1.1.0 "/ghc-head/lib/ghc-7.7.20130323/bin/ghc-pkg" --force --global-package-db "/ghc-head/lib/ghc-7.7.20130323/package.conf.d" update rts/package.conf.install Shared object "libffi.so.6" not found, required by "libHSrts-ghc7.7.20130323.so" gmake[1]: *** [install_packages] Error 1 gmake: *** [install] Error 2 ----
The installed "ghci" says:
---- % ghci Shared object "libffi.so.6" not found, required by "libHSrts_thr-ghc7.7.20130323.so" ----
No LD_LIBRARY_PATH is found from installed scripts.
--Kazu
participants (3)
-
Ian Lynagh
-
Kazu Yamamoto
-
Páli Gábor János