Skip to contentSkip to conversation

ltp-testsuite: support building with toolchains without native RPC

RFC PATCH New Thomas De Schampheleire 1 participant 3 messages Jul 24, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC

From: Thomas De Schampheleire <[email protected]>

ltp-testsuite needs RPC, but this could also be provided by libtirpc.

---
 package/ltp-testsuite/Config.in        |  6 +++---
 package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

Important note: while this works fine on glibc toolchains, I tested with
http://autobuild.buildroot.org/toolchains/configs/br-arm-cortex-a9-musl.config
and found that the compiler cannot correctly link an empty C program (as done by the ltp-testsuite configure script) when -ltirpc is given, due to:

libtirpc.so: undefined reference to `authdes_seccreate'

This method is part of file src/auth_des.c in libtirpc, but that file is not compiled due to the patch:
0001-Disable-parts-of-TIRPC-requiring-NIS-support.patch

It is unclear to me how this can work at all for non-RPC toolchains. Any suggestions on how this should be handled are welcome...

package/ltp-testsuite/Config.in +3 -3
index 52c02ce..8374b1a 100644
@@ -6,7 +6,7 @@ config BR2_PACKAGE_LTP_TESTSUITE
 	bool "ltp-testsuite"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HAS_THREADS
-	depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	# does not build, cachectl.h issue
 	depends on !BR2_nios2
 	help
@@ -21,7 +21,7 @@ config BR2_PACKAGE_LTP_TESTSUITE
 
 	  http://ltp.sourceforge.net/
 
-comment "ltp-testsuite needs a toolchain w/ RPC, threads"
+comment "ltp-testsuite needs a toolchain w/ threads"
 	depends on !BR2_nios2
 	depends on BR2_USE_MMU
-	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/ltp-testsuite/ltp-testsuite.mk +12 -2
index 2d4f286..05ffaf1 100644
@@ -19,8 +19,18 @@ endif
 
 # ltp-testsuite uses <fts.h>, which isn't compatible with largefile
 # support.
+LTP_TESTSUITE_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))
+LTP_TESTSUITE_CPPFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))
+
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+LTP_TESTSUITE_DEPENDENCIES += libtirpc
+LTP_TESTSUITE_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/
+LTP_TESTSUITE_LDFLAGS += -ltirpc
+endif
+
 LTP_TESTSUITE_CONF_ENV += \
-	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
-	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
+	CFLAGS="$(LTP_TESTSUITE_CFLAGS)" \
+	CPPFLAGS="$(LTP_TESTSUITE_CPPFLAGS)" \
+	LDFLAGS="$(LTP_TESTSUITE_LDFLAGS)"
 
 $(eval $(autotools-package))
Signature · 1 line
1.8.5.1
#1 lore raw

RFC PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC

Quoted 15 lines · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

ltp-testsuite needs RPC, but this could also be provided by libtirpc.

---
 package/ltp-testsuite/Config.in        |  6 +++---
 package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

Important note: while this works fine on glibc toolchains, I tested with
http://autobuild.buildroot.org/toolchains/configs/br-arm-cortex-a9-musl.config
and found that the compiler cannot correctly link an empty C program (as done by the ltp-testsuite configure script) when -ltirpc is given, due to:

Quoted 8 lines

libtirpc.so: undefined reference to `authdes_seccreate'

This method is part of file src/auth_des.c in libtirpc, but that file is not compiled due to the patch:
0001-Disable-parts-of-TIRPC-requiring-NIS-support.patch

It is unclear to me how this can work at all for non-RPC toolchains. Any suggestions on how this should be handled are welcome...

This problem has now been fixed by a patch on libtirpc by J?rg Krause.

After this patch, ltp-testsuite still doesn't build on musl toolchains, but I wonder if it makes sense to try and fix that now. Instead, we could disable the package on musl toolchains?

What do you think?

Thanks,
Thomas

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

RFC PATCH 1/1 ltp-testsuite: support building with toolchains without native RPC

Quoted 34 lines · Rich Felker
Quoted 33 lines · Thomas De Schampheleire
Quoted 15 lines · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

ltp-testsuite needs RPC, but this could also be provided by libtirpc.

---
 package/ltp-testsuite/Config.in        |  6 +++---
 package/ltp-testsuite/ltp-testsuite.mk | 14 ++++++++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

Important note: while this works fine on glibc toolchains, I tested with
http://autobuild.buildroot.org/toolchains/configs/br-arm-cortex-a9-musl.config
and found that the compiler cannot correctly link an empty C program (as done by the ltp-testsuite configure script) when -ltirpc is given, due to:

Quoted 8 lines

libtirpc.so: undefined reference to `authdes_seccreate'

This method is part of file src/auth_des.c in libtirpc, but that file is not compiled due to the patch:
0001-Disable-parts-of-TIRPC-requiring-NIS-support.patch

It is unclear to me how this can work at all for non-RPC toolchains. Any suggestions on how this should be handled are welcome...

This problem has now been fixed by a patch on libtirpc by J?rg Krause.

After this patch, ltp-testsuite still doesn't build on musl toolchains, but I wonder if it makes sense to try and fix that now. Instead, we could disable the package on musl toolchains?

Quoted 7 lines
Quoted 1 line

What do you think?

To have an opinion on the matter I'd need to know more about the nature of the failures. But it sounds unfortunate to me that a test suite has blocking build failures rather than reporting failures as part of the test results. :(

First off, I now realized that ltp-testsuite was not selectable in Buildroot even before, because it does not have native RPC support, so to keep the same situation I will shortly update my patch to explicitly disable ltp-testsuite on musl toolchains.

Anyway, the first set of failures I bumped into on musl were:

/home/tdescham/repo/contrib/buildroot/output/host/usr/bin/arm-linux-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Os -I/home/tdescham/repo/contrib/buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/tirpc/ -g -O2 -fno-strict-aliasing -pipe -Wall -I. -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FORTIFY_SOURCE=2 -I../include -I../include
-I../include -I../include -c -o tst_cwd_has_free.o tst_cwd_has_free.c
tlibio.c:449:40: error: unknown type name ?sigval_t?
static void lio_async_callback_handler(sigval_t sigval)

                                        ^
tlibio.c: In function ?lio_write_buffer?:
tlibio.c:712:7: error: ?lio_async_callback_handler? undeclared (first
use in this function)
       lio_async_callback_handler;
       ^

tlibio.c:712:7: note: each undeclared identifier is reported only once for each function it appears in
tlibio.c: In function ?lio_read_buffer?:
tlibio.c:1281:7: error: ?lio_async_callback_handler? undeclared (first use in this function)

       lio_async_callback_handler;
       ^

/home/tdescham/repo/contrib/buildroot/output/host/usr/bin/arm-linux-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Os -I/home/tdescham/repo/contrib/buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/tirpc/ -g -O2 -fno-strict-aliasing -pipe -Wall -I. -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FORTIFY_SOURCE=2 -I../include -I../include
-I../include -I../include -c -o tst_fill_file.o tst_fill_file.c
make[2]: *** [tlibio.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/tdescham/repo/contrib/buildroot/output/build/ltp-testsuite-20140115/lib'
make[1]: *** [lib-all] Error 2
make[1]: Leaving directory `/home/tdescham/repo/contrib/buildroot/output/build/ltp-testsuite-20140115'
make: *** [/home/tdescham/repo/contrib/buildroot/output/build/ltp-testsuite-20140115/.stamp_built] Error 2

The first error is sigval_t not being defined.
Regarding the second: lio_async_callback_handler is defined in that same source file tlibio.c but under some conditions. I'm guessing that something is wrong with that condition matching in the musl case, but I didn't dig further.

Best regards,
Thomas