Skip to contentSkip to conversation

package/ltp-testsuite: remove ldd commande test with static only build

PATCH Superseded Romain Naour 2 participants 6 messages May 8, 2017

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/ltp-testsuite: remove ldd commande test with static only build

ldd command build system try to build a shared library unconditionally:

arc-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -matomic -Os -static \
	-I[...]/sysroot/usr/include/tirpc   -g -O2 -fno-strict-aliasing -pipe \
	-Wall -W -Wold-style-definition -shared -o lddfile1.obj.so lddfile1.o

Fixes:
http://autobuild.buildroot.net/results/2ec/2eccf9f517ab15d8d459b06195423fdfe3fba9fa

---
 package/ltp-testsuite/ltp-testsuite.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/ltp-testsuite/ltp-testsuite.mk +8 -0
index 7f26bd2..2a7f620 100644
@@ -68,4 +68,12 @@ endef
 LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED
 endif
 
+# ldd command build system try to build a shared library unconditionally.
+ifeq ($(BR2_STATIC_LIBS),y)
+define LTP_TESTSUITE_REMOVE_LDD
+	rm -rf $(@D)/testcases/commands/ldd
+endef
+LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_LDD
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/2 package/ltp-testsuite: disable for sparc

As stated in commit [1], sparc toolchains doesn't have any of __sync_*() family of functions implementation.

When __sync_add_and_fetch() is missing, ltp fallback to a local implementation of tst_atomic_add_return() specific for each supported architecture.
But there is none for sparc.

Fixes:
http://autobuild.buildroot.net/results/d7c/d7c3b145a64ed3916b89ddb4090050f3b9205e37

[1] 6856e417da4f3aa77e2a814db2a89429af072f7d

---
 package/ltp-testsuite/Config.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/ltp-testsuite/Config.in +3 -1
index a7d3e58..070374a 100644
@@ -3,6 +3,8 @@ config BR2_PACKAGE_LTP_TESTSUITE
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	depends on !BR2_TOOLCHAIN_USES_MUSL
+	# missing __sync_*() family of functions
+	depends on !BR2_sparc
 	# does not build, cachectl.h issue
 	depends on !BR2_nios2
 	select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC
@@ -12,6 +14,6 @@ config BR2_PACKAGE_LTP_TESTSUITE
 	  http://linux-test-project.github.io
 
 comment "ltp-testsuite needs a glibc or uClibc toolchain w/ NPTL"
-	depends on !BR2_nios2
+	depends on !BR2_nios2 && !BR2_sparc
 	depends on BR2_USE_MMU
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_TOOLCHAIN_USES_MUSL
Signature · 1 line
2.9.3
#2 lore raw

PATCH 2/2 package/ltp-testsuite: disable for sparc

Hello,

package/ltp-testsuite/Config.in config BR2_PACKAGE_LTP_TESTSUITE · line 7

Quoted 2 lines · Romain Naour
package/ltp-testsuite/Config.in +2 -0
+	# missing __sync_*() family of functions
+	depends on !BR2_sparc

This is wrong: we have BR2_TOOLCHAIN_HAS_SYNC_xyz symbols for this. Sparc is not the only architecture affected.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 package/ltp-testsuite: disable for sparc

Hi Thomas,

Le 08/05/2017 ? 21:25, Thomas Petazzoni a ?crit :

Quoted 9 lines

Hello,

package/ltp-testsuite/Config.in config BR2_PACKAGE_LTP_TESTSUITE · line 7

Quoted 2 lines · Romain Naour
package/ltp-testsuite/Config.in +2 -0
+	# missing __sync_*() family of functions
+	depends on !BR2_sparc

This is wrong: we have BR2_TOOLCHAIN_HAS_SYNC_xyz symbols for this. Sparc is not the only architecture affected.

I was able to build ltp-testsuite with the following config where none of BR2_TOOLCHAIN_HAS_SYNC_* are set:

BR2_arcle=y
# BR2_ARC_ATOMIC_EXT is not set
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_PACKAGE_LTP_TESTSUITE=y

Other architecture are not available due to toolchain dependencies

So It's seems related to sparc.

I tested with test-pkg to discover these two build issues.

Best regards,
Romain

Quoted 3 lines

Thomas

#4 lore raw

PATCH 2/2 package/ltp-testsuite: disable for sparc

Hello,

Quoted 11 lines · Romain Naour
Quoted 2 lines

This is wrong: we have BR2_TOOLCHAIN_HAS_SYNC_xyz symbols for this. Sparc is not the only architecture affected.

I was able to build ltp-testsuite with the following config where none of BR2_TOOLCHAIN_HAS_SYNC_* are set:

BR2_arcle=y
# BR2_ARC_ATOMIC_EXT is not set
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_PACKAGE_LTP_TESTSUITE=y

Quoted 5 lines

Other architecture are not available due to toolchain dependencies

So It's seems related to sparc.

I tested with test-pkg to discover these two build issues.

Investigation of include/tst_atomic.h explains what's happening. Here is the code in tst_atomic.h:

#if HAVE_SYNC_ADD_AND_FETCH == 1
static inline int tst_atomic_add_return(int i, int *v)

{
        return __sync_add_and_fetch(v, i);
}

#elif defined(__i386__) || defined(__x86_64__)
... x86 specific implementation of tst_atomic_add_return() #elif defined(__powerpc__) || defined(__powerpc64__) ... powerpc specific implementation of tst_atomic_add_return() #elif defined(__s390__) || defined(__s390x__)
... S390 specific implementation of tst_atomic_add_return() #elif defined(__arc__)
... ARC specific implementation of tst_atomic_add_return() #else /* HAVE_SYNC_ADD_AND_FETCH == 1 */

# error Your compiler does not provide __sync_add_and_fetch and LTP\
        implementation is missing for your architecture.
#endif

So, the right dependency is:

# Needs __sync*() built-ins for 4-byte data, except on a few
# architectures for which a specific implementation is provided
# in ltp-testsuite
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_arc || BR2_i386 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#5 lore raw

PATCH 2/2 package/ltp-testsuite: disable for sparc

Hi Thomas,

Le 08/05/2017 ? 22:54, Thomas Petazzoni a ?crit :

Quoted 43 lines

Hello,

Quoted 11 lines · Romain Naour
Quoted 2 lines

This is wrong: we have BR2_TOOLCHAIN_HAS_SYNC_xyz symbols for this. Sparc is not the only architecture affected.

I was able to build ltp-testsuite with the following config where none of BR2_TOOLCHAIN_HAS_SYNC_* are set:

BR2_arcle=y
# BR2_ARC_ATOMIC_EXT is not set
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_PACKAGE_LTP_TESTSUITE=y

Quoted 5 lines

Other architecture are not available due to toolchain dependencies

So It's seems related to sparc.

I tested with test-pkg to discover these two build issues.

Investigation of include/tst_atomic.h explains what's happening. Here is the code in tst_atomic.h:

#if HAVE_SYNC_ADD_AND_FETCH == 1
static inline int tst_atomic_add_return(int i, int *v)

{
        return __sync_add_and_fetch(v, i);
}

#elif defined(__i386__) || defined(__x86_64__)
... x86 specific implementation of tst_atomic_add_return() #elif defined(__powerpc__) || defined(__powerpc64__) ... powerpc specific implementation of tst_atomic_add_return() #elif defined(__s390__) || defined(__s390x__)
... S390 specific implementation of tst_atomic_add_return() #elif defined(__arc__)
... ARC specific implementation of tst_atomic_add_return() #else /* HAVE_SYNC_ADD_AND_FETCH == 1 */

# error Your compiler does not provide __sync_add_and_fetch and LTP\
        implementation is missing for your architecture.
#endif
Quoted 6 lines

So, the right dependency is:

# Needs __sync*() built-ins for 4-byte data, except on a few
# architectures for which a specific implementation is provided
# in ltp-testsuite
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_arc || BR2_i386 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64

Fixed in v2, thanks for the help.

Best regards,
Romain

Quoted 5 lines

Best regards,

Thomas