
#8713: Avoid libraries if unneeded (librt, libdl, libpthread) -------------------------------------+------------------------------------- Reporter: ip1981 | Owner: Type: bug | Status: upstream Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Other | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Moderate (less Test Case: | than a day) Blocking: | Blocked By: Differential Revisions: | Related Tickets: -------------------------------------+------------------------------------- Comment (by kgardas): Hi, sorry for getting to this rather later, but as Solaris user I'm curious how the patches will affect common Solaris 11/10. For example on Solaris 11.1 which I'm using now, I don't see this issue with GHC 7.6.3: {{{ $ /opt/ghc-7.6.3/bin/ghci -threaded GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Warning: -debug, -threaded and -ticky are ignored by GHCi Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading object (dynamic) /lib/librt.so ... done final link ... done Prelude> }}} it looks like dyson here diverges from common Solaris probably since if I for example check libdl, then I see it defined and containing functions: {{{ $ nm /lib/libdl.so.1 /lib/libdl.so.1: [Index] Value Size Type Bind Other Shndx Name [4] | 476| 0|SECT |LOCL |0 |3 | [9] | 0| 0|SECT |LOCL |0 |8 | [10] | 0| 0|SECT |LOCL |0 |9 | [11] | 0| 0|SECT |LOCL |0 |10 | [2] | 116| 0|SECT |LOCL |0 |1 | [3] | 340| 0|SECT |LOCL |0 |2 | [7] | 2088| 0|SECT |LOCL |0 |6 | [5] | 768| 0|SECT |LOCL |0 |4 | [6] | 1312| 0|SECT |LOCL |0 |5 | [8] | 2388| 0|SECT |LOCL |0 |7 | [31] | 0| 0|FUNC |GLOB |0 |ABS |_dladdr [35] | 0| 0|FUNC |GLOB |0 |ABS |_dladdr1 [37] | 0| 0|FUNC |GLOB |0 |ABS |_dlclose [19] | 0| 0|FUNC |GLOB |0 |ABS |_dldump [15] | 0| 0|FUNC |GLOB |0 |ABS |_dlerror [20] | 0| 0|FUNC |GLOB |0 |ABS |_dlinfo [18] | 0| 0|FUNC |GLOB |0 |ABS |_dlmopen [38] | 0| 0|FUNC |GLOB |0 |ABS |_dlopen [44] | 0| 0|FUNC |GLOB |0 |ABS |_dlsym [17] | 116| 0|OBJT |GLOB |0 |1 |_DYNAMIC [36] | 0| 0|OBJT |GLOB |0 |ABS |_edata [41] | 4096| 0|OBJT |GLOB |0 |7 |_end [12] | 4096| 0|OBJT |LOCL |2 |7 |_END_ [39] | 2456| 0|OBJT |GLOB |0 |7 |_etext [40] | 0| 0|FUNC |GLOB |0 |ABS |_ld_libc [46] | 0| 0|OBJT |GLOB |0 |ABS |_PROCEDURE_LINKAGE_TABLE_ [13] | 0| 0|OBJT |LOCL |2 |1 |_START_ [43] | 0| 0|FUNC |GLOB |0 |ABS |dl_iterate_phdr [42] | 0| 0|FUNC |GLOB |0 |ABS |dladdr [45] | 0| 0|FUNC |GLOB |0 |ABS |dladdr1 [33] | 0| 0|FUNC |GLOB |0 |ABS |dlclose [28] | 0| 0|FUNC |GLOB |0 |ABS |dldump [22] | 0| 0|FUNC |GLOB |0 |ABS |dlerror [32] | 0| 0|FUNC |GLOB |0 |ABS |dlinfo [25] | 0| 0|FUNC |GLOB |0 |ABS |dlmopen [14] | 0| 0|FUNC |GLOB |0 |ABS |dlopen [16] | 0| 0|FUNC |GLOB |0 |ABS |dlsym [1] | 0| 0|FILE |LOCL |0 |ABS |libdl.so.1 [27] | 0| 0|OBJT |GLOB |0 |ABS |SUNW_0.7 [29] | 0| 0|OBJT |GLOB |0 |ABS |SUNW_0.8 [21] | 0| 0|OBJT |GLOB |0 |ABS |SUNW_1.1 [23] | 0| 0|OBJT |GLOB |0 |ABS |SUNW_1.2 [24] | 0| 0|OBJT |GLOB |0 |ABS |SUNW_1.3 [26] | 0| 0|OBJT |GLOB |0 |ABS |SUNW_1.4 [30] | 0| 0|OBJT |GLOB |0 |ABS |SUNW_1.5 [34] | 0| 0|OBJT |GLOB |0 |ABS |SUNWprivate_1.1 }}} I understand the offered logic behind the change from AC_CHECK_LIB to AC_SEARCH_LIB, but I'm not sure if this is the best approach. Honestly I'm not sure if what Dyson does here is the correct thing or not. I'll try to merge your patches here and test on real Solaris 11 and see if breaks anything or not. Still if you are Dyson developer I would appreciate some in-depth info why you use libs this way, i.e. why you attempt to define libdl/librt as linker scripts instead of simply omitting them... Thanks Karel -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8713#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler