#8735 closed bug (fixed)

hpc crashes on platforms using dynamic linking

Reported by: George Owned by:
Priority: high Milestone: 7.8.1
Component: Code Coverage Version: 7.8.1-rc1
Keywords: Cc:
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description


Change History (10)

comment:1 Changed 18 months ago by George

hpc doesn't work:

 hpc --version
dyld: Library not loaded: @rpath/libHShpc-0.6.0.1-ghc7.8.20140130.dylib
  Referenced from: /usr/local/bin/hpc
  Reason: image not found
Trace/BPT trap: 5

this results in error popups when doing cabal install e.g. cabal install vector but this doesn't seem to affect the install

comment:2 Changed 18 months ago by carter

george, whats your ghc --info say?

mine has

» ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","gcc-4.8")
 ,("C compiler flags"," -m64 -fno-stack-protector")
 ,("C compiler link flags"," -m64")
 ,("ld command","/usr/bin/ld")
 ,("ld flags"," -arch x86_64")
 ,("ld supports compact unwind","YES")
 ,("ld supports build-id","NO")
 ,("ld supports filelist","YES")
 ,("ld is GNU ld","NO")
 ,("ar command","/usr/bin/ar")
 ,("ar flags","clqs")
 ,("ar supports at file","NO")
 ,("touch command","touch")
 ,("dllwrap command","/bin/false")
 ,("windres command","/bin/false")
 ,("libtool command","libtool")
 ,("perl command","/usr/bin/perl")
 ,("target os","OSDarwin")
 ,("target arch","ArchX86_64")
 ,("target word size","8")
 ,("target has GNU nonexec stack","False")
 ,("target has .ident directive","True")
 ,("target has subsections via symbols","True")
 ,("Unregisterised","NO")
 ,("LLVM llc command","/usr/local/bin/llc-3.4")
 ,("LLVM opt command","/usr/local/bin/opt-3.4")
 ,("Project version","7.8.20140130")
 ,("Booter version","7.6.3")
 ,("Stage","2")
 ,("Build platform","x86_64-apple-darwin")
 ,("Host platform","x86_64-apple-darwin")
 ,("Target platform","x86_64-apple-darwin")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug thr thr_debug thr_l  dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn")
 ,("Support dynamic-too","YES")
 ,("Support parallel --make","YES")
 ,("Dynamic by default","NO")
 ,("GHC Dynamic","YES")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ,("LibDir","/usr/local/lib/ghc-7.8.20140130")
 ,("Global Package DB","/usr/local/lib/ghc-7.8.20140130/package.conf.d")
 ]

(i'm using my own RC build rather than Austin's)

could you paste your "ghc --info" please?

comment:3 Changed 18 months ago by George

OS 10.9.1 xcode 5.0.2

ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","/usr/local/bin/gcc")
 ,("C compiler flags"," -m64 -fno-stack-protector")
 ,("C compiler link flags"," -m64")
 ,("ld command","/usr/bin/ld")
 ,("ld flags"," -arch x86_64")
 ,("ld supports compact unwind","YES")
 ,("ld supports build-id","NO")
 ,("ld supports filelist","YES")
 ,("ld is GNU ld","NO")
 ,("ar command","/usr/bin/ar")
 ,("ar flags","clqs")
 ,("ar supports at file","@ArSupportsAtFile@")
 ,("touch command","touch")
 ,("dllwrap command","/bin/false")
 ,("windres command","/bin/false")
 ,("libtool command","libtool")
 ,("perl command","/usr/bin/perl")
 ,("target os","OSDarwin")
 ,("target arch","ArchX86_64")
 ,("target word size","8")
 ,("target has GNU nonexec stack","False")
 ,("target has .ident directive","True")
 ,("target has subsections via symbols","True")
 ,("Unregisterised","NO")
 ,("LLVM llc command","llc")
 ,("LLVM opt command","opt")
 ,("Project version","7.8.20140130")
 ,("Booter version","7.6.3")
 ,("Stage","2")
 ,("Build platform","x86_64-apple-darwin")
 ,("Host platform","x86_64-apple-darwin")
 ,("Target platform","x86_64-apple-darwin")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn")
 ,("Support dynamic-too","YES")
 ,("Support parallel --make","YES")
 ,("Dynamic by default","NO")
 ,("GHC Dynamic","YES")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ,("LibDir","/usr/local/lib/ghc-7.8.20140130")
 ,("Global Package DB","/usr/local/lib/ghc-7.8.20140130/package.conf.d")
 ]

comment:4 Changed 18 months ago by nomeata

This is not specific to mac; the problem is that a dynamically linked file, which finds its libraries via rpath, is installed into the system-wide bin.

I believe you need a patch like

Index: ghc-7.9.20140130/utils/hpc/ghc.mk
===================================================================
--- ghc-7.9.20140130.orig/utils/hpc/ghc.mk	2014-01-31 17:28:32.000000000 +0000
+++ ghc-7.9.20140130/utils/hpc/ghc.mk	2014-02-04 23:15:53.000000000 +0000
@@ -15,4 +15,7 @@
 utils/hpc_dist-install_INSTALL         = YES
 utils/hpc_dist-install_INSTALL_INPLACE = YES
 utils/hpc_dist-install_PROGNAME        = hpc
+utils/hpc_dist-install_SHELL_WRAPPER   = YES
+utils/hpc_dist-install_INSTALL_SHELL_WRAPPER_NAME = hpc
+
 $(eval $(call build-prog,utils/hpc,dist-install,1))
Index: ghc-7.9.20140130/utils/hpc/hpc.wrapper
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ ghc-7.9.20140130/utils/hpc/hpc.wrapper	2014-02-04 23:17:49.000000000 +0000
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "$executablename" ${1+"$@"}

or something nicer.

(from http://anonscm.debian.org/darcs/pkg-haskell/ghc/patches/hpc-wrapper )

comment:5 Changed 18 months ago by George

  • Priority changed from normal to high

Thanks very much.

I assume we need a working hpc for 7.8.1 thus making the priority high

comment:6 Changed 18 months ago by George

  • Summary changed from hpc doesn't work on Mac to hpc doesn't work on platforms using dynamic linking

comment:7 Changed 18 months ago by George

  • Summary changed from hpc doesn't work on platforms using dynamic linking to hpc crashes on platforms using dynamic linking

comment:8 Changed 18 months ago by Austin Seipp <austin@…>

In a365eabd465a1700f479f78ad99fc1a31915e639/ghc:

Fix installation of hpc (#8735)

Signed-off-by: Austin Seipp <[email protected]>

comment:9 Changed 18 months ago by thoughtpolice

  • Status changed from new to merge

comment:10 Changed 18 months ago by thoughtpolice

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

Merged in 7.8.

Note: See TracTickets for help on using tickets.