diff options
Diffstat (limited to 'poky/meta/recipes-connectivity/nfs-utils')
10 files changed, 731 insertions, 55 deletions
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch new file mode 100644 index 000000000..a44d1bf2f --- /dev/null +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch @@ -0,0 +1,32 @@ +From 4f115fc314646500f7b4178d7248a02654c7cd10 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 30 Nov 2018 16:47:57 -0800 +Subject: [PATCH] Do not pass null pointer to freeaddrinfo() + +Passing null pointer as input parameter to freeaddrinfo() is undefined +behaviour, some libcs e.g. glibc might just call free() which does +accept null pointer but other libcs e.g. musl might not and instead +cause the program to segfault. Therefore do not rely on undefined +behaviour instead make it deterministic + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + support/export/client.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: nfs-utils-2.3.2/support/export/client.c +=================================================================== +--- nfs-utils-2.3.2.orig/support/export/client.c ++++ nfs-utils-2.3.2/support/export/client.c +@@ -309,7 +309,8 @@ client_lookup(char *hname, int canonical + init_addrlist(clp, ai); + + out: +- freeaddrinfo(ai); ++ if (ai) ++ freeaddrinfo(ai); + return clp; + } + diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-with-CC_FOR_BUILD.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-with-CC_FOR_BUILD.patch new file mode 100644 index 000000000..23bc3eaf7 --- /dev/null +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Don-t-build-tools-with-CC_FOR_BUILD.patch @@ -0,0 +1,40 @@ +From 79019d976584c598f8d0a9d8de43c989946f974b Mon Sep 17 00:00:00 2001 +From: Pascal Bach <pascal.bach@siemens.com> +Date: Wed, 13 Feb 2019 09:28:07 +0100 +Subject: [PATCH] Don't build tools with CC_FOR_BUILD + +The tools are intended for the target not for the host. + +Upstream-Status: Pending + +Signed-off-by: Pascal Bach <pascal.bach@siemens.com> +--- + tools/locktest/Makefile.am | 1 - + tools/rpcgen/Makefile.am | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am +index 3156815..87d0bac 100644 +--- a/tools/locktest/Makefile.am ++++ b/tools/locktest/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = testlk +diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am +index 8a9ec89..3e092c9 100644 +--- a/tools/rpcgen/Makefile.am ++++ b/tools/rpcgen/Makefile.am +@@ -1,6 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-CC=$(CC_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = rpcgen +-- +2.11.0 + diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch new file mode 100644 index 000000000..aa551ebd1 --- /dev/null +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch @@ -0,0 +1,295 @@ +From 690a90a5b7786e40b5447ad7c5f19a7657d27405 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <Mingli.Yu@windriver.com> +Date: Fri, 14 Dec 2018 17:44:32 +0800 +Subject: [PATCH] Makefile.am: fix undefined function for libnsm.a + +The source file of libnsm.a uses some function +in ../support/misc/file.c, add ../support/misc/file.c +to libnsm_a_SOURCES to fix build error when run +"make -C tests statdb_dump": +| ../support/nsm/libnsm.a(file.o): In function `nsm_make_pathname': +| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' +| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' +| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' +| ../support/nsm/libnsm.a(file.o): In function `nsm_setup_pathnames': +| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:280: undefined reference to `generic_setup_basedir' +| collect2: error: ld returned 1 exit status + +As there is already one source file named file.c +as support/nsm/file.c in support/nsm/Makefile.am, +so rename ../support/misc/file.c to ../support/misc/misc.c. + +Upstream-Status: Submitted[https://marc.info/?l=linux-nfs&m=154502780423058&w=2] + +Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> +--- + support/misc/Makefile.am | 2 +- + support/misc/file.c | 111 ----------------------------------------------- + support/misc/misc.c | 111 +++++++++++++++++++++++++++++++++++++++++++++++ + support/nsm/Makefile.am | 2 +- + 4 files changed, 113 insertions(+), 113 deletions(-) + delete mode 100644 support/misc/file.c + create mode 100644 support/misc/misc.c + +diff --git a/support/misc/Makefile.am b/support/misc/Makefile.am +index 8936b0d..d4c1f76 100644 +--- a/support/misc/Makefile.am ++++ b/support/misc/Makefile.am +@@ -1,6 +1,6 @@ + ## Process this file with automake to produce Makefile.in + + noinst_LIBRARIES = libmisc.a +-libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c file.c ++libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c misc.c + + MAINTAINERCLEANFILES = Makefile.in +diff --git a/support/misc/file.c b/support/misc/file.c +deleted file mode 100644 +index e7c3819..0000000 +--- a/support/misc/file.c ++++ /dev/null +@@ -1,111 +0,0 @@ +-/* +- * Copyright 2009 Oracle. All rights reserved. +- * Copyright 2017 Red Hat, Inc. All rights reserved. +- * +- * This file is part of nfs-utils. +- * +- * nfs-utils is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * nfs-utils is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>. +- */ +- +-#include <sys/stat.h> +- +-#include <string.h> +-#include <libgen.h> +-#include <stdio.h> +-#include <errno.h> +-#include <dirent.h> +-#include <stdlib.h> +-#include <stdbool.h> +-#include <limits.h> +- +-#include "xlog.h" +-#include "misc.h" +- +-/* +- * Returns a dynamically allocated, '\0'-terminated buffer +- * containing an appropriate pathname, or NULL if an error +- * occurs. Caller must free the returned result with free(3). +- */ +-__attribute__((__malloc__)) +-char * +-generic_make_pathname(const char *base, const char *leaf) +-{ +- size_t size; +- char *path; +- int len; +- +- size = strlen(base) + strlen(leaf) + 2; +- if (size > PATH_MAX) +- return NULL; +- +- path = malloc(size); +- if (path == NULL) +- return NULL; +- +- len = snprintf(path, size, "%s/%s", base, leaf); +- if ((len < 0) || ((size_t)len >= size)) { +- free(path); +- return NULL; +- } +- +- return path; +-} +- +- +-/** +- * generic_setup_basedir - set up basedir +- * @progname: C string containing name of program, for error messages +- * @parentdir: C string containing pathname to on-disk state, or NULL +- * @base: character buffer to contain the basedir that is set up +- * @baselen: size of @base in bytes +- * +- * This runs before logging is set up, so error messages are directed +- * to stderr. +- * +- * Returns true and sets up our basedir, if @parentdir was valid +- * and usable; otherwise false is returned. +- */ +-_Bool +-generic_setup_basedir(const char *progname, const char *parentdir, char *base, +- const size_t baselen) +-{ +- static char buf[PATH_MAX]; +- struct stat st; +- char *path; +- +- /* First: test length of name and whether it exists */ +- if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) { +- (void)fprintf(stderr, "%s: Directory name too long: %s", +- progname, parentdir); +- return false; +- } +- if (lstat(parentdir, &st) == -1) { +- (void)fprintf(stderr, "%s: Failed to stat %s: %s", +- progname, parentdir, strerror(errno)); +- return false; +- } +- +- /* Ensure we have a clean directory pathname */ +- strncpy(buf, parentdir, sizeof(buf)-1); +- path = dirname(buf); +- if (*path == '.') { +- (void)fprintf(stderr, "%s: Unusable directory %s", +- progname, parentdir); +- return false; +- } +- +- xlog(D_CALL, "Using %s as the state directory", parentdir); +- strcpy(base, parentdir); +- return true; +-} +diff --git a/support/misc/misc.c b/support/misc/misc.c +new file mode 100644 +index 0000000..e7c3819 +--- /dev/null ++++ b/support/misc/misc.c +@@ -0,0 +1,111 @@ ++/* ++ * Copyright 2009 Oracle. All rights reserved. ++ * Copyright 2017 Red Hat, Inc. All rights reserved. ++ * ++ * This file is part of nfs-utils. ++ * ++ * nfs-utils is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * nfs-utils is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>. ++ */ ++ ++#include <sys/stat.h> ++ ++#include <string.h> ++#include <libgen.h> ++#include <stdio.h> ++#include <errno.h> ++#include <dirent.h> ++#include <stdlib.h> ++#include <stdbool.h> ++#include <limits.h> ++ ++#include "xlog.h" ++#include "misc.h" ++ ++/* ++ * Returns a dynamically allocated, '\0'-terminated buffer ++ * containing an appropriate pathname, or NULL if an error ++ * occurs. Caller must free the returned result with free(3). ++ */ ++__attribute__((__malloc__)) ++char * ++generic_make_pathname(const char *base, const char *leaf) ++{ ++ size_t size; ++ char *path; ++ int len; ++ ++ size = strlen(base) + strlen(leaf) + 2; ++ if (size > PATH_MAX) ++ return NULL; ++ ++ path = malloc(size); ++ if (path == NULL) ++ return NULL; ++ ++ len = snprintf(path, size, "%s/%s", base, leaf); ++ if ((len < 0) || ((size_t)len >= size)) { ++ free(path); ++ return NULL; ++ } ++ ++ return path; ++} ++ ++ ++/** ++ * generic_setup_basedir - set up basedir ++ * @progname: C string containing name of program, for error messages ++ * @parentdir: C string containing pathname to on-disk state, or NULL ++ * @base: character buffer to contain the basedir that is set up ++ * @baselen: size of @base in bytes ++ * ++ * This runs before logging is set up, so error messages are directed ++ * to stderr. ++ * ++ * Returns true and sets up our basedir, if @parentdir was valid ++ * and usable; otherwise false is returned. ++ */ ++_Bool ++generic_setup_basedir(const char *progname, const char *parentdir, char *base, ++ const size_t baselen) ++{ ++ static char buf[PATH_MAX]; ++ struct stat st; ++ char *path; ++ ++ /* First: test length of name and whether it exists */ ++ if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) { ++ (void)fprintf(stderr, "%s: Directory name too long: %s", ++ progname, parentdir); ++ return false; ++ } ++ if (lstat(parentdir, &st) == -1) { ++ (void)fprintf(stderr, "%s: Failed to stat %s: %s", ++ progname, parentdir, strerror(errno)); ++ return false; ++ } ++ ++ /* Ensure we have a clean directory pathname */ ++ strncpy(buf, parentdir, sizeof(buf)-1); ++ path = dirname(buf); ++ if (*path == '.') { ++ (void)fprintf(stderr, "%s: Unusable directory %s", ++ progname, parentdir); ++ return false; ++ } ++ ++ xlog(D_CALL, "Using %s as the state directory", parentdir); ++ strcpy(base, parentdir); ++ return true; ++} +diff --git a/support/nsm/Makefile.am b/support/nsm/Makefile.am +index 8f5874e..68f1a46 100644 +--- a/support/nsm/Makefile.am ++++ b/support/nsm/Makefile.am +@@ -10,7 +10,7 @@ GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) $(GENFILES_H) + EXTRA_DIST = sm_inter.x + + noinst_LIBRARIES = libnsm.a +-libnsm_a_SOURCES = $(GENFILES) file.c rpc.c ++libnsm_a_SOURCES = $(GENFILES) ../misc/misc.c file.c rpc.c + + BUILT_SOURCES = $(GENFILES) + +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-update-the-path-of-libnfs.a.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-update-the-path-of-libnfs.a.patch new file mode 100644 index 000000000..906ac0f90 --- /dev/null +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-update-the-path-of-libnfs.a.patch @@ -0,0 +1,50 @@ +From fcece65d1b713eaeef41706898440302f8ce92d9 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <Mingli.Yu@windriver.com> +Date: Thu, 12 Jul 2018 15:19:41 +0800 +Subject: [PATCH] Makefile.am: update the path of libnfs.a + +The libnfs.a is under ../support/nfs/.libs/ now, +update the reference path accordingly to fix below +build error when run "make -C tests statdb_dump": +| make: *** No rule to make target '../support/nfs/libnfs.a', needed by 'statdb_dump'. Stop. + +And below error when run "make -C tests/nsm_client nsm_client" +| make: *** No rule to make target '../../support/nfs/libnfs.a', needed by 'nsm_client'. Stop. + +Upstream-Status: Submitted[https://marc.info/?l=linux-nfs&m=154502636522745&w=2] + +Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> +--- + tests/Makefile.am | 2 +- + tests/nsm_client/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 1f96264..74aa629 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -3,7 +3,7 @@ + check_PROGRAMS = statdb_dump + statdb_dump_SOURCES = statdb_dump.c + +-statdb_dump_LDADD = ../support/nfs/libnfs.a \ ++statdb_dump_LDADD = ../support/nfs/.libs/libnfs.a \ + ../support/nsm/libnsm.a $(LIBCAP) + + SUBDIRS = nsm_client +diff --git a/tests/nsm_client/Makefile.am b/tests/nsm_client/Makefile.am +index a8fc131..43db9c2 100644 +--- a/tests/nsm_client/Makefile.am ++++ b/tests/nsm_client/Makefile.am +@@ -13,7 +13,7 @@ check_PROGRAMS = nsm_client + nsm_client_SOURCES = $(GENFILES) nsm_client.c + + BUILT_SOURCES = $(GENFILES) +-nsm_client_LDADD = ../../support/nfs/libnfs.a \ ++nsm_client_LDADD = ../../support/nfs/.libs/libnfs.a \ + ../../support/nsm/libnsm.a $(LIBCAP) $(LIBTIRPC) + + if CONFIG_RPCGEN +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-cacheio-use-intmax_t-for-formatted-IO.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-cacheio-use-intmax_t-for-formatted-IO.patch new file mode 100644 index 000000000..bafff5b9c --- /dev/null +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-cacheio-use-intmax_t-for-formatted-IO.patch @@ -0,0 +1,38 @@ +From ac32b813f5d6f9a2de944015cf9bb98d68e0203a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 1 Dec 2018 10:02:12 -0800 +Subject: [PATCH] cacheio: use intmax_t for formatted IO + +time_t is not same size on x32 ABI (ILP32) + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + support/nfs/cacheio.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c +index 9dc4cf1..2086a95 100644 +--- a/support/nfs/cacheio.c ++++ b/support/nfs/cacheio.c +@@ -17,6 +17,7 @@ + + #include <nfslib.h> + #include <stdio.h> ++#include <inttypes.h> + #include <stdio_ext.h> + #include <string.h> + #include <ctype.h> +@@ -234,7 +235,7 @@ cache_flush(int force) + stb.st_mtime > now) + stb.st_mtime = time(0); + +- sprintf(stime, "%ld\n", stb.st_mtime); ++ sprintf(stime, "%jd\n", (intmax_t)stb.st_mtime); + for (c=0; cachelist[c]; c++) { + int fd; + sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]); +-- +2.19.2 + diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch new file mode 100644 index 000000000..17aabb9e4 --- /dev/null +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch @@ -0,0 +1,43 @@ +From 66471fbf7106917da7a1536b18a0a77d07479779 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <Mingli.Yu@windriver.com> +Date: Mon, 17 Dec 2018 15:29:47 +0800 +Subject: [PATCH] configure.ac: Do not fatalize -Wmissing-prototypes + +There comes below error when run "make -C tests/nsm_client nsm_client" +| nlm_sm_inter_svc.c:20:1: error: no previous prototype for 'nlm_sm_prog_3' [-Werror=missing-prototypes] + +It is because rpcgen doesn't generate -Wmissing-prototypes +free code for nlm_sm_inter_svc.c with below logic +in tests/nsm_client/Makefile.am +[snip] +GENFILES_SVC = nlm_sm_inter_svc.c +[snip] +$(GENFILES_SVC): %_svc.c: %.x $(RPCGEN) + test -f $@ && rm -rf $@ || true + $(RPCGEN) -m -o $@ $< + +So add the logic not to fatalize -Wmissing-prototypes. + +Upstream-Status: Submitted[https://marc.info/?l=linux-nfs&m=154503260323936&w=2] + +Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index e82ff14..d0cc5d5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -548,7 +548,7 @@ my_am_cflags="\ + -Wall \ + -Wextra \ + -Werror=strict-prototypes \ +- -Werror=missing-prototypes \ ++ -Wmissing-prototypes \ + -Werror=missing-declarations \ + -Werror=format=2 \ + -Werror=undef \ +-- +2.7.4 + diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-format-string.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-format-string.patch new file mode 100644 index 000000000..1d693e414 --- /dev/null +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-format-string.patch @@ -0,0 +1,183 @@ +Clang comes up with more printf format warnings +Correcting “format string is not a string literal” warning +requires us to declare that parameter is a printf style +format using the attribute flag + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Index: nfs-utils-2.3.3/support/include/xcommon.h +=================================================================== +--- nfs-utils-2.3.3.orig/support/include/xcommon.h ++++ nfs-utils-2.3.3/support/include/xcommon.h +@@ -27,7 +27,7 @@ + + /* Functions in sundries.c that are used in mount.c and umount.c */ + char *canonicalize (const char *path); +-void nfs_error (const char *fmt, ...); ++void nfs_error (const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); + void *xmalloc (size_t size); + void *xrealloc(void *p, size_t size); + void xfree(void *); +@@ -36,9 +36,9 @@ char *xstrndup (const char *s, int n); + char *xstrconcat2 (const char *, const char *); + char *xstrconcat3 (const char *, const char *, const char *); + char *xstrconcat4 (const char *, const char *, const char *, const char *); +-void die (int errcode, const char *fmt, ...); ++void die (int errcode, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); + +-extern void die(int err, const char *fmt, ...); ++extern void die(int err, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); + extern void (*at_die)(void); + + /* exit status - bits below are ORed */ +Index: nfs-utils-2.3.3/support/include/xlog.h +=================================================================== +--- nfs-utils-2.3.3.orig/support/include/xlog.h ++++ nfs-utils-2.3.3/support/include/xlog.h +@@ -43,10 +43,10 @@ void xlog_config(int fac, int on); + void xlog_sconfig(char *, int on); + void xlog_from_conffile(char *); + int xlog_enabled(int fac); +-void xlog(int fac, const char *fmt, ...); +-void xlog_warn(const char *fmt, ...); +-void xlog_err(const char *fmt, ...); +-void xlog_errno(int err, const char *fmt, ...); +-void xlog_backend(int fac, const char *fmt, va_list args); ++void xlog(int fac, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); ++void xlog_warn(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); ++void xlog_err(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); ++void xlog_errno(int err, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); ++void xlog_backend(int fac, const char *fmt, va_list args) __attribute__((__format__ (__printf__, 2, 0))); + + #endif /* XLOG_H */ +Index: nfs-utils-2.3.3/support/nfs/xcommon.c +=================================================================== +--- nfs-utils-2.3.3.orig/support/nfs/xcommon.c ++++ nfs-utils-2.3.3/support/nfs/xcommon.c +@@ -93,7 +93,10 @@ nfs_error (const char *fmt, ...) { + + fmt2 = xstrconcat2 (fmt, "\n"); + va_start (args, fmt); ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wformat-nonliteral" + vfprintf (stderr, fmt2, args); ++#pragma clang diagnostic pop + va_end (args); + free (fmt2); + } +Index: nfs-utils-2.3.3/utils/exportfs/exportfs.c +=================================================================== +--- nfs-utils-2.3.3.orig/utils/exportfs/exportfs.c ++++ nfs-utils-2.3.3/utils/exportfs/exportfs.c +@@ -644,6 +644,7 @@ out: + return result; + } + ++__attribute__((__format__ (__printf__, 2, 3))) + static char + dumpopt(char c, char *fmt, ...) + { +Index: nfs-utils-2.3.3/utils/statd/statd.c +=================================================================== +--- nfs-utils-2.3.3.orig/utils/statd/statd.c ++++ nfs-utils-2.3.3/utils/statd/statd.c +@@ -136,7 +136,7 @@ static void log_modes(void) + strcat(buf, "TI-RPC "); + #endif + +- xlog_warn(buf); ++ xlog_warn("%s", buf); + } + + /* +Index: nfs-utils-2.3.3/support/nfs/svc_create.c +=================================================================== +--- nfs-utils-2.3.3.orig/support/nfs/svc_create.c ++++ nfs-utils-2.3.3/support/nfs/svc_create.c +@@ -184,7 +184,7 @@ svc_create_sock(const struct sockaddr *s + type = SOCK_STREAM; + break; + default: +- xlog(D_GENERAL, "%s: Unrecognized bind address semantics: %u", ++ xlog(D_GENERAL, "%s: Unrecognized bind address semantics: %lu", + __func__, nconf->nc_semantics); + return -1; + } +Index: nfs-utils-2.3.3/support/nsm/rpc.c +=================================================================== +--- nfs-utils-2.3.3.orig/support/nsm/rpc.c ++++ nfs-utils-2.3.3/support/nsm/rpc.c +@@ -182,7 +182,7 @@ nsm_xmit_getport(const int sock, const s + uint32_t xid; + XDR xdr; + +- xlog(D_CALL, "Sending PMAP_GETPORT for %u, %u, udp", program, version); ++ xlog(D_CALL, "Sending PMAP_GETPORT for %lu, %lu, udp", program, version); + + nsm_init_xdrmem(msgbuf, NSM_MAXMSGSIZE, &xdr); + xid = nsm_init_rpc_header(PMAPPROG, PMAPVERS, +Index: nfs-utils-2.3.3/utils/mountd/cache.c +=================================================================== +--- nfs-utils-2.3.3.orig/utils/mountd/cache.c ++++ nfs-utils-2.3.3/utils/mountd/cache.c +@@ -968,8 +968,7 @@ lookup_export(char *dom, char *path, str + } else if (found_type == i && found->m_warned == 0) { + xlog(L_WARNING, "%s exported to both %s and %s, " + "arbitrarily choosing options from first", +- path, found->m_client->m_hostname, exp->m_client->m_hostname, +- dom); ++ path, found->m_client->m_hostname, exp->m_client->m_hostname); + found->m_warned = 1; + } + } +Index: nfs-utils-2.3.3/utils/mountd/mountd.c +=================================================================== +--- nfs-utils-2.3.3.orig/utils/mountd/mountd.c ++++ nfs-utils-2.3.3/utils/mountd/mountd.c +@@ -213,7 +213,7 @@ static void + sig_hup (int sig) + { + /* don't exit on SIGHUP */ +- xlog (L_NOTICE, "Received SIGHUP... Ignoring.\n", sig); ++ xlog (L_NOTICE, "Received SIGHUP(%d)... Ignoring.\n", sig); + return; + } + +Index: nfs-utils-2.3.3/utils/statd/rmtcall.c +=================================================================== +--- nfs-utils-2.3.3.orig/utils/statd/rmtcall.c ++++ nfs-utils-2.3.3/utils/statd/rmtcall.c +@@ -247,7 +247,7 @@ process_reply(FD_SET_TYPE *rfds) + xlog_warn("%s: service %d not registered on localhost", + __func__, NL_MY_PROG(lp)); + } else { +- xlog(D_GENERAL, "%s: Callback to %s (for %d) succeeded", ++ xlog(D_GENERAL, "%s: Callback to %s (for %s) succeeded", + __func__, NL_MY_NAME(lp), NL_MON_NAME(lp)); + } + nlist_free(¬ify, lp); +Index: nfs-utils-2.3.3/utils/statd/svc_run.c +=================================================================== +--- nfs-utils-2.3.3.orig/utils/statd/svc_run.c ++++ nfs-utils-2.3.3/utils/statd/svc_run.c +@@ -53,6 +53,7 @@ + + #include <errno.h> + #include <time.h> ++#include <inttypes.h> + #include "statd.h" + #include "notlist.h" + +@@ -104,8 +105,8 @@ my_svc_run(int sockfd) + + tv.tv_sec = NL_WHEN(notify) - now; + tv.tv_usec = 0; +- xlog(D_GENERAL, "Waiting for reply... (timeo %d)", +- tv.tv_sec); ++ xlog(D_GENERAL, "Waiting for reply... (timeo %jd)", ++ (intmax_t)tv.tv_sec); + selret = select(FD_SETSIZE, &readfds, + (void *) 0, (void *) 0, &tv); + } else { diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch deleted file mode 100644 index 993f1e5ea..000000000 --- a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch +++ /dev/null @@ -1,42 +0,0 @@ -nfs-utils: Do not pass CFLAGS to gcc while building - -Do not pass CFLAGS/LDFLAGS to gcc while building, The needed flags has -been passed by xxx_CFLAGS=$(CFLAGS_FOR_BUILD). - -Upstream-Status: Pending - -Signed-off-by: Chong Lu <Chong.Lu@windriver.com> ---- - tools/locktest/Makefile.am | 2 ++ - tools/rpcgen/Makefile.am | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am -index 3156815..1729fd1 100644 ---- a/tools/locktest/Makefile.am -+++ b/tools/locktest/Makefile.am -@@ -1,6 +1,8 @@ - ## Process this file with automake to produce Makefile.in - - CC=$(CC_FOR_BUILD) -+CFLAGS= -+LDFLAGS= - LIBTOOL = @LIBTOOL@ --tag=CC - - noinst_PROGRAMS = testlk -diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am -index 8a9ec89..8bacdaa 100644 ---- a/tools/rpcgen/Makefile.am -+++ b/tools/rpcgen/Makefile.am -@@ -1,6 +1,8 @@ - ## Process this file with automake to produce Makefile.in - - CC=$(CC_FOR_BUILD) -+CFLAGS= -+LDFLAGS= - LIBTOOL = @LIBTOOL@ --tag=CC - - noinst_PROGRAMS = rpcgen --- -1.7.9.5 - diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch index a169e6a22..22002fadc 100644 --- a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch @@ -1,17 +1,24 @@ +From caa19231196d73541445728e6813c8fa70345acb Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Tue, 26 Jun 2018 15:59:00 +0800 +Subject: [PATCH] nfs-utils: 2.1.1 -> 2.3.1 + Fixed: configure: error: res_querydomain needed -Upstream-Status: Pending [https://git.alpinelinux.org/cgit/aports/tree/main/nfs-utils/musl-res_querydomain.patch?id=f6734a77d3caee73325f8cc1f77d1b5117a75096] +Upstream-Status: Pending [https://github.com/alpinelinux/aports/blob/master/main/nfs-utils/musl-configure_ac.patch] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> + --- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + configure.ac | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac +index 276dec3..760238b 100644 --- a/configure.ac +++ b/configure.ac -@@ -401,7 +401,7 @@ if test "$enable_gss" = yes; then +@@ -408,7 +408,7 @@ if test "$enable_gss" = yes; then fi dnl libdnsidmap specific checks @@ -20,3 +27,31 @@ diff --git a/configure.ac b/configure.ac AC_ARG_ENABLE([ldap], [AS_HELP_STRING([--disable-ldap],[Disable support for LDAP @<:default=detect@:>@])]) +@@ -547,11 +547,11 @@ my_am_cflags="\ + -pipe \ + -Wall \ + -Wextra \ +- -Werror=strict-prototypes \ +- -Werror=missing-prototypes \ +- -Werror=missing-declarations \ ++ -Wstrict-prototypes \ ++ -Wmissing-prototypes \ ++ -Wmissing-declarations \ + -Werror=format=2 \ +- -Werror=undef \ ++ -Wundef \ + -Werror=missing-include-dirs \ + -Werror=strict-aliasing=2 \ + -Werror=init-self \ +@@ -579,10 +579,9 @@ AC_DEFUN([CHECK_CCSUPPORT], [ + + CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1]) + CHECK_CCSUPPORT([-Werror=int-conversion], [flg2]) +-CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3]) + CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4]) + +-AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4"]) ++AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg4"]) + + # Make sure that $ACLOCAL_FLAGS are used during a rebuild + AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"]) diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.1.bb b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb index 6d450c751..ac4437b92 100644 --- a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.1.bb +++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb @@ -26,16 +26,21 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://nfs-mountd.service \ file://nfs-statd.service \ file://proc-fs-nfsd.mount \ - file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \ file://nfs-utils-debianize-start-statd.patch \ file://bugfix-adjust-statd-service-name.patch \ file://nfs-utils-musl-limits.patch \ + file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ + file://0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch \ + file://clang-format-string.patch \ + file://0001-Makefile.am-update-the-path-of-libnfs.a.patch \ + file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ + file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ " - +SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch" SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch" -SRC_URI[md5sum] = "d77b182a9ee396aa6221ac2401ad7046" -SRC_URI[sha256sum] = "96d06b5a86b185815760d8f04c34fdface8fa8b9949ff256ac05c3ebc08335a5" +SRC_URI[md5sum] = "b6c9c032995af1c08fea9fbcc1ce33e9" +SRC_URI[sha256sum] = "f68b34793831b05f1fd5760d6bdec92772c7684177586a99a61e7b444f336322" # Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will # pull in the remainder of the dependencies. @@ -62,6 +67,8 @@ EXTRA_OECONF = "--with-statduser=rpcuser \ --with-statdpath=/var/lib/nfs/statd \ " +CFLAGS += "-Wno-error=format-overflow" + PACKAGECONFIG ??= "tcp-wrappers \ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ " @@ -140,11 +147,6 @@ do_install_append () { chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state - # the following are built by CC_FOR_BUILD - rm -f ${D}${sbindir}/rpcdebug - rm -f ${D}${sbindir}/rpcgen - rm -f ${D}${sbindir}/locktest - # Make python tools use python 3 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat |