diff options
-rw-r--r-- | meta/recipes-core/busybox/busybox/parallel-make-fix.patch | 65 | ||||
-rw-r--r-- | meta/recipes-core/busybox/busybox_1.24.1.bb | 1 |
2 files changed, 66 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/parallel-make-fix.patch b/meta/recipes-core/busybox/busybox/parallel-make-fix.patch new file mode 100644 index 0000000000..120dff1007 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/parallel-make-fix.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | When applet_tables is run, we need it to touch both output files, | ||
2 | else make will keep calling the command, potentially leading to races | ||
3 | as the files are potentially rewritten. | ||
4 | |||
5 | We also need to ensure that applet_tables is called once, not twice, | ||
6 | potentially in parallel. To do this, make one file depend upon the other. | ||
7 | |||
8 | Upstream-Status: Submitted | ||
9 | RP 2016/8/19 | ||
10 | |||
11 | Index: busybox-1.24.1/applets/Kbuild.src | ||
12 | =================================================================== | ||
13 | --- busybox-1.24.1.orig/applets/Kbuild.src | ||
14 | +++ busybox-1.24.1/applets/Kbuild.src | ||
15 | @@ -29,7 +29,7 @@ applets/applets.o: include/usage_compres | ||
16 | |||
17 | applets/applet_tables: .config include/applets.h | ||
18 | applets/usage: .config include/applets.h | ||
19 | -applets/usage_pod: .config include/applets.h include/applet_tables.h include/NUM_APPLETS.h | ||
20 | +applets/usage_pod: .config include/applets.h include/applet_tables.h | ||
21 | |||
22 | quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h | ||
23 | cmd_gen_usage_compressed = $(srctree_slash)applets/usage_compressed include/usage_compressed.h applets | ||
24 | @@ -40,5 +40,7 @@ include/usage_compressed.h: applets/usag | ||
25 | quiet_cmd_gen_applet_tables = GEN include/applet_tables.h | ||
26 | cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h include/NUM_APPLETS.h | ||
27 | |||
28 | -include/applet_tables.h include/NUM_APPLETS.h: applets/applet_tables | ||
29 | +include/NUM_APPLETS.h: applets/applet_tables | ||
30 | $(call cmd,gen_applet_tables) | ||
31 | + | ||
32 | +include/applet_tables.h: include/NUM_APPLETS.h | ||
33 | Index: busybox-1.24.1/applets/applet_tables.c | ||
34 | =================================================================== | ||
35 | --- busybox-1.24.1.orig/applets/applet_tables.c | ||
36 | +++ busybox-1.24.1/applets/applet_tables.c | ||
37 | @@ -151,23 +151,15 @@ int main(int argc, char **argv) | ||
38 | // printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); | ||
39 | |||
40 | if (argv[2]) { | ||
41 | - char line_old[80]; | ||
42 | char line_new[80]; | ||
43 | FILE *fp; | ||
44 | |||
45 | - line_old[0] = 0; | ||
46 | - fp = fopen(argv[2], "r"); | ||
47 | - if (fp) { | ||
48 | - fgets(line_old, sizeof(line_old), fp); | ||
49 | - fclose(fp); | ||
50 | - } | ||
51 | sprintf(line_new, "#define NUM_APPLETS %u\n", NUM_APPLETS); | ||
52 | - if (strcmp(line_old, line_new) != 0) { | ||
53 | - fp = fopen(argv[2], "w"); | ||
54 | - if (!fp) | ||
55 | - return 1; | ||
56 | - fputs(line_new, fp); | ||
57 | - } | ||
58 | + fp = fopen(argv[2], "w"); | ||
59 | + if (!fp) | ||
60 | + return 1; | ||
61 | + fputs(line_new, fp); | ||
62 | + fclose(fp); | ||
63 | } | ||
64 | |||
65 | return 0; | ||
diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb b/meta/recipes-core/busybox/busybox_1.24.1.bb index 7edd32dcd3..e8265cd9f5 100644 --- a/meta/recipes-core/busybox/busybox_1.24.1.bb +++ b/meta/recipes-core/busybox/busybox_1.24.1.bb | |||
@@ -49,6 +49,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ | |||
49 | file://CVE-2016-2147_2.patch \ | 49 | file://CVE-2016-2147_2.patch \ |
50 | file://ip_fix_problem_on_mips64_n64_big_endian_musl_systems.patch \ | 50 | file://ip_fix_problem_on_mips64_n64_big_endian_musl_systems.patch \ |
51 | file://makefile-fix-backport.patch \ | 51 | file://makefile-fix-backport.patch \ |
52 | file://parallel-make-fix.patch \ | ||
52 | " | 53 | " |
53 | SRC_URI_append_libc-musl = " file://musl.cfg " | 54 | SRC_URI_append_libc-musl = " file://musl.cfg " |
54 | 55 | ||