diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-gplv2/recipes-extended/diffutils | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'external/meta-gplv2/recipes-extended/diffutils')
4 files changed, 109 insertions, 7 deletions
diff --git a/external/meta-gplv2/recipes-extended/diffutils/diffutils-2.8.1/0002-included-libc-use-mempcpy-instead-of.patch b/external/meta-gplv2/recipes-extended/diffutils/diffutils-2.8.1/0002-included-libc-use-mempcpy-instead-of.patch new file mode 100644 index 00000000..6994ec77 --- /dev/null +++ b/external/meta-gplv2/recipes-extended/diffutils/diffutils-2.8.1/0002-included-libc-use-mempcpy-instead-of.patch @@ -0,0 +1,56 @@ +From 61db4da387676690c0f731ef2eccc014d85c23a6 Mon Sep 17 00:00:00 2001 +From: Nicola Lunghi <nicola.lunghi@jci.com> +Date: Wed, 20 Nov 2019 18:30:10 +0000 +Subject: [PATCH] included libc: use mempcpy instead of __mempcpy + +Fix to use mempcpy instead of __mempcpy. This is needed for uclibc and musl +which doesn't define __mempcpy, only mempcpy. Since they all have +mempcpy, we'll just use that instead. + +Signed-off-by: Nicola Lunghi <nick83ola@gmail.com> + +Patch source: OpenEmbedded (grep) +Upstream-Status: Inappropriate [licensing] +--- + lib/getopt.c | 4 ++-- + lib/regex.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/getopt.c b/lib/getopt.c +index ed32692..6626f5e 100644 +--- a/lib/getopt.c ++++ b/lib/getopt.c +@@ -334,7 +334,7 @@ exchange (argv) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { +- memset (__mempcpy (new_str, __getopt_nonoption_flags, ++ memset (mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; +@@ -445,7 +445,7 @@ _getopt_initialize (argc, argv, optstring) + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else +- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), ++ memset (mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } +diff --git a/lib/regex.c b/lib/regex.c +index 6daec76..797b20a 100644 +--- a/lib/regex.c ++++ b/lib/regex.c +@@ -8314,7 +8314,7 @@ regerror (errcode, preg, errbuf, errbuf_size) + if (msg_size > errbuf_size) + { + #if defined HAVE_MEMPCPY || defined _LIBC +- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; ++ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; + #else + memcpy (errbuf, msg, errbuf_size - 1); + errbuf[errbuf_size - 1] = 0; +-- +2.20.1 + diff --git a/external/meta-gplv2/recipes-extended/diffutils/diffutils-2.8.1/0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch b/external/meta-gplv2/recipes-extended/diffutils/diffutils-2.8.1/0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch new file mode 100644 index 00000000..a8fcde09 --- /dev/null +++ b/external/meta-gplv2/recipes-extended/diffutils/diffutils-2.8.1/0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch @@ -0,0 +1,46 @@ +From 07c75310fecbaec62a24a3ee98b4209e1bf9ff62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net> +Date: Mon, 6 Jan 2020 13:31:50 +0000 +Subject: [PATCH] context: fix compilation with 64bit time_t on 32bit arches +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In file included from ../../diffutils-2.8.1/src/diff.h:23, + from ../../diffutils-2.8.1/src/context.c:23: +../../diffutils-2.8.1/src/context.c: In function 'print_context_label': +../../diffutils-2.8.1/src/system.h:41:52: error: size of array 'a' is negative + 41 | #define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } + | ^ +../../diffutils-2.8.1/src/context.c:65:4: note: in expansion of macro 'verify' + 65 | verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); + | ^~~~~~ + +struct stat::st_mtime is a time_t and will not fit into a +long (when 64bit time_t has been requested on a 32bit machine). + +Signed-off-by: André Draszik <git@andred.net> +Upstream-Status: Inappropriate [fixing an old version] +--- + src/context.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/context.c b/src/context.c +index 18d7023..d41efde 100644 +--- a/src/context.c ++++ b/src/context.c +@@ -61,9 +61,9 @@ print_context_label (char const *mark, + int nsec = TIMESPEC_NS (inf->stat.st_mtim); + if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec))) + { +- long sec = inf->stat.st_mtime; ++ time_t sec = inf->stat.st_mtime; + verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); +- sprintf (buf, "%ld.%.9d", sec, nsec); ++ sprintf (buf, "%lld.%.9d", (long long) sec, nsec); + } + fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf); + } +-- +2.23.0.rc1 + diff --git a/external/meta-gplv2/recipes-extended/diffutils/diffutils.inc b/external/meta-gplv2/recipes-extended/diffutils/diffutils.inc index 243341aa..c81348b3 100644 --- a/external/meta-gplv2/recipes-extended/diffutils/diffutils.inc +++ b/external/meta-gplv2/recipes-extended/diffutils/diffutils.inc @@ -6,13 +6,6 @@ SECTION = "base" inherit autotools texinfo update-alternatives gettext -# diffutils assumes non-glibc compilation with uclibc and -# this causes it to generate its own implementations of -# standard functionality. regex.c actually breaks compilation -# because it uses __mempcpy, there are other things (TBD: -# see diffutils.mk in buildroot) -EXTRA_OECONF_libc-uclibc = "--without-included-regex" - ALTERNATIVE_${PN} = "diff cmp" ALTERNATIVE_PRIORITY = "100" diff --git a/external/meta-gplv2/recipes-extended/diffutils/diffutils_2.8.1.bb b/external/meta-gplv2/recipes-extended/diffutils/diffutils_2.8.1.bb index 466bf285..7c43c4be 100644 --- a/external/meta-gplv2/recipes-extended/diffutils/diffutils_2.8.1.bb +++ b/external/meta-gplv2/recipes-extended/diffutils/diffutils_2.8.1.bb @@ -9,11 +9,18 @@ SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz \ file://diffutils_fix_for_automake-1.12.patch \ file://fix_gcc6.patch \ file://0001-Make-it-build-with-compile-time-hardening-enabled.patch \ + file://0002-included-libc-use-mempcpy-instead-of.patch \ + file://0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch \ " SRC_URI[md5sum] = "71f9c5ae19b60608f6c7f162da86a428" SRC_URI[sha256sum] = "c5001748b069224dd98bf1bb9ee877321c7de8b332c8aad5af3e2a7372d23f5a" +CACHED_CONFIGUREVARS = "\ + jm_cv_func_working_malloc=yes \ + jm_cv_func_working_realloc=yes \ +" + do_configure_prepend () { chmod u+w ${S}/po/Makefile.in.in } |