Opened 12 months ago

Closed 10 months ago

Last modified 10 months ago

#7833 closed bug (fixed)

installed GHC refers to libffi in the build directory

Reported by: igloo Owned by: igloo
Priority: high Milestone: 7.8.1
Component: Build System Version: 7.6.2
Keywords: Cc: ggreif@…, kazu@…, pho@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

In #7806, Kazu reported that on OS X:

After "make install", the installed GHC refers to libffi in the build directory.

% otool -L ghc | grep libffi

    /Users/kazu/work/ghc/libffi/build/inst/lib/libffi.6.dylib (compatibility version 7.0.0, current version 7.0.0)

So, after I did "make maintainer-clean", the installed GHC could not find a libffi.

Change History (12)

comment:1 Changed 12 months ago by igloo

The same problem applies to all libraries, not just libffi: When using the system libffi:

%  ghc --version             
dyld: Library not loaded: /Users/kazu/work/ghc/libraries/transformers/dist-install/build/libHStransformers-0.3.0.0-ghc7.7.20130413.dylib
  Referenced from: /Users/kazu/bin/ghc-head/lib/ghc-7.7.20130413/bin/../haskeline-0.7.0.4/libHShaskeline-0.7.0.4-ghc7.7.20130413.dylib

comment:2 Changed 12 months ago by heisenbug

  • Cc ggreif@… added

comment:3 Changed 12 months ago by kazu-yamamoto

  • Cc kazu@… added

comment:4 Changed 12 months ago by PHO

  • Cc pho@… added

comment:5 Changed 12 months ago by kazu-yamamoto

Copied from ghc-devs:

Even "--with-system-libffi" is specified, the installed GHC says:

%  ghc --version             
dyld: Library not loaded: /Users/kazu/work/ghc/libraries/transformers/dist-install/build/libHStransformers-0.3.0.0-ghc7.7.20130413.dylib
  Referenced from: /Users/kazu/bin/ghc-head/lib/ghc-7.7.20130413/bin/../haskeline-0.7.0.4/libHShaskeline-0.7.0.4-ghc7.7.20130413.dylib

Note that both libHShaskeline and libHStransformers are certainly
installed.

comment:6 Changed 12 months ago by kazu-yamamoto

After several buildings/installations, I understand that there are two problems:

  • If configured without "--with-system-libffi", the installed GHC refers to libffi in the build directory. It should use "@loader_path" like other libraries
  • The libraries under "rts-1.0/" refers to libraries in the build directory. They also should use "@loader_path".

comment:7 Changed 10 months ago by kazu-yamamoto

This problem has not been fixed yet.

comment:8 Changed 10 months ago by ian@…

commit 7be5b44dba0fd3903d7a324f8e82cdb921d18a4f

Author: Ian Lynagh <ian@well-typed.com>
Date:   Sat Jun 22 21:33:22 2013 +0100

    Fix dynlib paths in the RTS too; part of #7833

 rts/ghc.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

comment:9 Changed 10 months ago by ian@…

commit 92f36df441052ab6bb8516cc19be65f2ca4010fd

Author: Ian Lynagh <ian@well-typed.com>
Date:   Sat Jun 22 20:34:12 2013 +0100

    Fix the dynmaic library paths in the libs, as well as in the programs
    
    Part of #7833

 ghc.mk                              |    5 +++++
 rules/build-package-way.mk          |    1 +
 rules/build-prog.mk                 |   14 ++------------
 rules/relative-dynlib-references.mk |   35 +++++++++++++++++++++++++++++++++++
 4 files changed, 43 insertions(+), 12 deletions(-)

comment:10 Changed 10 months ago by ian@…

commit 9ffe7920db654eed38f8c0e7dbfbab7e92fa9396

Author: Ian Lynagh <ian@well-typed.com>
Date:   Sat Jun 22 16:16:49 2013 +0100

    On OS X, fix the path to the libffi dynlib; fixes #7833

 rules/build-prog.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

comment:11 Changed 10 months ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

Now fixed; thanks for the report!

comment:12 Changed 10 months ago by kazu-yamamoto

I confirmed that these patches works well on my Mac! Thanks.

Note: See TracTickets for help on using tickets.