All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix build with uclibc
@ 2020-09-07 18:29 Fabrice Fontaine
  2020-09-07 19:28 ` Thomas Petazzoni
  2020-09-11 20:25 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2020-09-07 18:29 UTC (permalink / raw)
  To: buildroot

Fix a build failure with ltp-testsuite in version 20200515

Fixes:
 - http://autobuild.buildroot.org/results/fb0a67b15482e76b379b4b4d9c43b45bb0fccae1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...001-fanotify.h-fix-build-with-uclibc.patch | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/ltp-testsuite/0001-fanotify.h-fix-build-with-uclibc.patch

diff --git a/package/ltp-testsuite/0001-fanotify.h-fix-build-with-uclibc.patch b/package/ltp-testsuite/0001-fanotify.h-fix-build-with-uclibc.patch
new file mode 100644
index 0000000000..5531756970
--- /dev/null
+++ b/package/ltp-testsuite/0001-fanotify.h-fix-build-with-uclibc.patch
@@ -0,0 +1,41 @@
+From cb11e718ce04261cb6ff4c09442b949da33b8797 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 5 Sep 2020 17:55:45 +0200
+Subject: [PATCH] fanotify.h: fix build with uclibc
+
+MAX_HANDLE_SZ is used since version 20200515 and
+https://github.com/linux-test-project/ltp/commit/d20a3e8f9a794e0659277acfa9fbcf7454ba4631
+
+However, it is not defined by uclibc, so define it if needed to avoid
+the following build failure:
+
+fanotify.h:171:11: error: 'MAX_HANDLE_SZ' undeclared here (not in a function)
+  171 |  char buf[MAX_HANDLE_SZ];
+
+Fixes:
+ - http://autobuild.buildroot.org/results/fb0a67b15482e76b379b4b4d9c43b45bb0fccae1
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
+[Retrieved from:
+https://github.com/linux-test-project/ltp/commit/cb11e718ce04261cb6ff4c09442b949da33b8797]
+---
+ testcases/kernel/syscalls/fanotify/fanotify.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
+index a9a431ca2f..d271578e97 100644
+--- a/testcases/kernel/syscalls/fanotify/fanotify.h
++++ b/testcases/kernel/syscalls/fanotify/fanotify.h
+@@ -139,6 +139,11 @@ struct fanotify_event_info_fid {
+ #endif /* HAVE_STRUCT_FANOTIFY_EVENT_INFO_FID_FSID___VAL */
+ 
+ #ifdef HAVE_NAME_TO_HANDLE_AT
++
++#ifndef MAX_HANDLE_SZ
++#define MAX_HANDLE_SZ		128
++#endif
++
+ /*
+  * Helper function used to obtain fsid and file_handle for a given path.
+  * Used by test files correlated to FAN_REPORT_FID functionality.
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix build with uclibc
  2020-09-07 18:29 [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix build with uclibc Fabrice Fontaine
@ 2020-09-07 19:28 ` Thomas Petazzoni
  2020-09-11 20:25 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2020-09-07 19:28 UTC (permalink / raw)
  To: buildroot

On Mon,  7 Sep 2020 20:29:22 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix a build failure with ltp-testsuite in version 20200515
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/fb0a67b15482e76b379b4b4d9c43b45bb0fccae1
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...001-fanotify.h-fix-build-with-uclibc.patch | 41 +++++++++++++++++++
>  1 file changed, 41 insertions(+)
>  create mode 100644 package/ltp-testsuite/0001-fanotify.h-fix-build-with-uclibc.patch

I have applied as a simple and immediate fix, but the real fix is to
add this missing define in uClibc.

Indeed the man page of name_to_handle_at() is pretty clear:

       It is the caller's responsibility to allocate the structure with a size
       large enough to hold the handle returned in f_handle.  Before the call,
       the  handle_bytes  field should be initialized to contain the allocated
       size for f_handle.  (The constant MAX_HANDLE_SZ, defined in  <fcntl.h>,
       specifies  the  maximum  expected  size for a file handle.  It is not a
       guaranteed upper limit as future filesystems may require  more  space.)
       Upon  successful  return,  the handle_bytes field is updated to contain
       the number of bytes actually written to f_handle.

So, this MAX_HANDLE_SZ should be defined by the C library. uClibc-ng
defines struct file_handle, but does not define MAX_HANDLE_SZ, which is
not good.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix build with uclibc
  2020-09-07 18:29 [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix build with uclibc Fabrice Fontaine
  2020-09-07 19:28 ` Thomas Petazzoni
@ 2020-09-11 20:25 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-09-11 20:25 UTC (permalink / raw)
  To: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix a build failure with ltp-testsuite in version 20200515
 > Fixes:
 >  - http://autobuild.buildroot.org/results/fb0a67b15482e76b379b4b4d9c43b45bb0fccae1

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2020.08.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-11 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 18:29 [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix build with uclibc Fabrice Fontaine
2020-09-07 19:28 ` Thomas Petazzoni
2020-09-11 20:25 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.