From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] toolchain: allow crosstool-ng musl toolchains
Date: Tue, 28 Jun 2016 18:24:15 +0200 [thread overview]
Message-ID: <20160628182415.42ef8e25@free-electrons.com> (raw)
In-Reply-To: <1466530603-6041-1-git-send-email-fhunleth@troodon-software.com>
Hello,
On Tue, 21 Jun 2016 13:36:43 -0400, Frank Hunleth wrote:
> diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
> index 108fdaa..9a41bd6 100644
> --- a/toolchain/helpers.mk
> +++ b/toolchain/helpers.mk
> @@ -210,7 +210,7 @@ check_glibc = \
> # $1: sysroot directory
> check_musl = \
> SYSROOT_DIR="$(strip $1)"; \
> - if test ! -f $${SYSROOT_DIR}/lib/libc.so -o -e $${SYSROOT_DIR}/lib/libm.so ; then \
> + if test ! \( -f $${SYSROOT_DIR}/lib/libc.so -o -f $${SYSROOT_DIR}/usr/lib/libc.so \) -o -e $${SYSROOT_DIR}/lib/libm.so ; then \
> echo "Incorrect selection of the C library" ; \
Thanks for this patch. However, I dislike a bit this test: the test
that libm exists is not super great, and we're really looking at
consequences of having musl, and not whether we're using musl or not.
What about instead changing to:
1/ Building a minimal C program "int main(void) { return 0; }"
2/ Check if the program interpreter contains /lib/ld-musl or not ?
I.e:
thomas at skate:~/nerves-mipsel-unknown-linux-musl-linux-x86_64-v0.6.3$ cat foo.c
int main(void) { return 0; }
thomas at skate:~/nerves-mipsel-unknown-linux-musl-linux-x86_64-v0.6.3$ ./bin/mipsel-unknown-linux-musl-gcc -o foo foo.c
thomas at skate:~/nerves-mipsel-unknown-linux-musl-linux-x86_64-v0.6.3$ ./bin/mipsel-unknown-linux-musl-readelf -a foo | grep "program interpreter"
[Requesting program interpreter: /lib/ld-musl-mipsel.so.1]
This would, IMO, be a much better solution. What do you think?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-06-28 16:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 17:36 [Buildroot] [PATCH 1/1] toolchain: allow crosstool-ng musl toolchains Frank Hunleth
2016-06-28 16:24 ` Thomas Petazzoni [this message]
2016-06-29 14:45 ` Frank Hunleth
2016-06-29 15:01 ` Thomas Petazzoni
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=20160628182415.42ef8e25@free-electrons.com \
--to=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox