diff options
3 files changed, 62 insertions, 44 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch deleted file mode 100644 index d14f0789ff..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | From 66471fbf7106917da7a1536b18a0a77d07479779 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <Mingli.Yu@windriver.com> | ||
3 | Date: Mon, 17 Dec 2018 15:29:47 +0800 | ||
4 | Subject: [PATCH] configure.ac: Do not fatalize -Wmissing-prototypes | ||
5 | |||
6 | There comes below error when run "make -C tests/nsm_client nsm_client" | ||
7 | | nlm_sm_inter_svc.c:20:1: error: no previous prototype for 'nlm_sm_prog_3' [-Werror=missing-prototypes] | ||
8 | |||
9 | It is because rpcgen doesn't generate -Wmissing-prototypes | ||
10 | free code for nlm_sm_inter_svc.c with below logic | ||
11 | in tests/nsm_client/Makefile.am | ||
12 | [snip] | ||
13 | GENFILES_SVC = nlm_sm_inter_svc.c | ||
14 | [snip] | ||
15 | $(GENFILES_SVC): %_svc.c: %.x $(RPCGEN) | ||
16 | test -f $@ && rm -rf $@ || true | ||
17 | $(RPCGEN) -m -o $@ $< | ||
18 | |||
19 | So add the logic not to fatalize -Wmissing-prototypes. | ||
20 | |||
21 | Upstream-Status: Submitted[https://marc.info/?l=linux-nfs&m=154503260323936&w=2] | ||
22 | |||
23 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
24 | --- | ||
25 | configure.ac | 2 +- | ||
26 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
27 | |||
28 | diff --git a/configure.ac b/configure.ac | ||
29 | index 50002b4..aebff01 100644 | ||
30 | --- a/configure.ac | ||
31 | +++ b/configure.ac | ||
32 | @@ -582,7 +582,7 @@ my_am_cflags="\ | ||
33 | -Wall \ | ||
34 | -Wextra \ | ||
35 | $rpcgen_cflags \ | ||
36 | - -Werror=missing-prototypes \ | ||
37 | + -Wmissing-prototypes \ | ||
38 | -Werror=missing-declarations \ | ||
39 | -Werror=format=2 \ | ||
40 | -Werror=undef \ | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch new file mode 100644 index 0000000000..20400fef67 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | Detect warning options during configure | ||
2 | |||
3 | Certain options maybe compiler specific therefore its better | ||
4 | to detect them before use. | ||
5 | |||
6 | nfs_error copies the format string and appends newline to it | ||
7 | but compiler can forget that it was format string since its not | ||
8 | same fmt string that was passed. Ignore the warning | ||
9 | |||
10 | Wdiscarded-qualifiers is gcc specific and this is no longer needed | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | |||
15 | --- a/configure.ac | ||
16 | +++ b/configure.ac | ||
17 | @@ -599,7 +599,6 @@ my_am_cflags="\ | ||
18 | -Werror=parentheses \ | ||
19 | -Werror=aggregate-return \ | ||
20 | -Werror=unused-result \ | ||
21 | - -Wno-cast-function-type \ | ||
22 | -fno-strict-aliasing \ | ||
23 | " | ||
24 | |||
25 | @@ -619,9 +618,10 @@ CHECK_CCSUPPORT([-Werror=format-overflow | ||
26 | CHECK_CCSUPPORT([-Werror=int-conversion], [flg2]) | ||
27 | CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3]) | ||
28 | CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4]) | ||
29 | +CHECK_CCSUPPORT([-Wno-cast-function-type], [flg5]) | ||
30 | AX_GCC_FUNC_ATTRIBUTE([format]) | ||
31 | |||
32 | -AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4"]) | ||
33 | +AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4 $flg5"]) | ||
34 | |||
35 | # Make sure that $ACLOCAL_FLAGS are used during a rebuild | ||
36 | AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"]) | ||
37 | --- a/support/nfs/xcommon.c | ||
38 | +++ b/support/nfs/xcommon.c | ||
39 | @@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) { | ||
40 | |||
41 | fmt2 = xstrconcat2 (fmt, "\n"); | ||
42 | va_start (args, fmt); | ||
43 | +#pragma GCC diagnostic push | ||
44 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
45 | vfprintf (stderr, fmt2, args); | ||
46 | +#pragma GCC diagnostic pop | ||
47 | va_end (args); | ||
48 | free (fmt2); | ||
49 | } | ||
50 | --- a/utils/mount/stropts.c | ||
51 | +++ b/utils/mount/stropts.c | ||
52 | @@ -1094,9 +1094,7 @@ static int nfsmount_fg(struct nfsmount_i | ||
53 | if (nfs_try_mount(mi)) | ||
54 | return EX_SUCCESS; | ||
55 | |||
56 | -#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" | ||
57 | if (errno == EBUSY && is_mountpoint(mi->node)) { | ||
58 | -#pragma GCC diagnostic warning "-Wdiscarded-qualifiers" | ||
59 | /* | ||
60 | * EBUSY can happen when mounting a filesystem that | ||
61 | * is already mounted or when the context= are | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.2.bb index df3070bd8b..6647d3428b 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.2.bb | |||
@@ -31,9 +31,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x | |||
31 | file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ | 31 | file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ |
32 | file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ | 32 | file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ |
33 | file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ | 33 | file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ |
34 | file://clang-warnings.patch \ | ||
34 | " | 35 | " |
35 | SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch" | ||
36 | |||
37 | SRC_URI[md5sum] = "d427c6b3014e9a04e8498f0598b1c1b9" | 36 | SRC_URI[md5sum] = "d427c6b3014e9a04e8498f0598b1c1b9" |
38 | SRC_URI[sha256sum] = "4464737a03d5f73ded2ffefe19d5543ed7b1d6c541985d8acaafdc8025aa1038" | 37 | SRC_URI[sha256sum] = "4464737a03d5f73ded2ffefe19d5543ed7b1d6c541985d8acaafdc8025aa1038" |
39 | 38 | ||
@@ -62,8 +61,6 @@ EXTRA_OECONF = "--with-statduser=rpcuser \ | |||
62 | --with-statdpath=/var/lib/nfs/statd \ | 61 | --with-statdpath=/var/lib/nfs/statd \ |
63 | " | 62 | " |
64 | 63 | ||
65 | CFLAGS += "-Wno-error=format-overflow" | ||
66 | |||
67 | PACKAGECONFIG ??= "tcp-wrappers \ | 64 | PACKAGECONFIG ??= "tcp-wrappers \ |
68 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ | 65 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ |
69 | " | 66 | " |