Opened 5 years ago

Closed 5 years ago

#10015 closed feature request (fixed)

Give the DLL loader awareness of rpaths

Reported by: joelteon Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.8.4
Keywords: Cc:
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This is nix-related. I'm trying to build with the nix version of libiconv instead of system libiconv, and to facilitate this I'm running package builds in a sandbox.

If I try to compile a module using TemplateHaskell, say

module Main where

main :: IO ()
main = putStrLn $([|"Hello, world!"|])

I get this from ghc --make:

[1 of 1] Compiling Main ( main.hs, main.o ) Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... <command line>: can't load .so/.DLL for: libiconv.dylib (dlopen(libiconv.dylib, 9): no suitable image found. Did find:

/usr/lib/libiconv.dylib: stat() failed with errno=1)

When of course I'd rather it just try to dlopen /nix/store/lsvxsyw9w17d2rix740akjxyxcacgi3k-libiconv-41/lib/libiconv.dylib, the one it was built with.

Change History (1)

comment:1 Changed 5 years ago by joelteon

Resolution: fixed
Status: newclosed

Heh, this is my silly mistake. After looking at Linker.hs, I found that the first place the loader searches is in extra-lib-dirs, so I added the libiconv directory to that for base.

Note: See TracTickets for help on using tickets.