diff options
Diffstat (limited to 'poky/meta/recipes-extended/bash')
-rw-r--r-- | poky/meta/recipes-extended/bash/bash/makerace2.patch | 98 | ||||
-rw-r--r-- | poky/meta/recipes-extended/bash/bash_5.1.8.bb | 25 | ||||
-rw-r--r-- | poky/meta/recipes-extended/bash/bash_5.1.bb | 32 |
3 files changed, 123 insertions, 32 deletions
diff --git a/poky/meta/recipes-extended/bash/bash/makerace2.patch b/poky/meta/recipes-extended/bash/bash/makerace2.patch new file mode 100644 index 0000000000..43cdd04157 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/makerace2.patch @@ -0,0 +1,98 @@ +The main makefile can call mkbuiltins from multiple different codepaths in parallel. +When called, it moves the existing files out the way and creates new ones, then +compares which will break the build if timing is unlucky. + +The root of the problem is mkbuiltins.c creating a file but also referencing that +file under the same name. By modifing it to allow the final name and the temp name +to be specified, we can avoid the original reason for the moving of files around. +This allows them to be created under a new name and then replaced if changed, +removing any race windows around accessing the files whilst they've been +moved or are being rewritten. + +See [YOCTO #14227] + +Upstream-Status: Pending +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> + +Index: bash-5.1.8/builtins/Makefile.in +=================================================================== +--- bash-5.1.8.orig/builtins/Makefile.in ++++ bash-5.1.8/builtins/Makefile.in +@@ -185,19 +185,17 @@ gen-helpfiles: tmpbuiltins.o gen-helpfil + $(CC_FOR_BUILD) ${CCFLAGS_FOR_BUILD} $(LDFLAGS_FOR_BUILD) -o $@ gen-helpfiles.o tmpbuiltins.o $(LIBS_FOR_BUILD) + + builtext.h builtins.c: $(MKBUILTINS) $(DEFSRC) +- @-if test -f builtins.c; then mv -f builtins.c old-builtins.c; fi +- @-if test -f builtext.h; then mv -f builtext.h old-builtext.h; fi +- ./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \ ++ ./$(MKBUILTINS) -externfile builtext-new.h -externfinalfile builtext.h -structfile builtins-new.c \ + -noproduction $(DIRECTDEFINE) $(HELPDIRDEFINE) $(HELPSTRINGS) $(DEFSRC) +- @-if cmp -s old-builtext.h builtext.h 2>/dev/null; then \ +- mv old-builtext.h builtext.h; \ ++ @-if ! cmp -s builtext.h builtext-new.h 2>/dev/null; then \ ++ mv builtext-new.h builtext.h; \ + else \ +- $(RM) old-builtext.h; \ ++ $(RM) builtext-new.h; \ + fi +- @-if cmp -s old-builtins.c builtins.c 2>/dev/null; then \ +- mv old-builtins.c builtins.c; \ ++ @-if ! cmp -s builtins.c builtins-new.c 2>/dev/null; then \ ++ mv builtins-new.c builtins.c; \ + else \ +- $(RM) old-builtins.c; \ ++ $(RM) builtins-new.c; \ + fi + + helpdoc: gen-helpfiles +Index: bash-5.1.8/builtins/mkbuiltins.c +=================================================================== +--- bash-5.1.8.orig/builtins/mkbuiltins.c ++++ bash-5.1.8/builtins/mkbuiltins.c +@@ -113,6 +113,9 @@ char *struct_filename = (char *)NULL; + /* The name of the external declaration file. */ + char *extern_filename = (char *)NULL; + ++/* The final name of the external declaration file. */ ++char *extern_final_filename = (char *)NULL; ++ + /* Here is a structure for manipulating arrays of data. */ + typedef struct { + int size; /* Number of slots allocated to array. */ +@@ -230,6 +233,8 @@ main (argc, argv) + + if (strcmp (arg, "-externfile") == 0) + extern_filename = argv[arg_index++]; ++ else if (strcmp (arg, "-externfinalfile") == 0) ++ extern_final_filename = argv[arg_index++]; + else if (strcmp (arg, "-structfile") == 0) + struct_filename = argv[arg_index++]; + else if (strcmp (arg, "-noproduction") == 0) +@@ -273,6 +278,9 @@ main (argc, argv) + } + } + ++ if (!extern_final_filename) ++ extern_final_filename = extern_filename; ++ + /* If there are no files to process, just quit now. */ + if (arg_index == argc) + exit (0); +@@ -1174,7 +1182,7 @@ write_file_headers (structfile, externfi + fprintf (structfile, "%s\n", structfile_header[i]); + + fprintf (structfile, "#include \"%s\"\n", +- extern_filename ? extern_filename : "builtext.h"); ++ extern_final_filename ? extern_final_filename : "builtext.h"); + + fprintf (structfile, "#include \"bashintl.h\"\n"); + +@@ -1184,7 +1192,7 @@ write_file_headers (structfile, externfi + if (externfile) + fprintf (externfile, + "/* %s - The list of builtins found in libbuiltins.a. */\n", +- extern_filename ? extern_filename : "builtext.h"); ++ extern_final_filename ? extern_final_filename : "builtext.h"); + } + + /* Write out any necessary closing information for diff --git a/poky/meta/recipes-extended/bash/bash_5.1.8.bb b/poky/meta/recipes-extended/bash/bash_5.1.8.bb new file mode 100644 index 0000000000..5d7704af17 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash_5.1.8.bb @@ -0,0 +1,25 @@ +require bash.inc + +# GPLv2+ (< 4.0), GPLv3+ (>= 4.0) +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \ + file://execute_cmd.patch \ + file://mkbuiltins_have_stringize.patch \ + file://build-tests.patch \ + file://test-output.patch \ + file://run-ptest \ + file://run-bash-ptests \ + file://fix-run-builtins.patch \ + file://use_aclocal.patch \ + file://makerace.patch \ + file://makerace2.patch \ + " + +SRC_URI[tarball.sha256sum] = "0cfb5c9bb1a29f800a97bd242d19511c997a1013815b805e0fdd32214113d6be" + +DEBUG_OPTIMIZATION_append_armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" +DEBUG_OPTIMIZATION_append_armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" + +BBCLASSEXTEND = "nativesdk" diff --git a/poky/meta/recipes-extended/bash/bash_5.1.bb b/poky/meta/recipes-extended/bash/bash_5.1.bb deleted file mode 100644 index e5e013b734..0000000000 --- a/poky/meta/recipes-extended/bash/bash_5.1.bb +++ /dev/null @@ -1,32 +0,0 @@ -require bash.inc - -# GPLv2+ (< 4.0), GPLv3+ (>= 4.0) -LICENSE = "GPLv3+" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" - -SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \ - ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-001;apply=yes;striplevel=0;name=patch001 \ - ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-002;apply=yes;striplevel=0;name=patch002 \ - ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-003;apply=yes;striplevel=0;name=patch003 \ - ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-004;apply=yes;striplevel=0;name=patch004 \ - file://execute_cmd.patch \ - file://mkbuiltins_have_stringize.patch \ - file://build-tests.patch \ - file://test-output.patch \ - file://run-ptest \ - file://run-bash-ptests \ - file://fix-run-builtins.patch \ - file://use_aclocal.patch \ - file://makerace.patch \ - " - -SRC_URI[tarball.sha256sum] = "cc012bc860406dcf42f64431bcd3d2fa7560c02915a601aba9cd597a39329baa" -SRC_URI[patch001.sha256sum] = "ebb07b3dbadd98598f078125d0ae0d699295978a5cdaef6282fe19adef45b5fa" -SRC_URI[patch002.sha256sum] = "15ea6121a801e48e658ceee712ea9b88d4ded022046a6147550790caf04f5dbe" -SRC_URI[patch003.sha256sum] = "22f2cc262f056b22966281babf4b0a2f84cb7dd2223422e5dcd013c3dcbab6b1" -SRC_URI[patch004.sha256sum] = "9aaeb65664ef0d28c0067e47ba5652b518298b3b92d33327d84b98b28d873c86" - -DEBUG_OPTIMIZATION_append_armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" -DEBUG_OPTIMIZATION_append_armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" - -BBCLASSEXTEND = "nativesdk" |