* [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains
@ 2013-10-13 8:28 Thomas Petazzoni
2013-10-13 10:37 ` Thomas De Schampheleire
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2013-10-13 8:28 UTC (permalink / raw)
To: buildroot
The Angstrom toolchains available at
http://www.angstrom-distribution.org/toolchains/ are not usable as
external toolchains in Buildroot, because they are not pure toolchains
with just the C library, but instead complete SDKs with many
cross-compiled libraries (Gtk, Qt, glib, neon, sqlite, X.org, and many
more, approximately 200 MB of libraries).
Buildroot cannot use such toolchains, and while this is documented in
our manual, some users still try to do this. Today, one such user came
on the IRC channel, reporting a build problem, which we started
investigating, only to realize after a long time that he was using an
Angstrom toolchain.
To avoid this problem in the future, we explicitly check if the
toolchain is from Angstrom by looking at the vendor part of the tuple
exposed by the toolchain: as soon as it is
<something>-angstrom-<something-else>, we reject the toolchain with an
explanation.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes since v1:
* Fix typos in the comments (Thomas DS)
* Rename function to check_unusable_toolchain (Thomas DS)
* Use -dumpmachine instead of -v and some nasty sed'ing (Thomas DS)
* Add quotes around $${vendor} (Thomas DS)
toolchain/helpers.mk | 18 ++++++++++++++++++
toolchain/toolchain-external/toolchain-external.mk | 1 +
2 files changed, 19 insertions(+)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 95120cd..a8944ce 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -324,3 +324,21 @@ check_cross_compiler_exists = \
echo "Cannot execute cross-compiler '$${__CROSS_CC}'" ; \
exit 1 ; \
fi
+
+#
+# Check for toolchains known not to work with Buildroot. For now, we
+# only check for Angstrom toolchains, by looking at the vendor part of
+# the host tuple.
+#
+# $1: cross-gcc path
+#
+check_unusable_toolchain = \
+ __CROSS_CC=$(strip $1) ; \
+ vendor=`$${__CROSS_CC} -dumpmachine | cut -f2 -d'-'` ; \
+ if test "$${vendor}" = "angstrom" ; then \
+ echo "Angstrom toolchains are not pure toolchains: they contain" ; \
+ echo "many other libraries than just the C library, which makes" ; \
+ echo "them unsuitable as external toolchains for build systems" ; \
+ echo "such as Buildroot." ; \
+ exit 1 ; \
+ fi
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index b5b1ce7..d41cc7c 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -371,6 +371,7 @@ endif
# type of C library and all C library features.
define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS
$(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC))
+ $(Q)$(call check_unusable_toolchain,$(TOOLCHAIN_EXTERNAL_CC))
$(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \
SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:(usr/)?lib(32|64)?/(.*/)?libc\.a::'` ; \
if test -z "$${SYSROOT_DIR}" ; then \
--
1.8.1.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains
2013-10-13 8:28 [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains Thomas Petazzoni
@ 2013-10-13 10:37 ` Thomas De Schampheleire
2013-10-14 11:23 ` Peter Korsgaard
2013-10-17 16:12 ` Arnout Vandecappelle
2 siblings, 0 replies; 6+ messages in thread
From: Thomas De Schampheleire @ 2013-10-13 10:37 UTC (permalink / raw)
To: buildroot
On Sun, Oct 13, 2013 at 10:28 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> The Angstrom toolchains available at
> http://www.angstrom-distribution.org/toolchains/ are not usable as
> external toolchains in Buildroot, because they are not pure toolchains
> with just the C library, but instead complete SDKs with many
> cross-compiled libraries (Gtk, Qt, glib, neon, sqlite, X.org, and many
> more, approximately 200 MB of libraries).
>
> Buildroot cannot use such toolchains, and while this is documented in
> our manual, some users still try to do this. Today, one such user came
> on the IRC channel, reporting a build problem, which we started
> investigating, only to realize after a long time that he was using an
> Angstrom toolchain.
>
> To avoid this problem in the future, we explicitly check if the
> toolchain is from Angstrom by looking at the vendor part of the tuple
> exposed by the toolchain: as soon as it is
> <something>-angstrom-<something-else>, we reject the toolchain with an
> explanation.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> Changes since v1:
>
> * Fix typos in the comments (Thomas DS)
> * Rename function to check_unusable_toolchain (Thomas DS)
> * Use -dumpmachine instead of -v and some nasty sed'ing (Thomas DS)
> * Add quotes around $${vendor} (Thomas DS)
>
> toolchain/helpers.mk | 18 ++++++++++++++++++
> toolchain/toolchain-external/toolchain-external.mk | 1 +
> 2 files changed, 19 insertions(+)
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains
2013-10-13 8:28 [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains Thomas Petazzoni
2013-10-13 10:37 ` Thomas De Schampheleire
@ 2013-10-14 11:23 ` Peter Korsgaard
2013-10-17 16:12 ` Arnout Vandecappelle
2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2013-10-14 11:23 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Thomas> The Angstrom toolchains available at
Thomas> http://www.angstrom-distribution.org/toolchains/ are not usable as
Thomas> external toolchains in Buildroot, because they are not pure toolchains
Thomas> with just the C library, but instead complete SDKs with many
Thomas> cross-compiled libraries (Gtk, Qt, glib, neon, sqlite, X.org, and many
Thomas> more, approximately 200 MB of libraries).
Thomas> Buildroot cannot use such toolchains, and while this is documented in
Thomas> our manual, some users still try to do this. Today, one such user came
Thomas> on the IRC channel, reporting a build problem, which we started
Thomas> investigating, only to realize after a long time that he was using an
Thomas> Angstrom toolchain.
Thomas> To avoid this problem in the future, we explicitly check if the
Thomas> toolchain is from Angstrom by looking at the vendor part of the tuple
Thomas> exposed by the toolchain: as soon as it is
Thomas> <something>-angstrom-<something-else>, we reject the toolchain with an
Thomas> explanation.
Thomas> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains
2013-10-13 8:28 [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains Thomas Petazzoni
2013-10-13 10:37 ` Thomas De Schampheleire
2013-10-14 11:23 ` Peter Korsgaard
@ 2013-10-17 16:12 ` Arnout Vandecappelle
2013-10-22 14:24 ` Peter Korsgaard
2 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2013-10-17 16:12 UTC (permalink / raw)
To: buildroot
On 13/10/13 10:28, Thomas Petazzoni wrote:
> The Angstrom toolchains available at
> http://www.angstrom-distribution.org/toolchains/ are not usable as
> external toolchains in Buildroot, because they are not pure toolchains
> with just the C library, but instead complete SDKs with many
> cross-compiled libraries (Gtk, Qt, glib, neon, sqlite, X.org, and many
> more, approximately 200 MB of libraries).
>
> Buildroot cannot use such toolchains, and while this is documented in
> our manual, some users still try to do this. Today, one such user came
> on the IRC channel, reporting a build problem, which we started
> investigating, only to realize after a long time that he was using an
> Angstrom toolchain.
Just for my info, how is it possible that we cannot use such an
Angstrom toolchain as an external toolchain, but it is possible to use a
buildroot-generated one? We can also generate a host dir with loads of
libs, and these are perfectly usable as external toolchain, right?
Regards,
Arnout
>
> To avoid this problem in the future, we explicitly check if the
> toolchain is from Angstrom by looking at the vendor part of the tuple
> exposed by the toolchain: as soon as it is
> <something>-angstrom-<something-else>, we reject the toolchain with an
> explanation.
[snip]
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains
2013-10-17 16:12 ` Arnout Vandecappelle
@ 2013-10-22 14:24 ` Peter Korsgaard
2013-10-22 14:30 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2013-10-22 14:24 UTC (permalink / raw)
To: buildroot
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
Hi,
> Just for my info, how is it possible that we cannot use such an
> Angstrom toolchain as an external toolchain, but it is possible to use
> a buildroot-generated one? We can also generate a host dir with loads
> of libs, and these are perfectly usable as external toolchain, right?
No, we can afaik only reuse a buildroot toolchain if it is "bare",
E.G. no packages selected.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains
2013-10-22 14:24 ` Peter Korsgaard
@ 2013-10-22 14:30 ` Thomas Petazzoni
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2013-10-22 14:30 UTC (permalink / raw)
To: buildroot
Peter, Arnout,
On Tue, 22 Oct 2013 16:24:24 +0200, Peter Korsgaard wrote:
> > Just for my info, how is it possible that we cannot use such an
> > Angstrom toolchain as an external toolchain, but it is possible to use
> > a buildroot-generated one? We can also generate a host dir with loads
> > of libs, and these are perfectly usable as external toolchain, right?
>
> No, we can afaik only reuse a buildroot toolchain if it is "bare",
> E.G. no packages selected.
Yes, absolutely. Ideally, my check for "angstrom" toolchain shouldn't
check for angstrom, but should instead validate that the toolchain is
"pure" (i.e only the C library). Unfortunately, I don't quite see an
easy and reliable way to make sure that the only libraries/headers
provided are the ones of the C library.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-10-22 14:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-13 8:28 [Buildroot] [PATCHv2] toolchain-external: add a specific check to avoid Angstrom toolchains Thomas Petazzoni
2013-10-13 10:37 ` Thomas De Schampheleire
2013-10-14 11:23 ` Peter Korsgaard
2013-10-17 16:12 ` Arnout Vandecappelle
2013-10-22 14:24 ` Peter Korsgaard
2013-10-22 14:30 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox