[GHC] #8902: Test for RTLD_NEXT, RTLD_DEFAULT broken on Linux

GHC ghc-devs at haskell.org
Fri Jul 4 12:35:16 UTC 2014


#8902: Test for RTLD_NEXT, RTLD_DEFAULT broken on Linux
-----------------------------------+------------------------------------
        Reporter:  trommler        |            Owner:
            Type:  bug             |           Status:  closed
        Priority:  low             |        Milestone:
       Component:  libraries/unix  |          Version:  7.8.1-rc2
      Resolution:  invalid         |         Keywords:
Operating System:  Linux           |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown    |       Difficulty:  Unknown
       Test Case:                  |       Blocked By:
        Blocking:                  |  Related Tickets:
-----------------------------------+------------------------------------
Changes (by thomie):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 The current behavior is correct.

 From
 [http://www.polarhome.com/service/man/generic.php?qf=dlsym&type=2&of=OpenSuSE&sf=3
 man dlsym]:

     "The symbols RTLD_DEFAULT and RTLD_NEXT are defined by <dlfcn.h> only
 when _GNU_SOURCE was defined before including it."

 From System/Posix/DynamicLinker/Prim.hsc:

     -- On some host (e.g. SuSe Linux 7.2) RTLD_NEXT is not visible
     -- without setting _GNU_SOURCE. Since we don't want to set this
     -- flag, here's a different solution: You can use the Haskell
     -- function 'haveRtldNext' to check wether the flag is available
     -- to you. Ideally, this will be optimized by the compiler so
     -- that it should be as efficient as an #ifdef.
     --    If you fail to test the flag and use it although it is
     -- undefined, 'packOneModuleFlag' will bomb.

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


More information about the ghc-tickets mailing list