Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan | Owner: igloo Type: feature request | Status: closed Priority: low | Milestone: 7.6.2 Component: Package system |Version: 6.10.1 Resolution: fixed| Keywords: Os: Linux| Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: |Related: --+- Changes (by PHO): * cc: pho@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs -+-- Reporter: duncan| Owner: igloo Type: feature request | Status: new Priority: low | Milestone: 7.6.2 Component: Package system| Version: 6.10.1 Keywords:| Os: Linux Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown |Testcase: Blockedby:|Blocking: Related:| -+-- Comment(by ian@…): commit 7dd7008f98c76024288899b8cea607141c91ada5 {{{ Author: Ian Lynagh i...@well-typed.com Date: Thu Nov 8 21:46:46 2012 + Give dynamic libraries, as well as programs, RPATHs Based on a patch from markwright in #3072. rules/build-package-way.mk |4 ++-- rules/build-prog.mk| 25 - rules/distdir-way-opts.mk | 12 3 files changed, 26 insertions(+), 15 deletions(-) }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan | Owner: igloo Type: feature request | Status: closed Priority: low | Milestone: 7.6.2 Component: Package system |Version: 6.10.1 Resolution: fixed| Keywords: Os: Linux| Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: |Related: --+- Changes (by igloo): * status: new = closed * resolution: = fixed Comment: I think we now do as much as we can, so I'm closing this ticket. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan| Type: feature request Status: new | Priority: low Milestone: 7.6.2 | Component: Package system Version: 6.10.1| Keywords: Os: Linux | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase:| Blockedby: Blocking:|Related: --+- Comment(by simonmar): @markwright: will this work when the libraries are in the build tree, or only when installed? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan| Type: feature request Status: new | Priority: low Milestone: 7.6.2 | Component: Package system Version: 6.10.1| Keywords: Os: Linux | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase:| Blockedby: Blocking:|Related: --+- Comment(by markwright): Replying to [comment:14 simonmar]: @markwright: will this work when the libraries are in the build tree, or only when installed? Only when they are installed (where it works great, I built 170 pkgs from hackage using in the Gentoo Haskell overlay with 7.7.20121102 using this patch with no LD_LIBRARY_PATH). In the build tree it can not find the libraries (of course a workaround would be to set LD_LIBRARY_PATH): {{{ argus (ghclive) ghc- $ env | grep LD_LIBRARY_PATH argus (ghclive) ghc- $ find . -type f -name libHScontainers*.so -print ./libraries/containers/dist- install/build/libHScontainers-0.5.0.0-ghc7.7.20121102.so argus (ghclive) ghc- $ ldd libraries/containers/dist- install/build/libHScontainers-0.5.0.0-ghc7.7.20121102.so linux-vdso.so.1 (0x7fffae782000) libHSdeepseq-1.3.0.1-ghc7.7.20121102.so = not found libHSarray-0.4.0.1-ghc7.7.20121102.so = not found libHSbase-4.6.0.0-ghc7.7.20121102.so = not found libHSinteger-gmp-0.5.0.0-ghc7.7.20121102.so = not found libgmp.so.10 = /usr/lib64/libgmp.so.10 (0x7f36da50e000) libHSghc-prim-0.3.0.0-ghc7.7.20121102.so = not found libc.so.6 = /lib64/libc.so.6 (0x7f36da168000) /lib64/ld-linux-x86-64.so.2 (0x7f36dab6e000) argus (ghclive) ghc- $ }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs -+-- Reporter: duncan| Owner: igloo Type: feature request | Status: new Priority: low | Milestone: 7.6.2 Component: Package system| Version: 6.10.1 Keywords:| Os: Linux Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown |Testcase: Blockedby:|Blocking: Related:| -+-- Changes (by igloo): * owner: = igloo -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan| Type: feature request Status: new | Priority: low Milestone: 7.6.2 | Component: Package system Version: 6.10.1| Keywords: Os: Linux | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase:| Blockedby: Blocking:|Related: --+- Comment(by markwright): From: [http://hackage.haskell.org/trac/ghc/ticket/7062#comment:21] GHC libraries do not set a RUNPATH or RPATH tag for other GHC libraries they depend on I attached ghc-7.7.20121101-corelibs-rpath.patch to set the rpath in the ghc core libs, so they look like: {{{ $ readelf --dynamic /usr/lib64/ghc-7.7.20121101/containers-0.5.0.0/libHScontainers-0.5.0.0-ghc7.7.20121101.so Dynamic section at offset 0x1c37f0 contains 35 entries: TagType Name/Value 0x0001 (NEEDED) Shared library: [libHSdeepseq-1.3.0.1-ghc7.7.20121101.so] 0x0001 (NEEDED) Shared library: [libHSarray-0.4.0.1-ghc7.7.20121101.so] 0x0001 (NEEDED) Shared library: [libHSbase-4.6.0.0-ghc7.7.20121101.so] 0x0001 (NEEDED) Shared library: [libHSinteger- gmp-0.5.0.0-ghc7.7.20121101.so] 0x0001 (NEEDED) Shared library: [libgmp.so.10] 0x0001 (NEEDED) Shared library: [libHSghc- prim-0.3.0.0-ghc7.7.20121101.so] 0x0001 (NEEDED) Shared library: [libc.so.6] 0x000e (SONAME) Library soname: [libHScontainers-0.5.0.0-ghc7.7.20121101.so] 0x0010 (SYMBOLIC) 0x0 0x000f (RPATH) Library rpath: [$ORIGIN/../deepseq-1.3.0.1:$ORIGIN/../array-0.4.0.1:$ORIGIN/../base-4.6.0.0:$ORIGIN /../integer-gmp-0.5.0.0:$ORIGIN/../ghc-prim-0.3.0.0:$ORIGIN/../rts-1.0] 0x001d (RUNPATH)Library runpath: [$ORIGIN/../deepseq-1.3.0.1:$ORIGIN/../array-0.4.0.1:$ORIGIN/../base-4.6.0.0:$ORIGIN /../integer-gmp-0.5.0.0:$ORIGIN/../ghc-prim-0.3.0.0:$ORIGIN/../rts-1.0] ... snip ... $ }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs ---+ Reporter: duncan| Type: feature request Status: new | Priority: normal Milestone: 7.2.1 | Component: Package system Version: 6.10.1| Keywords: Testcase:| Blockedby: Difficulty: Unknown | Os: Linux Blocking:| Architecture: Unknown/Multiple Failure: None/Unknown | ---+ Comment(by duncan): See [wiki:SharedLibraries/Management#OnWindows]. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan | Owner: Type: feature request | Status: new Priority: normal | Milestone: 6.14.1 Component: Package system |Version: 6.10.1 Resolution: | Keywords: Difficulty: Unknown | Os: Linux Testcase: | Architecture: Unknown/Multiple Failure: None/Unknown | --+- Changes (by igloo): * failure: = None/Unknown * milestone: 6.12.1 = 6.14.1 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan | Owner: Type: feature request | Status: new Priority: normal | Milestone: 6.14.1 Component: Package system |Version: 6.10.1 Resolution: | Keywords: Difficulty: Unknown | Os: Linux Testcase: | Architecture: Unknown/Multiple Failure: None/Unknown | --+- Comment (by igloo): See also #3268. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs -+-- Reporter: duncan|Owner: Type: feature request | Status: new Priority: normal|Milestone: 6.12.1 Component: Package system| Version: 6.10.1 Severity: normal| Resolution: Keywords:| Difficulty: Unknown Testcase:| Os: Linux Architecture: Unknown/Multiple | -+-- Changes (by ross): * type: proposal = feature request -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs -+-- Reporter: duncan|Owner: Type: proposal | Status: new Priority: normal|Milestone: 6.12.1 Component: None | Version: 6.10.1 Severity: normal| Resolution: Keywords:| Difficulty: Unknown Testcase:| Os: Linux Architecture: Unknown/Multiple | -+-- Changes (by igloo): * difficulty: = Unknown * milestone: = 6.12.1 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs -+-- Reporter: duncan| Owner: Type: proposal | Status: new Priority: normal| Component: None Version: 6.10.1| Severity: normal Keywords:| Testcase: Os: Linux | Architecture: Unknown/Multiple -+-- Some thought needs to be put into how to manage shared libs on the various platforms we support. Sadly the solution is likely to be different on Windows vs OSX vs ELF-format platforms. For ELF platforms our current idea is to put all shared libs in `/usr{/local}/lib` with names like `libHSfoo-x.y.z-ghc-a.b.c.so`. Having them all in the system dir like that has it's downsides and it does not work for per-user installs. If we want to have multiple instances of the same version of a lib then it's even more problematic. All ELF linkers support the RPATH/RUNPATH mechanism for executables and shared libs to locate each other without them having to be on the standard linker path. This basically involves embedding the path in them at link time. It must be acknowledged that some linux distributions eschew the use of rpath for various reasons. We must take that into consideration. Also we must consider relocatable/redistributable binaries... The GNU and Solaris linkers support an extension which allows the above mechanism to work, even for relocatable binaries (so long as the libs are kept relative to the executable). Basically one can set an rpath that uses `$ORIGIN` and at runtime the `$ORIGIN` is substituted for the file system location of the executable or shared lib in question. Note that on Linux at least the `$ORIGIN` is always passed by the kernel so that the dynamic linker can resolve it. See the attached program which demonstrates this. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3072: considerations for management of shared libs
#3072: considerations for management of shared libs --+- Reporter: duncan| Owner: Type: proposal | Status: new Priority: normal| Milestone: Component: None |Version: 6.10.1 Severity: normal| Resolution: Keywords:| Testcase: Os: Linux | Architecture: Unknown/Multiple --+- Comment (by duncan): Should have linked to the docs for `$ORIGIN`: Solaris: http://docs.sun.com/app/docs/doc/805-3050/6j2tng0mg?l=koa=view Solaris and Linux: http://www.scons.org/wiki/UsingOrigin GNU man ld.so {{{ $ORIGIN and rpath ld.so understands the string $ORIGIN (or equivalently ${ORIGIN}) in an rpath specification (DT_RPATH or DT_RUNPATH) to mean the directory con‐ taining the application executable. Thus, an application located in somedir/app could be compiled with gcc -Wl,-rpath,'$ORIGIN/../lib' so that it finds an associated shared library in somedir/lib no matter where somedir is located in the directory hierarchy. This facilitates the creation of turn-key applications that do not need to be installed into special directories, but can instead be unpacked into any directory and still find their own shared libraries. }}} This may also be useful for binary distributions of ghc that use shared libs. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3072#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs