[GHC] #15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory

GHC ghc-devs at haskell.org
Tue Jul 17 06:08:34 UTC 2018


#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory
-------------------------------------+-------------------------------------
           Reporter:  tmcdonell      |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  None           |           Version:
           Keywords:                 |  Operating System:  MacOS X
       Architecture:                 |   Type of failure:  Installing GHC
  Unknown/Multiple                   |  failed
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 It is very difficult to install the ghc-8.6.1 release candidates (both RC1
 and RC2) on MacOS because several components attempt to link directly to
 `/usr/local/opt/gmp/lib/libgmp.10.dylib`. This is not a standard path.

 See the offending `LC_LOAD_DYLIB` command here:

 {{{
 $ jtool -l libraries/base/dist-
 install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib
 LC 00: LC_SEGMENT_64          Mem: 0x000000000-0x4e1000 __TEXT
         Mem: 0x0000010b0-0x0004d12ba            __TEXT.__text   (Normal)
         Mem: 0x0004d12ba-0x0004d1686            __TEXT.__stubs  (Symbol
 Stubs)
         Mem: 0x0004d1688-0x0004d1cee            __TEXT.__stub_helper
 (Normal)
         Mem: 0x0004d1cee-0x0004df75b            __TEXT.__cstring
 (C-String Literals)
         Mem: 0x0004df760-0x0004e0f40            __TEXT.__const
         Mem: 0x0004e0f40-0x0004e1000            __TEXT.__unwind_info
 LC 01: LC_SEGMENT_64          Mem: 0x0004e1000-0x5a7000 __DATA
         Mem: 0x0004e1000-0x0004e30f0            __DATA.__got    (Non-Lazy
 Symbol Ptrs)
         Mem: 0x0004e30f0-0x0004e3100            __DATA.__nl_symbol_ptr
 (Non-Lazy Symbol Ptrs)
         Mem: 0x0004e3100-0x0004e3610            __DATA.__la_symbol_ptr
 (Lazy Symbol Ptrs)
         Mem: 0x0004e3610-0x0004e3618            __DATA.__mod_init_func
 (Module Init Function Ptrs)
         Mem: 0x0004e3620-0x0004f4bc0            __DATA.__const
         Mem: 0x0004f4bc0-0x0005a6920            __DATA.__data
         Mem: 0x0005a6920-0x0005a6928            __DATA.__bss    (Zero
 Fill)
 LC 02: LC_SEGMENT_64          Mem: 0x0005a7000-0xb8c000 __LINKEDIT
 LC 03: LC_ID_DYLIB
 @rpath/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib
 LC 04: LC_DYLD_INFO
 LC 05: LC_SYMTAB
         Symbol table is at offset 0x6a5348 (6968136), 118090 entries
         String table is at offset 0x873d78 (8863096), 3241616 bytes
 LC 06: LC_DYSYMTAB
         81438 local symbols at index     0
         35948 external symbols at index  81438
           704 undefined symbols at index 117386
            No TOC
            No modtab
          1380 Indirect symbols at offset 0x8727e8

 LC 07: LC_UUID                  UUID: B4C0C347-131F-317B-BA52-EE23F5C5CABA
 LC 08: LC_VERSION_MIN_MACOSX    Minimum OS X version:    10.12.0
 LC 09: LC_SOURCE_VERSION        Source Version:          0.0.0.0.0
 LC 10: LC_LOAD_DYLIB            /usr/lib/libiconv.2.dylib
 LC 11: LC_LOAD_DYLIB            @rpath/libHSinteger-
 gmp-1.0.2.0-ghc8.6.0.20180714.dylib
 LC 12: LC_LOAD_DYLIB            @rpath/libHSghc-
 prim-0.5.3-ghc8.6.0.20180714.dylib
 LC 13: LC_LOAD_DYLIB            /usr/local/opt/gmp/lib/libgmp.10.dylib
 LC 14: LC_LOAD_DYLIB            /usr/lib/libSystem.B.dylib
 LC 15: LC_RPATH                 @loader_path/../integer-gmp-1.0.2.0
 LC 16: LC_RPATH                 @loader_path/../ghc-prim-0.5.3
 LC 17: LC_RPATH                 @loader_path/../rts
 LC 18: LC_FUNCTION_STARTS       Offset: 6876632, Size: 91504
 (0x68edd8-0x6a5348) with 83924 functions
 LC 19: LC_DATA_IN_CODE          Offset: 6968136, Size: 0
 (0x6a5348-0x6a5348)
 }}}

 The other offenders are `libHSbinary` and `libHSinteger-gmp`.

 Without changing these load commands, you'll get the following error:

 {{{
 $ ./configure --prefix=...
 $ make install
 <snip>
 dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
   Referenced from: ./libraries/base/dist-
 install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib
   Reason: image not found
 make[1]: *** [install_packages] Abort trap: 6
 make: *** [install] Error 2
 }}}

 I tried passing the `--with-gmp-libraries` option to `configure`, but that
 did not help.

 I guess this is just a packaging problem, but figured you should be aware
 before the official release...

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15404>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list