Skip to contentSkip to conversation

package/rt-tests: add support to build without numactl

PATCH Superseded Andreas Klinger 2 participants 2 messages Dec 27, 2020

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/rt-tests: add support to build without numactl

rt-tests don't show up in config menu and is not build if BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS is not available on the target architecture. In such a case numactl is also not available what applies for most small embedded targets.

This dependency was introduced with commit 7f50cbfb800e ("package/rt-tests: bump to version 1.8")

But rt-tests can also be build without numactl when passing NUMA=0 to make. This possibility is documented on
https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/rt-tests

Change Config.in and makefile to build without numactl by passing NUMA=0.

Changes in v2:
- Thanks to the review of Baruch patch is simplified and directly disabling NUMA by querying for !BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS.

---
 package/rt-tests/Config.in   | 4 +---
 package/rt-tests/rt-tests.mk | 7 ++++++-
 2 files changed, 7 insertions(+), 4 deletions(-)
package/rt-tests/Config.in +1 -3
index cc9b14dccb..4e7fa50a1a 100644
@@ -5,8 +5,7 @@ config BR2_PACKAGE_RT_TESTS
 	depends on BR2_USE_MMU # fork()
 	depends on !BR2_STATIC_LIBS # dlopen
 	depends on !BR2_TOOLCHAIN_USES_MUSL # cyclictest
-	depends on BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS
-	select BR2_PACKAGE_NUMACTL
+	select BR2_PACKAGE_NUMACTL if BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS
 	help
 	  Set of utilities for testing the real-time behaviour of a
 	  Linux system.
@@ -34,4 +33,3 @@ comment "rt-tests needs a uClibc or glibc toolchain w/ NPTL, headers >= 3.14, dy
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS \
 		|| BR2_TOOLCHAIN_USES_MUSL || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
 	depends on BR2_USE_MMU
-	depends on BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS
package/rt-tests/rt-tests.mk +6 -1
index 26c257213b..c6c1a69f0d 100644
@@ -11,11 +11,16 @@ RT_TESTS_LICENSE = GPL-2.0+
 RT_TESTS_LICENSE_FILES = COPYING
 RT_TESTS_DEPENDENCIES = numactl
 
+ifneq ($(BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS),y)
+RT_TESTS_MAKE_OPTS += NUMA=0
+endif
+
 define RT_TESTS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		CC="$(TARGET_CC)" \
 		CFLAGS="$(TARGET_CFLAGS)" \
-		prefix=/usr
+		prefix=/usr \
+		$(RT_TESTS_MAKE_OPTS)
 endef
 
 define RT_TESTS_INSTALL_TARGET_CMDS
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 package/rt-tests: add support to build without numactl

Hi Andreas,

Quoted 48 lines · Andreas Klinger

rt-tests don't show up in config menu and is not build if BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS is not available on the target architecture. In such a case numactl is also not available what applies for most small embedded targets.

This dependency was introduced with commit 7f50cbfb800e ("package/rt-tests: bump to version 1.8")

But rt-tests can also be build without numactl when passing NUMA=0 to make. This possibility is documented on
https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/rt-tests

Change Config.in and makefile to build without numactl by passing NUMA=0.

Changes in v2:
- Thanks to the review of Baruch patch is simplified and directly disabling NUMA by querying for !BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS.

---
 package/rt-tests/Config.in   | 4 +---
 package/rt-tests/rt-tests.mk | 7 ++++++-
 2 files changed, 7 insertions(+), 4 deletions(-)
package/rt-tests/Config.in +1 -3
index cc9b14dccb..4e7fa50a1a 100644
@@ -5,8 +5,7 @@ config BR2_PACKAGE_RT_TESTS
 	depends on BR2_USE_MMU # fork()
 	depends on !BR2_STATIC_LIBS # dlopen
 	depends on !BR2_TOOLCHAIN_USES_MUSL # cyclictest
-	depends on BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS
-	select BR2_PACKAGE_NUMACTL
+	select BR2_PACKAGE_NUMACTL if BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS
 	help
 	  Set of utilities for testing the real-time behaviour of a
 	  Linux system.
@@ -34,4 +33,3 @@ comment "rt-tests needs a uClibc or glibc toolchain w/ NPTL, headers >= 3.14, dy
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS \
 		|| BR2_TOOLCHAIN_USES_MUSL || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
 	depends on BR2_USE_MMU
-	depends on BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS
package/rt-tests/rt-tests.mk +0 -0
index 26c257213b..c6c1a69f0d 100644

package/rt-tests/rt-tests.mk RT_TESTS_LICENSE = GPL-2.0+ · line 12

Quoted 2 lines
package/rt-tests/rt-tests.mk +0 -0
@@ -11,11 +11,16 @@ RT_TESTS_LICENSE = GPL-2.0+
 RT_TESTS_LICENSE_FILES = COPYING
 RT_TESTS_DEPENDENCIES = numactl

This should depend on BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS. Otherwise numactl will build on unsupported architectures.

package/rt-tests/rt-tests.mk RT_TESTS_LICENSE = GPL-2.0+ · line 14

Quoted 1 line
package/rt-tests/rt-tests.mk +1 -0
+ifneq ($(BR2_PACKAGE_NUMACTL_ARCH_SUPPORTS),y)

Positive logic is better. You need 'ifeq' anyway for the numactl dependency.

baruch

Quoted 13 lines
package/rt-tests/rt-tests.mk +5 -1
+RT_TESTS_MAKE_OPTS += NUMA=0
+endif
+
 define RT_TESTS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		CC="$(TARGET_CC)" \
 		CFLAGS="$(TARGET_CFLAGS)" \
-		prefix=/usr
+		prefix=/usr \
+		$(RT_TESTS_MAKE_OPTS)
 endef
 
 define RT_TESTS_INSTALL_TARGET_CMDS
Signature · 3 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -