diff mbox

uclibc: enable multiple jobs for building

Message ID 1403870844-15258-1-git-send-email-abrodkin@synopsys.com
State Superseded
Headers show

Commit Message

Alexey Brodkin June 27, 2014, 12:07 p.m. UTC
For some reason uClibc got built with only 1 job (MAKE1).

Compilation with multiple jobs on modern multi-threaded host CPUs allows to save
significant amount of time on toolchain building.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/uclibc/uclibc.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Peter Korsgaard June 27, 2014, 12:17 p.m. UTC | #1
>>>>> "Alexey" == Alexey Brodkin <Alexey.Brodkin@synopsys.com> writes:

 > For some reason uClibc got built with only 1 job (MAKE1).
 > Compilation with multiple jobs on modern multi-threaded host CPUs allows to save
 > significant amount of time on toolchain building.

 > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

 > Cc: Anton Kolesov <akolesov@synopsys.com>
 > Cc: Peter Korsgaard <peter@korsgaard.com>
 > Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
 > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 > ---
 >  package/uclibc/uclibc.mk | 6 +++---
 >  1 file changed, 3 insertions(+), 3 deletions(-)

 > diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
 > index b42fe55..3957960 100644
 > --- a/package/uclibc/uclibc.mk
 > +++ b/package/uclibc/uclibc.mk
 > @@ -484,7 +484,7 @@ endef
 
 >  ifeq ($(BR2_UCLIBC_INSTALL_TEST_SUITE),y)
 >  define UCLIBC_BUILD_TEST_SUITE
 > -	$(MAKE1) -C $(@D)/test \
 > +	$(MAKE) -C $(@D)/test \
 >  		$(UCLIBC_MAKE_FLAGS) \
 >  		ARCH_CFLAGS=-I$(STAGING_DIR)/usr/include \
 >  		UCLIBC_ONLY=1 \
 > @@ -494,13 +494,13 @@ endef
 >  endif
 
 >  define UCLIBC_BUILD_CMDS
 > -	$(MAKE1) -C $(@D) \
 > +	$(MAKE) -C $(@D) \

The use of MAKE1 for uClibc dates back 10 years:

commit 8e5fb3fb4ab09b4dc04fe7cb3f7becce6514117b
Author: Eric Andersen <andersen@codepoet.org>
Date:   Sat Dec 11 13:01:10 2004 +0000

    Add initial BR2_JLEVEL support, with some exceptions for apps that
    have broken 'make -j' support

So it could very well have been fixed upstream since then. How have you
tested it?
Alexey Brodkin June 27, 2014, 2:44 p.m. UTC | #2
Hi Peter,

On Fri, 2014-06-27 at 14:17 +0200, Peter Korsgaard wrote:
> >>>>> "Alexey" == Alexey Brodkin <Alexey.Brodkin@synopsys.com> writes:
> The use of MAKE1 for uClibc dates back 10 years:
> 
> commit 8e5fb3fb4ab09b4dc04fe7cb3f7becce6514117b
> Author: Eric Andersen <andersen@codepoet.org>
> Date:   Sat Dec 11 13:01:10 2004 +0000
> 
>     Add initial BR2_JLEVEL support, with some exceptions for apps that
>     have broken 'make -j' support
> 
> So it could very well have been fixed upstream since then. How have you
> tested it?
> 

I tried parallel build for ARC with uClibc 0.9.34+ and for i586 with
uClibc 0.9.33.2.

But since uClibc tests building is broken for ARC now I double checked
it for i586 and noticed a problem.

Because of dependency on previously built .so files - mentioned as well
here -
http://git.uclibc.org/uClibc/commit/test?id=931e8391565323ed2e589c83b83a7345813a5514
we need to keep MAKE1 for uClibc tests.

Will send a re-spin shortly.

-Alexey
Alexey Brodkin June 27, 2014, 3 p.m. UTC | #3
On Fri, 2014-06-27 at 18:44 +0400, Alexey Brodkin wrote:
> Hi Peter,
> 
> On Fri, 2014-06-27 at 14:17 +0200, Peter Korsgaard wrote:
> > >>>>> "Alexey" == Alexey Brodkin <Alexey.Brodkin@synopsys.com> writes:
> > The use of MAKE1 for uClibc dates back 10 years:
> > 
> > commit 8e5fb3fb4ab09b4dc04fe7cb3f7becce6514117b
> > Author: Eric Andersen <andersen@codepoet.org>
> > Date:   Sat Dec 11 13:01:10 2004 +0000
> > 
> >     Add initial BR2_JLEVEL support, with some exceptions for apps that
> >     have broken 'make -j' support
> > 
> > So it could very well have been fixed upstream since then. How have you
> > tested it?
> > 
> 
> I tried parallel build for ARC with uClibc 0.9.34+ and for i586 with
> uClibc 0.9.33.2.
> 
> But since uClibc tests building is broken for ARC now I double checked
> it for i586 and noticed a problem.
> 
> Because of dependency on previously built .so files - mentioned as well
> here -
> http://git.uclibc.org/uClibc/commit/test?id=931e8391565323ed2e589c83b83a7345813a5514
> we need to keep MAKE1 for uClibc tests.

This was a build problem I faced in particular:
=======
  TEST_LINK math/ basic-test
  TEST_LINK tls/ tst-tlsmod4.so
  TEST_LINK tls/ tst-tlsmod2.so
  TEST_LINK tls/ tst-tlsmod3.so
i586-buildroot-linux-uclibc-gcc: error: tst-tlsmod2.so: No such file or
directory
make[3]: *** [tst-tlsmod3.so] Error 1
make[3]: *** Waiting for unfinished jobs....
=======

Because of enabled multiple jobs "tst-tlsmod3.so" was linked before
"tst-tlsmod2.so" was linked.

And indeed in "test/tls/Makefile.in" we see:
==============
LDFLAGS_tst-tlsmod3.so := -shared -static-libgcc -L$(top_builddir)lib
tst-tlsmod2.so
==============

-Alexey
diff mbox

Patch

diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index b42fe55..3957960 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -484,7 +484,7 @@  endef
 
 ifeq ($(BR2_UCLIBC_INSTALL_TEST_SUITE),y)
 define UCLIBC_BUILD_TEST_SUITE
-	$(MAKE1) -C $(@D)/test \
+	$(MAKE) -C $(@D)/test \
 		$(UCLIBC_MAKE_FLAGS) \
 		ARCH_CFLAGS=-I$(STAGING_DIR)/usr/include \
 		UCLIBC_ONLY=1 \
@@ -494,13 +494,13 @@  endef
 endif
 
 define UCLIBC_BUILD_CMDS
-	$(MAKE1) -C $(@D) \
+	$(MAKE) -C $(@D) \
 		$(UCLIBC_MAKE_FLAGS) \
 		PREFIX= \
 		DEVEL_PREFIX=/ \
 		RUNTIME_PREFIX=/ \
 		all
-	$(MAKE1) -C $(@D)/utils \
+	$(MAKE) -C $(@D)/utils \
 		PREFIX=$(HOST_DIR) \
 		HOSTCC="$(HOSTCC)" hostutils
 	$(UCLIBC_BUILD_TEST_SUITE)