[Haskell-cafe] how ghc finds libgmp.so when linking

Johannes Waldmann johannes.waldmann at htwk-leipzig.de
Wed Apr 13 12:06:06 UTC 2016


I have some obsolete libgmp in /usr/lib,
and the correct one in /usr/local/lib,
but ghc does not find it,
resp., finds the /usr/lib one earlier,
and this is missing some symbols

In function `integer_gmp_mpn_xor_n':
wrappers.c:(.text+0x1761): undefined reference to `__gmpn_xor_n'

when I put  ghc ... -optl -Wl,--verbose   I see that:

SEARCH_DIR("/usr/i486-linux-gnu/lib32"); SEARCH_DIR("/usr/local/lib32");
SEARCH_DIR("/lib32"); SEARCH_DIR("/usr/lib32");
SEARCH_DIR("/usr/i486-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib");
SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");

but that's apparently not what's happening.

Is  ghc  changing this, and how can I work around it?

- J.W.

More information about the Haskell-Cafe mailing list