diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-07-26 00:08:30 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-07-27 21:07:53 +0100 |
commit | 5d66e8166fdf4087abd8db6c0cc2270a61230629 (patch) | |
tree | 9b6070b3ef003674065558a8023bd6f1c35ef712 /meta/recipes-connectivity/nfs-utils | |
parent | 9205ac1d5359546883719918dddd75d354b7b5fd (diff) | |
download | poky-5d66e8166fdf4087abd8db6c0cc2270a61230629.tar.gz |
nfs-utils: Fix host path contamination building locktest
(From OE-Core rev: c4a50b0738235ce6fdff078d513827ba00b8affc)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/nfs-utils')
3 files changed, 91 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch new file mode 100644 index 0000000000..351407ddcd --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 9efa7a0d37665d9bb0f46d2407883a5ab42c2b84 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 24 Jul 2023 20:39:16 -0700 | ||
4 | Subject: [PATCH] locktest: Makefile.am: Do not use build flags | ||
5 | |||
6 | Using CFLAGS_FOR_BUILD etc. here means it is using wrong flags | ||
7 | when thse flags are speficied different than target flags which | ||
8 | is common when cross-building. It can pass wrong paths to linker | ||
9 | and it would find incompatible libraries during link since they | ||
10 | are from host system and target maybe not same as build host. | ||
11 | |||
12 | Fixes subtle errors like | ||
13 | | aarch64-yoe-linux-ld.lld: error: /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/nfs-utils/2.6.3-r0/recipe-sysroot-native/usr/lib/libsqlite3.so is incompatible with elf64-littleaarch64 | ||
14 | |||
15 | Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=169025681008001&w=2] | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | tools/locktest/Makefile.am | 3 --- | ||
19 | 1 file changed, 3 deletions(-) | ||
20 | |||
21 | diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am | ||
22 | index e8914655..2fd36971 100644 | ||
23 | --- a/tools/locktest/Makefile.am | ||
24 | +++ b/tools/locktest/Makefile.am | ||
25 | @@ -2,8 +2,5 @@ | ||
26 | |||
27 | noinst_PROGRAMS = testlk | ||
28 | testlk_SOURCES = testlk.c | ||
29 | -testlk_CFLAGS=$(CFLAGS_FOR_BUILD) | ||
30 | -testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) | ||
31 | -testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
32 | |||
33 | MAINTAINERCLEANFILES = Makefile.in | ||
34 | -- | ||
35 | 2.41.0 | ||
36 | |||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-tools-locktest-Use-intmax_t-to-print-off_t.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-tools-locktest-Use-intmax_t-to-print-off_t.patch new file mode 100644 index 0000000000..7d903e04bc --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-tools-locktest-Use-intmax_t-to-print-off_t.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From e2e9251dbeb452f5382179023d8ae18b511167a1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 25 Jul 2023 23:47:08 -0700 | ||
4 | Subject: [PATCH] tools/locktest: Use intmax_t to print off_t | ||
5 | |||
6 | off_t could be 64bit on 32bit architectures which means using %z printf | ||
7 | modifier is not enough to print it and compiler will complain about | ||
8 | format mismatch | ||
9 | |||
10 | Fixes | ||
11 | | testlk.c:84:66: error: format '%zd' expects argument of type 'signed size_t', but argument 4 has type '__off64_t' {aka 'long long int'} [-Werror=format=] | ||
12 | | 84 | printf("%s: conflicting lock by %d on (%zd;%zd)\n", | ||
13 | | | ~~^ | ||
14 | | | | | ||
15 | | | int | ||
16 | | | %lld | ||
17 | | 85 | fname, fl.l_pid, fl.l_start, fl.l_len); | ||
18 | | | ~~~~~~~~~~ | ||
19 | | | | | ||
20 | | | __off64_t {aka long long int} | ||
21 | |||
22 | Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=169035457128067&w=2] | ||
23 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
24 | --- | ||
25 | tools/locktest/testlk.c | 5 +++-- | ||
26 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/tools/locktest/testlk.c b/tools/locktest/testlk.c | ||
29 | index ea51f788..9d4c88c4 100644 | ||
30 | --- a/tools/locktest/testlk.c | ||
31 | +++ b/tools/locktest/testlk.c | ||
32 | @@ -2,6 +2,7 @@ | ||
33 | #include <config.h> | ||
34 | #endif | ||
35 | |||
36 | +#include <stdint.h> | ||
37 | #include <stdlib.h> | ||
38 | #include <stdio.h> | ||
39 | #include <unistd.h> | ||
40 | @@ -81,8 +82,8 @@ main(int argc, char **argv) | ||
41 | if (fl.l_type == F_UNLCK) { | ||
42 | printf("%s: no conflicting lock\n", fname); | ||
43 | } else { | ||
44 | - printf("%s: conflicting lock by %d on (%zd;%zd)\n", | ||
45 | - fname, fl.l_pid, fl.l_start, fl.l_len); | ||
46 | + printf("%s: conflicting lock by %d on (%jd;%jd)\n", | ||
47 | + fname, fl.l_pid, (intmax_t)fl.l_start, (intmax_t)fl.l_len); | ||
48 | } | ||
49 | return 0; | ||
50 | } | ||
51 | -- | ||
52 | 2.41.0 | ||
53 | |||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.3.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.3.bb index 4454285789..e703395cc4 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.3.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.3.bb | |||
@@ -31,6 +31,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x | |||
31 | file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ | 31 | file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ |
32 | file://clang-warnings.patch \ | 32 | file://clang-warnings.patch \ |
33 | file://0001-configure.ac-libevent-and-libsqlite3-checked-when-nf.patch \ | 33 | file://0001-configure.ac-libevent-and-libsqlite3-checked-when-nf.patch \ |
34 | file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ | ||
35 | file://0001-tools-locktest-Use-intmax_t-to-print-off_t.patch \ | ||
34 | " | 36 | " |
35 | SRC_URI[sha256sum] = "38d89e853a71d3c560ff026af3d969d75e24f782ff68324e76261fe0344459e1" | 37 | SRC_URI[sha256sum] = "38d89e853a71d3c560ff026af3d969d75e24f782ff68324e76261fe0344459e1" |
36 | 38 | ||