Skip to content

Commit 044c767

Browse files
committed
Android: mostly static
1 parent 506208f commit 044c767

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

overlays/android.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,24 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isAndroid ({
1111
'';
1212
# my current thinking is that this is due to the android toolchain using r23, api30.
1313
});
14-
libffi = prev.libffi.overrideAttrs (_: {
14+
libffi = prev.libffi.overrideAttrs ( old: {
1515
dontDisableStatic = true;
16+
configureFlags = old.configureFlags ++ [ "--disable-shared" ];
1617

1718
hardeningDisable = [ "fortify" "stackprotector" "format" ];
1819
# see libiconv. We want to target a lower minsdk
1920
postConfigure = ''
2021
echo "#undef HAVE_MEMFD_CREATE" >> aarch64-unknown-linux-android/fficonfig.h
2122
'';
2223
});
23-
gmp6 = (prev.gmp6.override { withStatic = true; }).overrideAttrs(_: {
24+
gmp6 = (prev.gmp6.override { withStatic = true; }).overrideAttrs(old: {
2425
hardeningDisable = [ "fortify" "stackprotector" "format" ];
26+
configureFlags = old.configureFlags ++ [ "--disable-shared" ];
2527
});
28+
zlib = prev.zlib.override { shared = false; static = true; };
29+
2630
}) // prev.lib.optionalAttrs prev.stdenv.targetPlatform.isAndroid ({
27-
bionic = prev.bionic.override { enableStatic = true; };
31+
# we still need the shared libraries to link against on the platform. GHC
32+
# has been neutered to not even try loading shared libs and will use dynamic ones.
33+
bionic = prev.bionic.override { enableStatic = true; enableShared = true; };
2834
})

0 commit comments

Comments
 (0)