Skip to content

Commit

Permalink
Fix static binary creation
Browse files Browse the repository at this point in the history
cxxabi was not being embedded, and cxx was not being rewritten due
to two libraries being present and starting with `libcxx`.
  • Loading branch information
elopez committed Apr 5, 2024
1 parent 0ff592a commit d2fe129
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"--extra-lib-dirs=${zlib.static}/lib"
"--extra-lib-dirs=${stripDylib (libffi.overrideAttrs (_: { dontDisableStatic = true; }))}/lib"
"--extra-lib-dirs=${stripDylib (ncurses.override { enableStatic = true; })}/lib"
"--extra-lib-dirs=${stripDylib (libcxxabi)}/lib"
"--ghc-options=-pgml=${ccWorkaroundNix23138}/bin/cc-workaround-nix-23138"
]))
haskell.lib.dontHaddock
Expand Down Expand Up @@ -139,8 +140,8 @@
libs=$(${otool} -L $out/bin/hevm | tail -n +2 | sed 's/^[[:space:]]*//' | cut -d' ' -f1)
# get the paths for libcxx and libiconv
cxx=$(echo "$libs" | ${grep} '^/nix/store/.*-libcxx')
iconv=$(echo "$libs" | ${grep} '^/nix/store/.*-libiconv')
cxx=$(echo "$libs" | ${grep} '^/nix/store/.*-libcxx-')
iconv=$(echo "$libs" | ${grep} '^/nix/store/.*-libiconv-')
# rewrite /nix/... library paths to point to /usr/lib
chmod 777 $out/bin/hevm
Expand Down

0 comments on commit d2fe129

Please sign in to comment.