Linker change in GHC 7.8 leads to widespread issues

Yitzchak Gale gale at sefer.org
Sun Dec 7 19:03:01 UTC 2014


I wrote:
> Aha! Thanks [to Bryan] for this explanation of what I have been
> suffering from...
> I can't wait for the point releases. I'll go with HEAD on one
> of the branches for now.

Unfortunately, this patch did *not* fix what I have been suffering from.
I'm still getting segfaults.

I'll describe what I'm doing. Please let me know if either of the two
problems below are actual problems, or if I'm just missing something.
I'll submit them as issues if they are problems.

Sample code: http://github.com/ygale/test-text-icu

The following procedure worked fine for 32 bit Windows versions of
GHC previous to 7.8.* and with all recent versions of cabal-install.

Using Haskell Platform 2014.2.0.0 (GHC 7.8.3) 64 bit on Windows 7.
Using rev. caf257cd96e766b293943bbac07d766ec2f552dd of cabal,
the latest rev. at the moment, on the 1.20 branch. I locally changed
the version numbers in the cabal files of both Cabal and cabal-install
so I could verify that I really am using cabal.exe from that revision.
I verified in the source code that the -fPIC fix is included.

Clone the above sample code, and unzip ICU4C 54.1 (currently the latest)
for 64 bit Windows in a nearby folder.

***Problem #1 (minor): Relative linker paths don't work anymore

cabal sandbox init
cabal install --extra-lib-dirs=..\relative\path\to\icu\lib64
--extra-include-dirs=..\relative\path\to\icu\include text-icu

This fails with:

Warning: 'extra-lib-dirs: ../relative/path/to/icu/lib64' directory
does not exist.
Warning: 'include-dirs: ../relative/path/to/icu/include' directory
does not exist.
cabal: Missing dependencies on foreign libraries:
* Missing C libraries: icuuc, icuin, icudt

Note: The same problem occurs if you copy the ICU folders into the
source tree. That just gets rid of the warnings that sdist won't work.

***Problem #2 (major): segfault!

cabal install --extra-lib-dirs=C:\absolute\path\to\icu\lib64
--extra-include-dirs=C:\absolute\path\to\icu\include text-icu
cabal install

Now, place .cabal-sandbox\bin\test-text-icu.exe together with the 3 DLLs
icudt54.dll, icuin54.dll, and icuuc54.dll from icu\bin64 all together in the
same folder.
Run test-text-icu.

Kaboom!

Note: The same problem occurs if you place *all* of the DLLs from
icu\bin64 in the folder together with the exe. So it's not a missing DLL.

Thanks,
Yitz


More information about the ghc-devs mailing list