Opened 4 years ago

Closed 4 years ago

#8194 closed bug (fixed)

make install (at git ef01794) still fails

Reported by: guest Owned by: bos
Priority: highest Milestone: 7.8.1
Component: Build System Version: 7.7
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Installing GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I think the last time make install worked for me was sometime in February or March 2013. The build succeeds but make install fails.


BuildFlavour = perf
V = 0

Steps to reproduce:

$ perl boot
$ ./configure --prefix=/tmp/ghc/7.7.20130827
$ make
$ make install
Installing library in
"/tmp/ghc/7.7.20130827/lib/ghc-7.7.20130827/bin/ghc-pkg" --force
"/tmp/ghc/7.7.20130827/lib/ghc-7.7.20130827/package.conf.d" update
/tmp/ghc/7.7.20130827/lib/ghc-7.7.20130827/bin/ghc-pkg: error while
loading shared libraries: cannot open shared
object file: No such file or directory

make[1]: *** [install_packages] Error 127
make: *** [install] Error 2

Related mailing list threads:

Change History (11)

comment:1 Changed 4 years ago by ezyang

Priority: normalhighest

Probably this is due to dynamic GHC; after the shared libraries are installed ghc-pkg can no longer find them. The proper way to do this is to register the libraries with the system dynamic linker; someone should figure out how to do this in a packager friendly way.

comment:2 Changed 4 years ago by guest

So you think some change in 7.7 caused this, right?

I haven't heard of anyone else hit the same issue, and it would great if someone else could verify the issue with the same i386 toolchain.

Should I modify to disable shared libs for now, or is that something you would discourage me from doing?

Version 0, edited 4 years ago by guest (next)

comment:3 Changed 4 years ago by rrnewton

I have the same problem. I assume everyone does then and the dynamic-libs switch is just a work-in-progress?

comment:4 Changed 4 years ago by ezyang

Well, I couldn't get GHC to build not dynamic-by-default. IIRC, we're planning on shipping 7.8 with dynamic-by-default GHC, so this is a major blocker on the way there.

comment:5 Changed 4 years ago by bos

This is affecting me, too. I'm trying to use a perf build.

The problem appears to be that we do not install any shared libraries for packages during "make install".

~/git/ghc $ ldd /usr/local/ghc/head/lib/ghc-7.7.20130912/bin/ghc-pkg =>  (0x00007fff269fe000) => /usr/local/ghc/head/lib/ghc-7.7.20130912/bin/../terminfo- (0x00007f189275f000) => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found => not found

Sure enough, if I look for in the source tree, it's there, but there is no sign of it in /usr/local/ghc/head/lib/ghc-7.7.20130912/bin-package-db- - the static libraries are there, but *not* the shared.

~/git/ghc $ ls /usr/local/ghc/head/lib/ghc-7.7.20130912/bin-package-db-

comment:6 Changed 4 years ago by bos

The problem here is simple: inplace/bin/ghc-cabal does not know about shared libraries.

Here is a simple, and incorrect, patch that makes it unconditionally install shared libraries. With this hack in place, make install succeeds, and the installed code actually works.

--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -172,7 +172,8 @@ doCopy directory distDir
             progs' <- configureProgram verbosity stripProgram' progs
             let lbi' = lbi {
                                withPrograms = progs',
-                               installDirTemplates = idts
+                               installDirTemplates = idts,
+                               withSharedLib = True
             f pd lbi' us flags

The correct fix is probably to pass another parameter to ghc-cabal that tells it if we're building shared libraries, so that it can set withSharedLib appropriately.

Weird followon observation: we copy two versions of many utilities into the install tree. There are statically linked versions in the main bin directory, and dynamically linked versions under lib/ghc-VERSION/bin. (It is the dynamically linked copy of lib/ghc-VERSION/bin/ghc-pkg that is crashing due to lack of shared libraries during the install.)

I don't understand why there are two versions?

comment:7 Changed 4 years ago by bos

Owner: set to hvr

comment:8 Changed 4 years ago by bos

Status: newpatch

Patch at - will push unless someone grumbles.

comment:9 Changed 4 years ago by bos

Owner: changed from hvr to bos

comment:10 Changed 4 years ago by Bryan O'Sullivan <bryano@…>

In 865956a6ccd88e71aa07a33667242b95ecf98793/ghc:

Cause "make install" to install dynamic libraries (#8194)

Our special ghc-cabal command needs to be told that we are building with
dynamic library support when it does its copying. We do so by passing an
extra parameter from

comment:11 Changed 4 years ago by bos

Resolution: fixed
Status: patchclosed
Note: See TracTickets for help on using tickets.