diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-03-06 03:07:26 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-03-06 03:07:26 +0000 |
commit | 309ca71983670ae4c9c901c75d16228215ba677a (patch) | |
tree | 4dc72a4a153486d86e427ac07b3eeb38b47e3eb3 /scripts/mcm-buildall.sh | |
parent | 69486f80aa725f73f34173595c26ab473db7925d (diff) | |
parent | 147afca1b8ff76145d3eedc1d131bf0a3ae93a9b (diff) | |
download | toybox-android-cts-11.0_r12.tar.gz |
Snap for 6269144 from 147afca1b8ff76145d3eedc1d131bf0a3ae93a9b to rvc-releaseandroid-vts-11.0_r9android-vts-11.0_r8android-vts-11.0_r7android-vts-11.0_r6android-vts-11.0_r5android-vts-11.0_r4android-vts-11.0_r3android-vts-11.0_r2android-vts-11.0_r16android-vts-11.0_r15android-vts-11.0_r14android-vts-11.0_r13android-vts-11.0_r12android-vts-11.0_r11android-vts-11.0_r10android-vts-11.0_r1android-security-11.0.0_r76android-security-11.0.0_r75android-security-11.0.0_r74android-security-11.0.0_r73android-security-11.0.0_r72android-security-11.0.0_r71android-security-11.0.0_r70android-security-11.0.0_r69android-security-11.0.0_r68android-security-11.0.0_r67android-security-11.0.0_r66android-security-11.0.0_r65android-security-11.0.0_r64android-security-11.0.0_r63android-security-11.0.0_r62android-security-11.0.0_r61android-security-11.0.0_r60android-security-11.0.0_r59android-security-11.0.0_r58android-security-11.0.0_r57android-security-11.0.0_r56android-security-11.0.0_r55android-security-11.0.0_r54android-security-11.0.0_r53android-security-11.0.0_r52android-security-11.0.0_r51android-security-11.0.0_r50android-security-11.0.0_r49android-security-11.0.0_r1android-cts-11.0_r9android-cts-11.0_r8android-cts-11.0_r7android-cts-11.0_r6android-cts-11.0_r5android-cts-11.0_r4android-cts-11.0_r3android-cts-11.0_r2android-cts-11.0_r16android-cts-11.0_r15android-cts-11.0_r14android-cts-11.0_r13android-cts-11.0_r12android-cts-11.0_r11android-cts-11.0_r10android-cts-11.0_r1android-11.0.0_r5android-11.0.0_r4android-11.0.0_r3android-11.0.0_r25android-11.0.0_r2android-11.0.0_r17android-11.0.0_r1android11-tests-releaseandroid11-security-releaseandroid11-s1-releaseandroid11-release
Change-Id: I057f63f2f715dc5d370f11205e3ea544b27e2bc9
Diffstat (limited to 'scripts/mcm-buildall.sh')
-rwxr-xr-x | scripts/mcm-buildall.sh | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/scripts/mcm-buildall.sh b/scripts/mcm-buildall.sh index 6e36c7c4..e82ce2d5 100755 --- a/scripts/mcm-buildall.sh +++ b/scripts/mcm-buildall.sh @@ -127,6 +127,94 @@ make_tuple() done } +# Packages detect nommu via the absence of fork(). Musl provides a broken fork() +# on nommu builds that always returns -ENOSYS at runtime. Rip it out. +# (Currently only for superh/jcore.) +fix_nommu() +{ + # Rich won't merge this + sed -i 's/--enable-fdpic$/& --enable-twoprocess/' litecross/Makefile + + PP=patches/musl-"$(sed -n 's/MUSL_VER[ \t]*=[ \t]*//p' Makefile)" + mkdir -p "$PP" && + cat > "$PP"/0001-nommu.patch << 'EOF' +--- a/include/features.h ++++ b/include/features.h +@@ -3,2 +3,4 @@ + ++#define __MUSL__ 1 ++ + #if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) +--- a/src/legacy/daemon.c ++++ b/src/legacy/daemon.c +@@ -17,3 +17,3 @@ + +- switch(fork()) { ++ switch(vfork()) { + case 0: break; +@@ -25,3 +25,3 @@ + +- switch(fork()) { ++ switch(vfork()) { + case 0: break; +--- a/src/misc/forkpty.c ++++ b/src/misc/forkpty.c +@@ -8,2 +8,3 @@ + ++#ifndef __SH_FDPIC__ + int forkpty(int *pm, char *name, const struct termios *tio, const struct winsize *ws) +@@ -57,1 +58,2 @@ + } ++#endif +--- a/src/misc/wordexp.c ++++ b/src/misc/wordexp.c +@@ -25,2 +25,3 @@ + ++#ifndef __SH_FDPIC__ + static int do_wordexp(const char *s, wordexp_t *we, int flags) +@@ -177,2 +178,3 @@ + } ++#endif + +--- a/src/process/fork.c ++++ b/src/process/fork.c +@@ -7,2 +7,3 @@ + ++#ifndef __SH_FDPIC__ + static void dummy(int x) +@@ -37,1 +38,2 @@ + } ++#endif +--- a/Makefile ++++ b/Makefile +@@ -100,3 +100,3 @@ + cp $< $@ +- sed -n -e s/__NR_/SYS_/p < $< >> $@ ++ sed -e s/__NR_/SYS_/ < $< >> $@ + +--- a/arch/sh/bits/syscall.h.in ++++ b/arch/sh/bits/syscall.h.in +@@ -2,3 +2,5 @@ + #define __NR_exit 1 ++#ifndef __SH_FDPIC__ + #define __NR_fork 2 ++#endif + #define __NR_read 3 +EOF + + # I won't sign the FSF's copyright assignment + tee $(for i in patches/gcc-*; do echo $i/099-vfork.patch; done) > /dev/null << 'EOF' +--- gcc-8.3.0/fixincludes/procopen.c 2005-08-14 19:50:43.000000000 -0500 ++++ gcc-bak/fixincludes/procopen.c 2020-02-06 23:27:15.408071708 -0600 +@@ -116,3 +116,3 @@ + */ +- ch_id = fork (); ++ ch_id = vfork (); + switch (ch_id) +EOF +} + +fix_nommu || exit 1 mkdir -p "$OUTPUT"/log # Make bootstrap compiler (no $TYPE, dynamically linked against host libc) |