All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix static build with lts-musl
Date: Thu, 17 Oct 2019 09:05:18 +0200	[thread overview]
Message-ID: <20191017090518.27cbbe11@windsurf> (raw)
In-Reply-To: <20191016222624.GA20069@dell5510>

Hello Petr,

On Thu, 17 Oct 2019 00:26:25 +0200
Petr Vorel <petr.vorel@gmail.com> wrote:

> > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>  
> 
> > So essentially the problem here is that libcpu_set.a uses some FTS
> > functions, but -lfts appears *before* -lcpu_set in the link command
> > line.  
> But in the patch bellow -lfts is behind -lcpu_set:
> +-LDLIBS			+= -lcpu_set -lcontrollers -lltp
> ++LDLIBS			+= -lcpu_set -lcontrollers -lltp $(FTS_LIBS)

That's what my point is: without the patch from Fabrice, passing some
LDLIBS to ltp-testsuite puts those libraries listed in LDLIBS *before*
the internal ltp-testsuite libraries, which contradicts the
ltp-testsuite documentation for this LDLIBS variable.

What Fabrice's patch does is provide a way to give a list of libraries
that are *really* used after the list of objects/internal libraries.


> /br-test-pkg/br-arm-full-static/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Os -static -I/br-test-pkg/br-arm-full-static/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/tirpc  -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FORTIFY_SOURCE=2 -I../../../../../include -I../../../../../include -I../../../../../include/old/ -static  -L/br-test-pkg/br-arm-full-static/build/ltp-testsuite-20190930/testcases/kernel/controllers/cpuset/cpuset_memory_test/../cpuset_lib -L/br-test-pkg/br-arm-full-static/build/ltp-testsuite-20190930/testcases/kernel/controllers/cpuset/cpuset_memory_test/../../libcontrollers -L../../../../../lib  cpuset_memory_test.c  -L/br-test-pkg/br-arm-full-static/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -ltirpc -lpthread  -lfts -lltp -lcpu_set -lcontrollers -lltp -lpthread -o cpuset_memory_test

See that -lfts is passed, but *before* -lcpu_set ? That's what causes the issue.

> > Petr: is that expected ? What do you suggest ?  
> To be honest, I don't know, it looks like a bug. There was some change related
> I need to to dig a bit more into library Makefiles.
> Cyril, do you have any idea?

An option would be in the various Makefiles to do:

LDLIBS := -lrt $(LDLIBS)

instead of:

LDLIBS += -lrt

And similarly for the specific case causing the trouble:

LDLIBS := -lcpu_set -lcontrollers -lltp $(LDLIBS)

instead of the current:

LDLIBS += -lcpu_set -lcontrollers -lltp

Another option is to decide that ltp-testsuite is not available for
static-only builds.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-10-17  7:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 16:53 [Buildroot] [PATCH 1/1] package/ltp-testsuite: fix static build with lts-musl Fabrice Fontaine
2019-10-14 20:49 ` Thomas Petazzoni
2019-10-16 22:26   ` Petr Vorel
2019-10-17  7:05     ` Thomas Petazzoni [this message]
2019-10-17  7:43       ` Petr Vorel
2019-10-21 20:05         ` Thomas Petazzoni
2019-10-21 20:21           ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191017090518.27cbbe11@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.