Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 50c488e

Browse filesBrowse files
authored
Merge pull request simplex-chat#1 from simplex-chat/sh/t
simplex: android-static
2 parents fdafe46 + 73d25e6 commit 50c488e
Copy full SHA for 50c488e

File tree

6 files changed

+66
-6
lines changed
Filter options

6 files changed

+66
-6
lines changed

‎builder/comp-builder.nix

Copy file name to clipboardExpand all lines: builder/comp-builder.nix
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,12 @@ let
442442
'' else if stdenv.hostPlatform.isGhcjs then ''
443443
runHook preBuild
444444
# https://gitlab.haskell.org/ghc/ghc/issues/9221
445-
$SETUP_HS build ${haskellLib.componentTarget componentId} ${lib.concatStringsSep " " setupBuildFlags}
445+
$SETUP_HS build ${haskellLib.componentTarget componentId} ${lib.concatStringsSep " " (component.setupBuildFlags ++ setupBuildFlags)}
446446
runHook postBuild
447447
'' else ''
448448
runHook preBuild
449449
# https://gitlab.haskell.org/ghc/ghc/issues/9221
450-
$SETUP_HS build ${haskellLib.componentTarget componentId} -j$(($NIX_BUILD_CORES > 4 ? 4 : $NIX_BUILD_CORES)) ${lib.concatStringsSep " " setupBuildFlags}
450+
$SETUP_HS build ${haskellLib.componentTarget componentId} -j$(($NIX_BUILD_CORES > 4 ? 4 : $NIX_BUILD_CORES)) ${lib.concatStringsSep " " (component.setupBuildFlags ++ setupBuildFlags)}
451451
runHook postBuild
452452
'');
453453

‎modules/plan.nix

Copy file name to clipboardExpand all lines: modules/plan.nix
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ let
253253
'';
254254
};
255255
planned = mkOption {
256-
description = "Set to true by `plan-to-nix` for any component that was included in the `plan.json` file.";
256+
description = "Set to true by `plan-to-nix` for any component that was included in the `plan.json` file.";
257257
# This is here so that (rather than in componentOptions) so it can be set project wide for stack projects
258258
type = bool;
259259
default = def.planned or false;

‎overlays/android.nix

Copy file name to clipboardExpand all lines: overlays/android.nix
+12-3Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,27 @@ 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+
numactl = prev.numactl.overrideAttrs (attrs: {
30+
patches = (attrs.patches or []) ++ [ ./patches/numactl-2.0.14-no-librt.patch ];
31+
});
32+
openssl = prev.openssl_1_1;
2633
}) // prev.lib.optionalAttrs prev.stdenv.targetPlatform.isAndroid ({
27-
bionic = prev.bionic.override { enableStatic = true; };
34+
# we still need the shared libraries to link against on the platform. GHC
35+
# has been neutered to not even try loading shared libs and will use dynamic ones.
36+
bionic = prev.bionic.override { enableStatic = true; enableShared = true; };
2837
})

‎overlays/bootstrap.nix

Copy file name to clipboardExpand all lines: overlays/bootstrap.nix
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ in {
227227
++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "9.0" && final.targetPlatform.isAndroid) ./patches/ghc/ghc-8.10.7-linker-weak-and-common.patch
228228
++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "9.0" && final.targetPlatform.isAndroid) ./patches/ghc/libc-memory-symbols.patch
229229
++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "9.0" && final.targetPlatform.isAndroid) ./patches/ghc/android-base-needs-iconv.patch
230+
++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "9.0" && final.targetPlatform.isAndroid) ./patches/ghc/ghc-8.10.7-weak-symbols-2.patch
230231
;
231232
in ({
232233
ghc844 = final.callPackage ../compiler/ghc (traceWarnOld "8.4" {
+37Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
diff --git a/rts/Linker.c b/rts/Linker.c
2+
index 727fe74..12a22d7 100644
3+
--- a/rts/Linker.c
4+
+++ b/rts/Linker.c
5+
@@ -1810,6 +1810,8 @@ static HsInt resolveObjs_ (void)
6+
IF_DEBUG(linker, debugBelch("resolveObjs: start\n"));
7+
8+
for (ObjectCode *oc = objects; oc; oc = oc->next) {
9+
+ if(oc->status == OBJECT_RESOLVED)
10+
+ continue;
11+
int r = ocTryLoad(oc);
12+
if (!r)
13+
{
14+
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c
15+
index c3f9110..1b497af 100644
16+
--- a/rts/linker/Elf.c
17+
+++ b/rts/linker/Elf.c
18+
@@ -963,10 +963,15 @@ ocGetNames_ELF ( ObjectCode* oc )
19+
stab[j].st_size, stab[j].st_value, nm);
20+
}
21+
*/
22+
- symbol->addr = (SymbolAddr*)(
23+
- (intptr_t) oc->sections[secno].start +
24+
- (intptr_t) symbol->elf_sym->st_value);
25+
- ASSERT(symbol->addr != 0x0);
26+
+ if(shndx == SHN_UNDEF && ELF_ST_BIND(symbol->elf_sym->st_info) == STB_WEAK) {
27+
+ symbol->addr = NULL;
28+
+ } else {
29+
+ symbol->addr = (SymbolAddr*)(
30+
+ (intptr_t) oc->sections[secno].start +
31+
+ (intptr_t) symbol->elf_sym->st_value);
32+
+ ASSERT(symbol->addr != 0x0);
33+
+ }
34+
+
35+
if (ELF_ST_BIND(symbol->elf_sym->st_info) == STB_LOCAL) {
36+
isLocal = true;
37+
isWeak = false;
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/Makefile.am b/Makefile.am
2+
index 44d0d76..1181ca5 100644
3+
--- a/Makefile.am
4+
+++ b/Makefile.am
5+
@@ -34,7 +34,7 @@ migratepages_SOURCES = migratepages.c util.c
6+
migratepages_LDADD = libnuma.la
7+
8+
migspeed_SOURCES = migspeed.c util.c
9+
-migspeed_LDADD = libnuma.la -lrt
10+
+migspeed_LDADD = libnuma.la
11+
12+
memhog_SOURCES = memhog.c util.c
13+
memhog_LDADD = libnuma.la

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.