Skip to contentSkip to conversation

uclibc: build tests after uClibc libs are installed to staging location

PATCH New Alexey Brodkin 2 participants 4 messages Jul 22, 2014 – Jul 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uclibc: build tests after uClibc libs are installed to staging location

If libuClibc is not installed to staging on attempt to build tests following
errors happen:
============
TEST_LINK termios/ termios
.../host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/crt1.o: In function `__start':
.../build/uclibc/libc/sysdeps/linux/arc/crt1.S:53: undefined reference to `__uClibc_main'
termios.o: In function `main':
.../build/uclibc/test/termios/termios.c:13: undefined reference to `printf'
.../build/uclibc/test/termios/termios.c:14: undefined reference to `printf'
.../build/uclibc/test/termios/termios.c:16: undefined reference to `stdout'
.../build/uclibc/test/termios/termios.c:16: undefined reference to `fileno'
.../build/uclibc/test/termios/termios.c:16: undefined reference to `ioctl'
.../build/uclibc/test/termios/termios.c:19: undefined reference to `perror'
.../build/uclibc/test/termios/termios.c:21: undefined reference to printf' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to memcpy' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to malloc' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to abort' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to calloc' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to dl_iterate_phdr' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to realloc' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to memset' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to strlen' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to free'
collect2: error: ld returned 1 exit status
make[3]: *** [termios] Error 1
============

And the simplest solution is to build tests right before installation in UCLIBC_INSTALL_TARGET_CMDS which follows UCLIBC_INSTALL_STAGING_CMDS so all required libs are in place.

Interesting note - if one enables uClibc tests after initial full buildroot build mentioned errors don't happen. This is because uClibc libc libs are already installed to staging. That's why I didn't noticed this problem before.

Cc Anton Kolesov <[email protected]>
Cc Peter Korsgaard <[email protected]>
Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/uclibc/uclibc.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/uclibc/uclibc.mk +1 -1
index b7c5051..d5be938 100644
@@ -506,7 +506,6 @@ define UCLIBC_BUILD_CMDS
 	$(MAKE) -C $(@D)/utils \
 		PREFIX=$(HOST_DIR) \
 		HOSTCC="$(HOSTCC)" hostutils
-	$(UCLIBC_BUILD_TEST_SUITE)
 endef
 
 ifeq ($(BR2_UCLIBC_INSTALL_TEST_SUITE),y)
@@ -536,6 +535,7 @@ define UCLIBC_INSTALL_TARGET_CMDS
 		RUNTIME_PREFIX=/ \
 		install_runtime
 	$(UCLIBC_INSTALL_UTILS_TARGET)
+	$(UCLIBC_BUILD_TEST_SUITE)
 	$(UCLIBC_INSTALL_TEST_SUITE)
 endef
 
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 uclibc: build tests after uClibc libs are installed to staging location

Hi,

Quoted 27 lines · Alexey Brodkin

If libuClibc is not installed to staging on attempt to build tests following
errors happen:
============
TEST_LINK termios/ termios
.../host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/crt1.o: In function `__start':
.../build/uclibc/libc/sysdeps/linux/arc/crt1.S:53: undefined reference to `__uClibc_main'
termios.o: In function `main':
.../build/uclibc/test/termios/termios.c:13: undefined reference to `printf'
.../build/uclibc/test/termios/termios.c:14: undefined reference to `printf'
.../build/uclibc/test/termios/termios.c:16: undefined reference to `stdout'
.../build/uclibc/test/termios/termios.c:16: undefined reference to `fileno'
.../build/uclibc/test/termios/termios.c:16: undefined reference to `ioctl'
.../build/uclibc/test/termios/termios.c:19: undefined reference to `perror'
.../build/uclibc/test/termios/termios.c:21: undefined reference to printf' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to memcpy' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to malloc' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to abort' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to calloc' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to dl_iterate_phdr' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to realloc' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to memset' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to strlen' .../host/usr/lib/gcc/arc-buildroot-linux-uclibc/4.8.0/../../../../arc-buildroot-linux-uclibc/lib/libgcc_s.so.1: undefined reference to free'
collect2: error: ld returned 1 exit status
make[3]: *** [termios] Error 1
============

Quoted 7 lines

And the simplest solution is to build tests right before installation in UCLIBC_INSTALL_TARGET_CMDS which follows UCLIBC_INSTALL_STAGING_CMDS so all required libs are in place.

Interesting note - if one enables uClibc tests after initial full buildroot build mentioned errors don't happen. This is because uClibc libc libs are already installed to staging. That's why I didn't noticed this problem before.

I'm wondering if there're any comments on this one?

Regards,
Alexey

#2 lore raw

PATCH 1/1 uclibc: build tests after uClibc libs are installed to staging location

Dear Alexey Brodkin,

Quoted 9 lines · Alexey Brodkin
Quoted 7 lines

And the simplest solution is to build tests right before installation in UCLIBC_INSTALL_TARGET_CMDS which follows UCLIBC_INSTALL_STAGING_CMDS so all required libs are in place.

Interesting note - if one enables uClibc tests after initial full buildroot build mentioned errors don't happen. This is because uClibc libc libs are already installed to staging. That's why I didn't noticed this problem before.

I'm wondering if there're any comments on this one?

On my side, I'm not really happy with the fact of building things in INSTALL_TARGET_CMDS, but it's true that the C library is kind of a special case. Any opinion from others?

Best regards,

Thomas

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

PATCH 1/1 uclibc: build tests after uClibc libs are installed to staging location

In reply to Alexey Brodkin

Dear Alexey Brodkin,

Quoted 9 lines · Alexey Brodkin
Cc Anton Kolesov <[email protected]>
Cc Peter Korsgaard <[email protected]>
Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/uclibc/uclibc.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

After some discussion with Yann, we didn't see any other solution that doesn't involve complex change to solve just that one specific case.
Therefore: patch applied.

Thanks!

Thomas

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