* [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support
@ 2019-04-17 13:54 Nikita Sobolev
2019-04-17 13:57 ` Thomas Petazzoni
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Nikita Sobolev @ 2019-04-17 13:54 UTC (permalink / raw)
To: buildroot
Add patch, that fixes build on uClibc with disabled fts.h support
and MUSL, which does not have fts.h at all.
Original patch [1] will be a part of the next LTP release and
current patch should be removed from Buildroot when LTP version
is bumped.
[1] https://github.com/linux-test-project/ltp/commit/b24f3d32c54006af5499da5a7ac418eafcf6e459
Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
---
.../0002-cpuset-Detect-missing-fts.h.patch | 76 ++++++++++++++++++++++
1 file changed, 76 insertions(+)
create mode 100644 package/ltp-testsuite/0002-cpuset-Detect-missing-fts.h.patch
diff --git a/package/ltp-testsuite/0002-cpuset-Detect-missing-fts.h.patch b/package/ltp-testsuite/0002-cpuset-Detect-missing-fts.h.patch
new file mode 100644
index 0000000000..22d954ba51
--- /dev/null
+++ b/package/ltp-testsuite/0002-cpuset-Detect-missing-fts.h.patch
@@ -0,0 +1,76 @@
+From b24f3d32c54006af5499da5a7ac418eafcf6e459 Mon Sep 17 00:00:00 2001
+From: Petr Vorel <petr.vorel@gmail.com>
+Date: Thu, 21 Mar 2019 22:08:31 +0100
+Subject: [PATCH] cpuset: Detect missing fts.h
+
+This fixes build on uClibc with disabled fts.h support and MUSL, which
+does not have fts.h at all.
+
+Reported-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
+[Nikita:
+ - back-ported to ltp-full-20190115 release]
+Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
+---
+ configure.ac | 1 +
+ include/mk/config.mk.in | 1 +
+ m4/ltp-fts.m4 | 7 +++++++
+ testcases/kernel/controllers/Makefile | 4 ++++
+ 4 files changed, 13 insertions(+)
+ create mode 100644 m4/ltp-fts.m4
+
+diff --git a/configure.ac b/configure.ac
+index e002c248e..f05db9d2e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -231,6 +231,7 @@ LTP_CHECK_TPACKET_V3
+ LTP_CHECK_RLIMIT64
+ LTP_DETECT_HOST_CPU
+ LTP_CHECK_PERF_EVENT
++LTP_CHECK_FTS_H
+
+ if test "x$with_numa" = xyes; then
+ LTP_CHECK_SYSCALL_NUMA
+diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in
+index 01f178bff..d55fe9602 100644
+--- a/include/mk/config.mk.in
++++ b/include/mk/config.mk.in
+@@ -46,6 +46,7 @@ SELINUX_LIBS := @SELINUX_LIBS@
+ TIRPC_CPPFLAGS := @TIRPC_CPPFLAGS@
+ TIRPC_LIBS := @TIRPC_LIBS@
+ KEYUTILS_LIBS := @KEYUTILS_LIBS@
++HAVE_FTS_H := @HAVE_FTS_H@
+
+ prefix := @prefix@
+
+diff --git a/m4/ltp-fts.m4 b/m4/ltp-fts.m4
+new file mode 100644
+index 000000000..0da692f23
+--- /dev/null
++++ b/m4/ltp-fts.m4
+@@ -0,0 +1,7 @@
++dnl SPDX-License-Identifier: GPL-2.0-or-later
++dnl Copyright (c) 2019 Petr Vorel <petr.vorel@gmail.com>
++
++AC_DEFUN([LTP_CHECK_FTS_H],[
++ AC_CHECK_HEADERS(fts.h, [have_fts=1])
++ AC_SUBST(HAVE_FTS_H, $have_fts)
++])
+diff --git a/testcases/kernel/controllers/Makefile b/testcases/kernel/controllers/Makefile
+index 404073947..548692cb8 100644
+--- a/testcases/kernel/controllers/Makefile
++++ b/testcases/kernel/controllers/Makefile
+@@ -29,6 +29,10 @@ LIBDIR := libcontrollers
+ LIB := $(LIBDIR)/libcontrollers.a
+ FILTER_OUT_DIRS := $(LIBDIR)
+
++ifneq ($(HAVE_FTS_H),1)
++ FILTER_OUT_DIRS += cpuset
++endif
++
+ $(LIBDIR):
+ mkdir -p "$@"
+
+--
+2.17.1
+
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support
2019-04-17 13:54 [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support Nikita Sobolev
@ 2019-04-17 13:57 ` Thomas Petazzoni
2019-04-17 22:55 ` Petr Vorel
2019-04-21 10:36 ` Thomas Petazzoni
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2019-04-17 13:57 UTC (permalink / raw)
To: buildroot
Hello Nikita,
On Wed, 17 Apr 2019 16:54:58 +0300
Nikita Sobolev <Nikita.Sobolev@synopsys.com> wrote:
> Add patch, that fixes build on uClibc with disabled fts.h support
> and MUSL, which does not have fts.h at all.
Then shouldn't the patch also remove the:
depends on !BR2_TOOLCHAIN_USES_MUSL
from package/ltp-testsuite/Config.in ?
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support
2019-04-17 13:54 [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support Nikita Sobolev
2019-04-17 13:57 ` Thomas Petazzoni
@ 2019-04-17 22:55 ` Petr Vorel
2019-04-21 10:36 ` Thomas Petazzoni
2 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2019-04-17 22:55 UTC (permalink / raw)
To: buildroot
Hi Nikita,
> Add patch, that fixes build on uClibc with disabled fts.h support
> and MUSL, which does not have fts.h at all.
Due autotools macros changes, which requires running autoreconf you need to add
into package/ltp-testsuite/ltp-testsuite.mk:
# Required by patch 0002-cpuset-Detect-missing-fts.h.patch
LTP_TESTSUITE_AUTORECONF = YES
FYI: while my patch in LTP upstream fixes uClibc with disabled fts.h, it's not
enough for MUSL build, which is disabled. I've sent some experimental support to
buildroot ML last month [2] (backported some fixes + simply delete the rest of
problematic tests), but due either my problems with patchwork or outdated
patchwork instance on ozlabs it didn't arrive to buildroot patchwork.
And I don't know whether buildroot uses (or allows user) to disable
UCLIBC_HAS_FTS (whether this patch is actually useful).
> Original patch [1] will be a part of the next LTP release and
> current patch should be removed from Buildroot when LTP version
> is bumped.
NOTE: we're planning next release in about 2 weeks, I usually update package the
same day.
> [1] https://github.com/linux-test-project/ltp/commit/b24f3d32c54006af5499da5a7ac418eafcf6e459
> Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
Acked-by: Petr Vorel <petr.vorel@gmail.com>
(with LTP_TESTSUITE_AUTORECONF = yes)
Kind regards,
Petr
[2] http://lists.busybox.net/pipermail/buildroot/2019-March/thread.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support
2019-04-17 13:54 [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support Nikita Sobolev
2019-04-17 13:57 ` Thomas Petazzoni
2019-04-17 22:55 ` Petr Vorel
@ 2019-04-21 10:36 ` Thomas Petazzoni
2019-04-22 17:20 ` Petr Vorel
2 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2019-04-21 10:36 UTC (permalink / raw)
To: buildroot
On Wed, 17 Apr 2019 16:54:58 +0300
Nikita Sobolev <Nikita.Sobolev@synopsys.com> wrote:
> Add patch, that fixes build on uClibc with disabled fts.h support
> and MUSL, which does not have fts.h at all.
>
> Original patch [1] will be a part of the next LTP release and
> current patch should be removed from Buildroot when LTP version
> is bumped.
>
> [1] https://github.com/linux-test-project/ltp/commit/b24f3d32c54006af5499da5a7ac418eafcf6e459
>
> Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
> ---
> .../0002-cpuset-Detect-missing-fts.h.patch | 76 ++++++++++++++++++++++
> 1 file changed, 76 insertions(+)
> create mode 100644 package/ltp-testsuite/0002-cpuset-Detect-missing-fts.h.patch
I am confused, because the current ltp-testsuite package seems to build
properly with uClibc that doesn't have FTS support enabled. I just
built the following configuration:
BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2019.02-rc1.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_14=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_LTP_TESTSUITE=y
# BR2_TARGET_ROOTFS_TAR is not set
It has FTS disabled:
$ grep FTS output/staging/usr/include/bits/uClibc_config.h
#undef __UCLIBC_HAS_FTS__
And it builds perfectly fine.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support
2019-04-21 10:36 ` Thomas Petazzoni
@ 2019-04-22 17:20 ` Petr Vorel
2019-04-22 18:54 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2019-04-22 17:20 UTC (permalink / raw)
To: buildroot
Hi Thomas,
> I am confused, because the current ltp-testsuite package seems to build
> properly with uClibc that doesn't have FTS support enabled. I just
> built the following configuration:
> BR2_arm=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2019.02-rc1.tar.bz2"
> BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_14=y
> BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
> # BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_LTP_TESTSUITE=y
> # BR2_TARGET_ROOTFS_TAR is not set
> It has FTS disabled:
> $ grep FTS output/staging/usr/include/bits/uClibc_config.h
> #undef __UCLIBC_HAS_FTS__
> And it builds perfectly fine.
Thanks for a research (I'll do more testing next time, not just reviewing)!
Actually testing it, it's really ok, due these lines in
package/ltp-testsuite/ltp-testsuite.mk:
# Requires uClibc fts and bessel support, normally not enabled
ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
define LTP_TESTSUITE_REMOVE_UNSUPPORTED
rm -rf $(@D)/testcases/kernel/controllers/cpuset/
rm -rf $(@D)/testcases/misc/math/float/bessel/
rm -f $(@D)/testcases/misc/math/float/float_bessel.c
endef
LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED
endif
We can either remove deleting testcases/kernel/controllers/cpuset/ as part of
this patchset, or simply wait for next update (planning for the start of the
second week in the May [1]), I'd remove it during the update.
Kind regards,
Petr
[1] http://lists.linux.it/pipermail/ltp/2019-April/011729.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support
2019-04-22 17:20 ` Petr Vorel
@ 2019-04-22 18:54 ` Thomas Petazzoni
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2019-04-22 18:54 UTC (permalink / raw)
To: buildroot
On Mon, 22 Apr 2019 19:20:51 +0200
Petr Vorel <petr.vorel@gmail.com> wrote:
> > And it builds perfectly fine.
> Thanks for a research (I'll do more testing next time, not just reviewing)!
> Actually testing it, it's really ok, due these lines in
> package/ltp-testsuite/ltp-testsuite.mk:
>
> # Requires uClibc fts and bessel support, normally not enabled
> ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
> define LTP_TESTSUITE_REMOVE_UNSUPPORTED
> rm -rf $(@D)/testcases/kernel/controllers/cpuset/
> rm -rf $(@D)/testcases/misc/math/float/bessel/
> rm -f $(@D)/testcases/misc/math/float/float_bessel.c
> endef
> LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED
> endif
>
> We can either remove deleting testcases/kernel/controllers/cpuset/ as part of
> this patchset, or simply wait for next update (planning for the start of the
> second week in the May [1]), I'd remove it during the update.
Yes, let's wait for the new version of ltp-testsuite. The current
Buildroot package builds just fine with uClibc, I don't really see the
point of adding another ltp-testsuite patch at this point.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-22 18:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-17 13:54 [Buildroot] [PATCH] ltp-testsuite: Fix uClibc build with disabled fts.h support Nikita Sobolev
2019-04-17 13:57 ` Thomas Petazzoni
2019-04-17 22:55 ` Petr Vorel
2019-04-21 10:36 ` Thomas Petazzoni
2019-04-22 17:20 ` Petr Vorel
2019-04-22 18:54 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox