Open 4e6 opened 6 years ago
I tried your text-icu-static-example
on macOS with latest text
(had to bump the <2
bound) and text-icu
. However, on macOS static linking does not seem to be supported generally:
$ cabal build --enable-executable-static
...
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ghc-9.4.2: `gcc' failed in phase `Linker'. (Exit code: 1)
Does the problem still persists on Linux?
I just happened to run into this as well. Adding:
build-depends: double-conversion
Seems to fix it
I'm trying to create a static executable which depends on text-icu.
Here is the minified example https://github.com/4e6/text-icu-static-example
To enable static linking, I build
icu
with--enable-static
flag here:And add following ghc options here:
As a result of
nix-build .
, I'm getting a lot of errors about undefined references, see nix-build.log:This setup works with other libraries but fails with
text-icu
. Any ideas on what I'm doing wrong?