Commit Graph

2028 Commits

Author SHA1 Message Date
Thomas Petazzoni 41486e1be8 toolchain-external: fix Linaro 2014.02 symlink
In commit cd32da8f79
("toolchain-external: add Linaro ARM big endian toolchain") a mistake
was made, probably due to a rebase conflict that was incorrectly solved:
the call to the post install staging hook that creates the necessary
symbolic links for a root filesystem based on Linaro 2014.02 to work
was removed.

This commit reinstates this call, which should fix the problem
observed by Maxime Hadjinlian while using Linaro 2014.02.

Reported-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-21 10:37:54 +02:00
Thomas Petazzoni 85082cab93 toolchain-external: Sourcery CodeBench ARM 2013.05 affected by PR58595
Fixes:

  http://autobuild.buildroot.org/results/6b3/6b342c2d101348e4d39285f45481e2aafa3d8b3f/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-12 23:53:05 +02:00
Stefan Sørensen 3787592063 toolchain-external: Fix EABIhf check
Currently the check for EABI/EABIhf toolchains looks for the
Tag_ABI_VFP_args attribute in the crt1.o file which gcc adds in an
EABIhf toolchain.
In uClibc, however, crt1.o is not compiled from c but assembly, so the
Tag_ABI_VFP_args attribute is not added in the object file. This causes
the EABIhf check in the external toolchain logic to fail for
uClibc-based toolchains.

Fix by compiling a dummy .c file and trying to link the object against the
C library. Since it is impossible to mix EABI and EABIhf code, a mismatch
between the buildroot and toolchain ABI settings will be detected during
this link step.

Fixes bug #6842: https://bugs.busybox.net/show_bug.cgi?id=6842

[Peter: fix final 'fi']
Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
[ThomasDS: do full link iso readelf test, update commit message]
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-11 21:22:04 +02:00
Gustavo Zacarias ff69b4a6e5 toolchain: remove nommu option for MIPS
MIPS nommu never took off, the only MIPS processors without MMU are
microcontrollers and the only uclinux effort for them has non-upstream
patches against very very old versions.
See http://www.xiptech.com/uclinuxformips.htm

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-08 16:53:15 +02:00
Gustavo Zacarias 493b1177b9 toolchain/buildroot: default to uClibc
Otherwise we're getting musl for everything except those who have a
default (mips64*).

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-06 14:06:01 +02:00
Thomas Petazzoni 2d71c1249f toolchain-external: add publicly available musl toolchains
This commit adds ten toolchains based on the musl C library that are
publicly available from the musl-cross project.

[Peter: fix ppc prefix, only for classic ABI]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-06 10:18:51 +02:00
Thomas Petazzoni a84f478d3c toolchain-buildroot: add support for building musl toolchains
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-05 23:53:18 +02:00
Thomas Petazzoni 7130ceb267 toolchain: generate a gdbinit file
This commit slightly improves the external toolchain backend, and the
gdb build logic to create a file named
$(STAGING_DIR)/usr/share/buildroot/gdbinit which can be used as a
gdbinit file using gdb -x option. This allows gdb to automatically use
the proper sysroot to find libraries.

The initial insight for this patch comes from the report of Oded
Hanson <OHanson@xsightsys.com>, who found an issue with the Eclipse
Buildroot plugin, which was setting a solib-path in gdb, but not a
sysroot. Setting a solib-path was enough to find shared libraries, but
not the dynamic linker. And since Eclipse doesn't allow to set the
sysroot in any other way than giving a gdbinit file, it makes sense to
have Buildroot generate a gdbinit file (which can be used in other
situations than Eclipse).

To achieve this, this commit introduces a gen_gdbinit_file helper in
toolchain/helpers.mk, and uses it for the internal toolchain and
external toolchain backends.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[ThomasDS: minor updates in commit message]
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-05 13:31:30 +02:00
Gustavo Zacarias 97b25caecd toolchain: enable internal for aarch64
Enable the internal toolchain backend for aarch64.
Tested with arm_foundationv8_defconfig and ARMs foundation v8 emulator.
Both glibc & eglibc work.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-04-24 15:21:13 +02:00
Fabio Porcedda 5f70a007c8 toolchain: add a hidden config option to enable the toolchain package
The usual way to enable a package using the package infrastructure is to
use a config option so instead to add the toolchain package to the
TARGETS variable in the Makefile add a config option like all the other
toolchain packages.

[Thomas: remove comment that no longer made sense in the main
Makefile, and add a comment above the new hidden Config.in option to
explain what it is useful for.]

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-16 19:37:08 +02:00
Thomas Petazzoni cd32da8f79 toolchain-external: add Linaro ARM big endian toolchain
Linaro has started to release ARM big endian toolchains, so we
integrate this toolchain in the external toolchain logic of
Buildroot. Since ARM big endian is probably going to be a lot more
uncommon than ARM little endian, we will only support one version at a
time of this toolchain.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 23:10:38 +02:00
Thomas Petazzoni 0d740d8195 toolchain-external: bump Linaro AArch64 toolchains
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 23:09:32 +02:00
Thomas Petazzoni 6283788656 toolchain-external: remove useless info in help text of Linaro ARM toolchains
The information "To use this toolchain, you must disable soft float
usage." which was visible in the help text of Linaro toolchains is no
longer useful, since those toolchains are only visible when the ARM
EABIhf ABI is selected, which by design is not compatible with
soft-float.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-04-14 23:08:22 +02:00
Thomas Petazzoni d2c54e603c toolchain-external: bump Linaro ARM toolchains
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 23:07:57 +02:00
Ezequiel García e48ef3f522 toolchain-external: Introduce kernel headers sanitization
The Nios-II Sourcery external toolchain (the only Nios-II we currently
support) exports broken kernel headers. In particular, these kernels should
be exported using the "headers_install" rule which applies a set of fixes
on the kernel headers so they are suitable for userspace usage.

In order to fix this, add a post-install hook to perform the header fixes
ourselves. The result is equivalent to apply the "headers_install" rule.

Fixes:
http://autobuild.buildroot.net/results/c32/c32ad4bac5f651502e551f7733f702afaa0e742a/

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 22:40:21 +02:00
Thomas Petazzoni be4f30a4ff toolchain: add option to declare toolchains affected by gcc PR 58595
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 22:37:48 +02:00
Baruch Siach 5c76842107 ext-toolchain-wrapper: fix typo
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-04-10 22:24:30 +02:00
Yann E. MORIN 2a82bb8a90 support/check-kernel-headers: fix old custom toolchains without -print-sysroot
Old toolchains, with old gcc that do not support -print-sysroot, break the
kernel-headers version check script: it fails to find the sysroot of the
toolchain, and thus ends up including the host's linux/version.h.

Most of the time, this will break early, since the host's kernel headers
will not match the toolchain settings.

But it can happen that the check is succesful, although the configuration
of the toolchain is wrong:

  - the custom toolchain has kernel headers vX.Y
  - the user selected vX.Z  (Z!=Y)
  - the host has headers vX.Y

In this case, the check passes OK, but the build of some packages later on
will break (which is exactly what those _AT_LEAST_XXX options were added to
avoid).

Fix that by passing the sysroot to the check script, instead of the cross
compiler.

We get the sysroot as thus:

  - for custom toolchains, we use the macro toolchain_find_sysroot. We can
    do that, because we already have a complete sysroot with libc.a at that
    time.

  - for internal toolchain using a custom kernel headers version, we just
    use $(STAGING_DIR). We can't use the macro as for custom toolchains
    above, because at the time we install the kernel headers, we do not yet
    have a complete sysroot with a libc.a.  But we can just use
    $(STAGING_DIR), since we're only interested in the kernel headers.

For all other types of toolchains, we already have the _AT_LEAST_XXX options
properly set, so we need not add a check in this case.

Fixes:
    http://autobuild.buildroot.net/results/f33/f331a6eff0b0b93c73af52db3a6b43e4e598577e/
    http://autobuild.buildroot.net/results/a57/a5797c025bec50c10efdcff74945aab4021d05e4/
    [...]

[Thanks to Thomas for pointing out the toolchain_find_sysroot macro!]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-04-09 01:38:10 +02:00
Samuel Martin 11547ca648 external toolchain: add 3.14 choice for kernel headers
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-04-07 00:46:27 +02:00
Yann E. MORIN 0aa9019c2d toolchain: print actual version of kernel headers when checking
Since we introduced the _AT_LEAST_XXX for the kernel headers, people
using pre-built custom toolchain now have to specify the version of
the kernel headers their custom toolchain uses.

So, when we detect that there is a mismatch between the selection in
the menuconfig, and the actual version of the headers, we currently
only bail out with a terse message "Incorrect selection of kernel
headers".

This could be confusing some, and getting the version of the headers
used by the toolchain is not trivial (well, it's very easy, but not
trivial.)

This patch changes the way we report the error by moving the message
into the test-code, and by printing the expected and actual versions
of the kernel headers.

BUT! To get this pretty error message, we need to run the
test-program, so we can not use the cross-toolchain, we have to use
the native one.

BUT! The native one has its own linux/version.h header, so we can not
simply include it.

So, we ask the cross-compiler where its default sysroot is, and use
that to then force-feed the cross linux/version.h to the native
toolchain.

[Thomas: augment commit log with a message provided by Yann, fix
coding style to not have spaces after opening parenthesis and before
closing parenthesis, reformatted the message "Incorrect selection..."
to make it fit on one line.]

Reported-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-06 14:26:34 +02:00
Noam Camus 65c2400ff2 toolchain: control vendor part in GNU_TARGET_NAME
This option allows to customize the "vendor" part of the
toolchain tuple, where the toolchain tuple has the form
<arch>-<vendor>-<os>-<libc>. Use this option in situations
where gcc might make different decisions based on the vendor
part of the tuple.

[Thomas: move the config option in a slightly different place, so that
it does not appear between the C library selection and the C library
options.]

Signed-off-by: "Noam Camus" <noamc@ezchip.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-06 14:16:06 +02:00
Gustavo Zacarias 4916b889e2 linux-headers: add 3.14, bump 3.{4, 10, 13}.x series
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-01 14:44:27 +02:00
Samuel Martin a1a86ebfba liburcu: disable build with gcc-4.8.x on ARM
Because of a gcc bug [1], liburcu checks for compiler version [2] and
stops the build prematurely if gcc-4.8.[0-2] is detected for ARM.

However a bug fix exists [3] and may be backported by ARM toolchain
providers; that's what is done in Buildroot [4] or Linaro [5].

So, this change:
- add a patch in liburcu to allow build with ARM gcc-4.8.2;
- adds a new hidden symbol to reflect the toolchain status with regard
  to this bug [1];
- and controls liburcu visibility.

However, a limitation of this is when the user is using a custom
toolchain; that's why the bug details have been added in the liburcu
help message.

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
[2] http://git.lttng.org/?p=userspace-rcu.git;a=commitdiff;h=4b79310
[3] http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=204665
[4] http://git.buildroot.net/buildroot/commit/?id=c443c2be1768ebbdcb76c55d0a08fd7c983488c8
[5] http://bazaar.launchpad.net/~linaro-toolchain-dev/gcc-linaro/4.8/revision/122147

[Peter: hide normal toolchain comment if bug, add comment explaining issue if bug]
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-03-23 23:17:56 +01:00
Thomas Petazzoni b60b6f660d toolchain-external: Linaro AArch64 toolchains need a symlink, like ARM ones
Like ARM ones, the Linaro AArch64 toolchains expect libraries in
/lib/aarch64-linux-gnu and /usr/lib/aarch64-linux-gnu, but Buildroot
always installs them in /lib and /usr/lib. Therefore, this commit adds
the appropriate symbolic links, just like we're already doing for
Linaro ARM toolchains.

Reported-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-03-21 07:27:03 +01:00
Thomas Petazzoni e4644b611c toolchain-external: fix musl external support on x86
On x86, the symbolic link ld-musl-<ARCH>.so.1 to libc.so must be
ld-musl-i386.so.1 in all cases, but $(ARCH) in Buildroot might be
i386, i486, i586, i686, etc. depending on the specific x86 variants
being selected.

This commit fixes that by creating a MUSL_ARCH variable set to i386 on
x86, and to $(ARCH) on other architectures.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2014-03-06 22:59:48 +01:00
Yann E. MORIN 35c666e29b toolchain/wrapper: rename BR_DEBUG_WRAPPER
The user-facing variables should be prefixed with BR2_, not BR_.

Also quote the variable in the manual.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-05 19:46:31 +01:00
Yann E. MORIN 71516ab9e8 glibc: needs MMU
Like eglibc, glibc is only available to MMU-based architectures.

Re-order select/depends to be in-line with eglibc, just above.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-03 21:26:56 +01:00
Yann E. MORIN a5a309642a toolchain/external: check kernel headers version for custom toolchain
Ensure the kernel headers version used in the custom external toolchain,
or the manually-specified kernel headers version, matches exactly the one
selected by the user.

We do not care about the patch-level, since headers are not supposed to
change between patchlevels. This applies only to kernels >= 3.0, but
those are actually the ones we do care about; we treat all 2.6.x kernels
as being a single version, since we do not support any 2.6 kernels for
packages with kernel-dependant features.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-01 19:47:22 +01:00
Yann E. MORIN c58bcd5dfb toolchain/external/custom: add choice to select 'AT_LEAST_XXX' header version
Select the appropriate BR2_TOOLCHAIN_HEADERS_AT_LEAST_XXX options for the
external, custom toolchain backend.

We try to be conservative here, and default to kernel headers 2.6.x.

[Thomas: remove duplicated depends on BR2_TOOLCHAIN_EXTERNAL_CUSTOM,
since the choice is already inside a if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
... endif block.]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-01 17:16:52 +01:00
Yann E. MORIN b6f321b1c6 toolchain/external/predefined: add choice to select 'AT_LEAST_XXX' header version
Select the appropriate BR2_TOOLCHAIN_HEADERS_AT_LEAST_XXX options for the
external, pre-defined toolchains.

Also annotate those toolchain with older-than-3.0 headers.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-01 17:15:38 +01:00
Yann E. MORIN b155f5a5ab toolchain/common: add minimum kernel headers options
We now have quite a few packages that depend on the kernel headers to be
at least a certain version. For example, dvb-apps requires at least the
3.3 kernel headers.

Add a set of options that packages can depend on, to check that the kernel
headers match their required version.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-01 17:15:09 +01:00
Thomas Petazzoni c64f948d2c toolchain: introduce a toolchain knob for NPTL
As our architecture support expands to a number of architectures that
do not implement NPTL threading, and the number of packages that
depend on NPTL specific features, it has become necessary to be able
to know whether the toolchain has NPTL support or not.

This commit adds a new BR2_TOOLCHAIN_HAS_THREADS_NPTL hidden Config.in
option that allows packages to know whether NPTL is available or not.

This hidden option is:

 * Automatically enabled when glibc/eglibc or musl toolchains are
   used, either internal or external.

 * Automatically enabled when an internal uClibc toolchain with NPTL
   support is configured. It is left disabled otherwise for internal
   uClibc toolchains.

 * Configured according to a visible Config.in option for custom
   external uClibc toolchains.

[Peter: factor _EXTERNAL_HAS_THREADS in single if as suggested by Arnout]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 23:39:01 +01:00
Fabio Porcedda b2fd9f90e2 package: add toolchain dependency to every target package
This commit makes the dependency from the target toolchain explicit.
This way we can buid from command line a package that use
inner-generic-package right after the configuration phase, example:

	make clean <package-name>

Also remove TARGETS_ALL because the only purpose was to add toolchain
dependency so it's superseded by this commit.

To prevent circular dependency add the new variable
<pkgname>_ADD_TOOLCHAIN_DEPENDENCY to avoid adding the toolchain
dependency for toolchain packages.

This is also a step forward supporting top-level parallel make.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-14 21:08:35 +01:00
Fabio Porcedda 6f13130ac9 package: add base dependency to every package
Move "dependencies" "dirs" "prepare" dependencies from "toolchain" to
every package.
This way we can build correctly every package right after the clean
stage.
As example with this commit we can build successfully the glibc right
after the clean stage:
	make clean glibc

This is also a step forward supporting top-level parallel make.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-14 21:08:19 +01:00
Thomas Petazzoni 6762e427db glibc: add 2.19 as a supported version
glibc 2.19 has been released recently
(https://sourceware.org/ml/libc-alpha/2014-02/msg00224.html). This
commit allows to build a toolchain with this new version. In order to
allow this, we add a version selection that did not exist for
glibc. We default to 2.18, which was the only supported version until
now, and add an option for 2.19.

For microblaze, which uses a specific glibc version, the version
selection choice is not displayed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-13 22:22:54 +01:00
Peter Korsgaard de13e31a16 Rename BUILDROOT_LIBC to BR_LIBC
No functional change, but internal variables should be name BR_foo, not
BUILDROOT_foo (I think ..).

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-04 15:06:46 +01:00
Adrien Béraud a20cb38659 arch: add support for "jaguar" AMD CPU optimisations
AMD Jaguar ( https://en.wikipedia.org/wiki/Jaguar_%28microarchitecture%29 ) is
suddenly a popular architecture since it is used in the PS4 and the XBox One.
Many embedded systems are also likely to use it in the next years.

This patch adds support for GCC architecture-specific optimisations and
tuning for these CPUs.
These optimizations are available with GCC 4.8+.

Signed-off-by: Adrien Beraud <adrien.beraud@savoirfairelinux.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-15 23:19:46 +01:00
Stefan Sørensen 803a105f90 toolchain-external: Fix ld.so naming with uClibc and EABIhf.
Currently ld-linux-armhf.so.* is added to external libs when
using an EABIhf toolchain, but this naming is not used by uClibc.
Fix by adding a check for glibc.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-15 22:52:33 +01:00
Thomas De Schampheleire ba4ad9d27c deprecated handling: introduce BR2_DEPRECATED_SINCE_xxxx_xx
In order to keep better track of when a feature got deprecated, and hence
when it can be removed, a new set of symbols BR2_DEPRECATED_SINCE_xxxx_xx is
introduced. These symbols are automatically selected when BR2_DEPRECATED is
selected, and thus are transparent to the user.
A deprecated feature will no longer depend on BR2_DEPRECATED directly, but
rather on the appropriate BR2_DEPRECATED_SINCE_xxxx_xx. If that symbol does
not yet exist, it has to be created in Config.in.
When removing a deprecated feature, one should also check whether this was
the last feature using the BR2_DEPRECATED_SINCE_xxxx_xx symbol, in which
case the latter can be removed from Config.in.

A followup patch will make sure the overview is added to the list of
deprecated features in the manual, so that a buildroot core developer can
easily determine which features to remove in a given development cycle.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-10 15:03:53 +01:00
Yann E. MORIN 2c1dc32647 toolchain/external: fix wrapper by not passing conflicting flags
In our wrapper, we forcibly add the -march=, -mcpu= and-mtune= flags
to the actual compiler, this in an attempt to always generate correct
and optimised code for the target.

But in some cases, the caller knows better than we do, and passes its
own set, or subset of those flags. In this case, some may conflict with
the ones we pass. The most prominent offender being the Linux kernel.

For example, on the ARM Raspberry Pi, the Linux kernel will set the
-march=armv6 flag and no -mcpu= flag, but we pass -mcpu=arm1176jzf-s,
which conflicts:

    drivers/scsi/scsi_trace.c:1:0: warning: switch -mcpu=arm1176jzf-s
    conflicts with -march=armv6 switch

(and so for all the files the kernel compiles, pretty messy)
(note: arm1176jzf-s is not an armv6, it is an armv6zk. Yeah...)

To avoid this situation, we scan our commandline for any occurence of
the possibly conflicting flags. If none is found, then we add our owns.
If any is found, then we don't add any of our owns.

The idea behind this is that we trust the caller to know better than
we do what it is doing. Since the biggest, and sole so far, offender
is the Linux kernel, then this is a rather safe bet.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-09 21:17:35 +01:00
Jerzy Grzegorek 3033bc0c6e package: remove the empty trailing line(s)
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-04 10:39:29 +01:00
Thomas Petazzoni 951fc4c63f toolchain-external: add support for the Blackfin 2013R1 toolchain
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-12-31 00:19:13 +01:00
Thomas Petazzoni 89be0985d6 toolchain-external: mark Microblaze external toolchains as deprecated
The Xilinx Microblaze external toolchains that we had support for are
very old, and are causing a huge number of build issues. Thanks to
Spenser Gilliland, we now have support for Microblaze in the internal
toolchain backend, and the autobuilders have been using the internal
toolchain backend since then. Therefore, it's time to deprecate those
old and unusable external toolchains.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-12-31 00:19:06 +01:00
Thomas Petazzoni 68b967a985 toolchain-external: update Linaro AArch64 toolchains
Add Linaro AArch64 2013.10 and Linaro AArch64 2013.11, and remove
Linaro AArch64 2013.07 and Linaro AArch64 2013.08.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-31 00:19:00 +01:00
Thomas Petazzoni 34562eec83 toolchain-external: update Linaro ARM toolchains
Add Linaro ARM 2013.10 and Linaro ARM 2013.11, and remove Linaro ARM
2013.07 and Linaro ARM 2013.08.

The main change for those versions is the switch to eglibc 2.18.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-12-31 00:18:54 +01:00
Thomas Petazzoni 245686ffb3 toolchain-external: add Sourcery MIPS 2013.11, remove Sourcery MIPS 2012.03
This commit adds the support for the recently release Sourcery MIPS
2013.11 toolchain (gcc 4.8, gdb 7.6, glibc 2.18), and consequently
removes the support for the Sourcery MIPS 2012.03 toolchain.

While we're at it, also fix the incorrect help text related to the
MIPS64 multilib selection.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-31 00:17:06 +01:00
Thomas Petazzoni c52523161c toolchain-external: add Sourcery ARM 2013.11, remove Sourcery ARM 2011.09
This commit adds the support for the recently release Sourcery ARM
2013.11 toolchain (gcc 4.8, gdb 7.6, glibc 2.18), and consequently
removes the support for the Sourcery ARM 2011.09 toolchain.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-29 18:27:18 +01:00
Spenser Gilliland 14e527eb66 toolchain: enable microblaze toolchain
This commit allows to build an internal toolchain for the Microblaze
architecture, with either glibc or eglibc.

Note that we add an explicit list of architectures that are supported
by uClibc, and Microblaze is not part of them, because it currently
doesn't build for this architecture.

[Thomas: add better commit log, add architecture dependencies on
uClibc, to avoid selecting uClibc on Microblaze]

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-06 22:46:44 +01:00
Jeremy Kerr fb6dd8f49b toolchain: Allow ld64.so linker
The glibc dynamic linkers for ppc64 and s390x are named ld64.so.*
so modify the check_glibc test to match them.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-03 13:11:27 +01:00
Peter Korsgaard 50ce7ffb76 Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-01 20:32:00 +01:00
Gustavo Zacarias dc044cdfe2 toolchain/buildroot: default to eglibc for mips64
uClibc only works well for O32 ABI on mips64, so default to eglibc that
works just fine with N32 & N64 ABIs as well.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-28 22:55:57 +01:00
Arnout Vandecappelle b478d30a6d glibc/eglibc: remove reference to experimental from help text
Since 924b8739da we no longer declare glibc and eglibc support as
experimental, so it shouldn't be mentioned in the help text anymore.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-19 09:13:11 +01:00
Thomas Petazzoni ed3f3e433f toolchain-external: make sure (e)glibc isn't chosen when BR2_PREFER_STATIC_LIB=y
(e)glibc doesn't support a fully statically linked userspace. Even a
basic program such as Busybox fails to do authentication due to glibc
loading some libraries dynamically. Therefore, we disable the
possibility of using a (e)glibc toolchain when
BR2_PREFER_STATIC_LIB=y.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 22:29:50 +01:00
Thomas Petazzoni 819da04481 toolchain-buildroot: make sure glibc isn't chosen when BR2_PREFER_STATIC_LIB=y
(e)glibc doesn't support a fully statically linked userspace. Even a
basic program such as Busybox fails to do authentication due to glibc
loading some libraries dynamically. Therefore, we disable the
possibility of building a glibc toolchain when
BR2_PREFER_STATIC_LIB=y.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 22:29:16 +01:00
Thomas Petazzoni 924b8739da toolchain-buildroot: glibc and eglibc support is no longer experimental
The glibc and eglibc support has been introduced since a little bit of
time now, I believe we can remove the "experimental" statement next to
it.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 22:29:01 +01:00
Thomas De Schampheleire bed4e27868 Config.in files: whitespace cleanup
This patch fixes the following whitespace problems in Config.in files:
- trailing whitespace
- spaces instead of tabs for indentation
- help text not indented with tab + 2 spaces

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 22:19:30 +01:00
Thomas Petazzoni 646bd86908 toolchain-external: factorize regular expressions
Based on a suggestion from Peter, this commit factorizes the logic and
regular expressions that are used to find the sysroot and libdir for a
given compiler. It reduces a bit the duplication of code, and
centralizes the most bizarre part of this logic in one place.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 00:26:53 +01:00
Thomas Petazzoni b07c2affc9 toolchain-external: update comments
[Peter: drop extra # as pointed out by Baruch Siach]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 00:26:28 +01:00
Thomas Petazzoni 620d85b310 toolchain-external: fix the SYSROOT_DIR mangling logic
In a1d94aaa3a ('toolchain-external: add support for musl C
library'), we made the following change to the SYSROOT_DIR mangling
logic:

-       SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \
+       SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:(usr/)?lib(32|64)?/(.*/)?libc\.a::'` ; \

This was needed to accomodate for musl based toolchains that don't
have libc.a in usr/lib/..., but directory in lib/... Basically, the
change makes the usr/ at the beginning optional.

However, with the very permissive (.*) matching in the middle of the
path, the change above had an unexpected consequence: any path contain
'/lib' would be truncated before this lib. As an example, Peter
reported that his builds, running from /var/lib/buildbot/ were no
longer working because the SYSROOT_DIR was decided to be /var instead
of something like
/var/lib/buildbot/buildroot/output/host/opt/ext-toolchain/arm-linux-gnueabihf/libc/.

So, this commit changes (again!) this regexp by changing (.*) to
([^/]*), the idea being that it will match only *one* path
component. Note that this intermediate (.*) directory was added in
e6e60becb0 ('external-toolchain: add support for Linaro 2012.01') to
accomodate for Linaro toolchains that have a subdirectory in their
sysroot named after the target tuple:

$ ./output/host/opt/ext-toolchain/bin/arm-linux-gnueabihf-gcc -print-file-name=libc.a
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libc.a

In addition to this, this commit also makes sure that the change
making usr/ optional is properly reported on all the instances of this
regular expression.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 00:24:16 +01:00
Laurent GONZALEZ 2873eae4df Avoid toolchain download when it is preinstalled
For configurations using a toolchain that is preinstalled on
the host, <pkg>_SITE and <pkg>_SOURCE variables must be kept
empty to avoid downloading any toolchain package.
The actual implementation has been proposed by Thomas Petazzoni.

Signed-off-by: GONZALEZ Laurent <br2@gezedo.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 00:07:42 +01:00
Thomas Petazzoni 934f8222f7 glibc, toolchain-external: copy libthread_db when gdb is enabled
As Samuel Martin noticed, libthread_db is not only needed when
cross-gdb+gdbserver is used, but also when the native gdb is used on
the target. As a consequence, this patch modifies the glibc package
and the external toolchain logic to ensure that libthread_db is copied
to the target either when the native gdb or gdbserver is enabled, by
relying on the BR2_PACKAGE_GDB option, which is enabled when native
gdb and/or gdbserver are enabled.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-10-30 19:10:28 +01:00
Thomas Petazzoni 1e0b97d166 toolchain-external: fix visibility and length of Linaro toolchain comment
Maxime Ripard reported that the Linaro toolchains were not visible
when selecting a Cortex-A, but forgetting to set the EABI to
EABIhf. While this is expected, Buildroot should normally should a
comment in this case. However, the comment is only visible when the
selected ARM architecture is not ARMv7 *and* the EABI is not
EABIhf. Instead, make the comment visible when either the selected
architecture is not ARMv7 *or* when the selected EABI is not EABIhf.

While we're at it, reword the comment text so that it actually fits
within the limits of the menuconfig screen.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
2013-10-30 19:10:23 +01:00
Thomas Petazzoni b3e3d5fc28 toolchain-external: add missing symlink for Linaro toolchains
In 11ec38b695 ("toolchain-external: fix Linaro ARM toolchain
support"), we fixed the support for Linaro EABIhf toolchains by adding
a /lib/arm-linux-gnueabihf -> /lib symbolic link. This is needed
because the dynamic loader looks for libraries in
/lib/arm-linux-gnueabihf rather than the usual /lib, but Buildroot
installs all libraries in /lib.

However, we forgot that the dynamic loader also loads libraries from
/usr/lib/arm-linux-gnueabihf rather than /usr/lib, so this patch fixes
that by adding the necessary symbolic link.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
2013-10-30 19:10:06 +01:00
Markos Chandras f3a2b806de ext-toolchain: MIPS: Select correct endianness for the target
Previously, an external-toolchain on a mipsel/mips64el target
didn't select the appriopriate endianness but
it asked the user to set the correct CFLAGS on his/her own.
We fix this by appending "-EL" to the toolchain wrapper options
if the user has selected a mipsel/mips64el target.

[Thomas: remove unneeded test on BR2_ENDIAN, since mipsel and mips64el
are always little-endian, and add the corresponding big endian case.]

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-10-30 18:51:37 +01:00
Thomas De Schampheleire fbc2494a41 Remove redundant dollar signs in Config.in files
Some Config.in(.host) files have constructs like:

config FOO_VERSION
	string
	default "1.0" if FOO_1_0
	default "2.0" if FOO_2_0
	default $FOO_CUSTOM_VERSION if FOO_CUSTOM

The dollar sign here is not needed and confusing, so can be removed.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-26 19:58:30 +02:00
Thomas Petazzoni 1247850d44 toolchain-external: add a specific check to avoid Angstrom toolchains
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>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-14 13:22:17 +02:00
Peter Korsgaard 32df094fdc toolchain-buildroot: fix s/Trigerring/Triggering/ typo
Reported-by: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 16:34:33 +02:00
Thomas Petazzoni 11ec38b695 toolchain-external: fix Linaro ARM toolchain support
This commit fixes bug #6452 (eglibc from Linaro 2013.07 not copied to
target correctly) by:

 * Copying only the relevant library loader to the target on ARMhf
   (i.e ld-linux-armhf.so and not ld.so*). This is needed since Linaro
   toolchains provide two library loaders, one ARMv7 hf, and one ARMv4
   soft-float.

 * Making sure a $(TARGET_DIR)/lib/arm-linux-gnueabihf/ symbolic link
   to $(TARGET_DIR)/lib/ exists, since the dynamic loader of Linaro
   toolchains expects libraries to be found in
   $(TARGET_DIR)/lib/arm-linux-gnueabihf/.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 16:09:59 +02:00
Thomas Petazzoni ccc82214f6 toolchain-external: improve target library copy logic
The copy_toolchain_lib_root function is responsible for copying a
given library (and its symbolic link) to the target filesystem. To do
so, it looks for the library in various locations, and then iterates
over the symbolic link all the way to the library, copying them as
needed to the target filesystem.

However, the latest Linaro toolchains bring an interesting use case:
the lib/ directory in the toolchain is organized as follows:

 - ld-linux.so.3 -> arm-linux-gnueabi/ld-2.17...so
 - ld-linux-armhf.so.3 -> arm-linux-gnueabihf/ld-2.17...so
 - arm-linux-gnueabi/
   - all ARMv4T soft float libraries
 - arm-linux-gnueabihf/
   - all ARMv7 hard float libraries

In order to match what we do with all other toolchains, we want all
those libraries and symbolic links to be copied directly under
$(TARGET_DIR)/lib. This commit does that by adjusting the copy logic.

This is part of the fix for bug #6452 (eglibc from Linaro 2013.07 not
copied to target correctly).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 16:08:30 +02:00
Thomas Petazzoni d75e573e93 toolchain-external: update Linaro AArch64 toolchain
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 16:07:29 +02:00
Thomas Petazzoni bb58fafbd9 toolchain-external: update Linaro ARM toolchain
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 16:06:32 +02:00
Thomas Petazzoni 692a585d84 toolchain-external: improve help text of some options
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 16:02:38 +02:00
Thomas Petazzoni a1d94aaa3a toolchain-external: add support for musl C library
This commit adds support for external toolchains based on the musl C
library, as available from http://www.musl-libc.org.

Note that the pre-built musl toolchains available from
http://musl.codu.org/ are not working for the moment, since they lack
sysroot support. However, this problem has been reported to the
maintainer, who has already added sysroot support in his scripts at
https://bitbucket.org/GregorR/musl-cross, and therefore the next
version of the pre-built toolchains should work with Buildroot
out-of-the-box. In the mean time, the musl-cross script must be used
to build the toolchain.

[Peter: reword comment]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 16:01:25 +02:00
Thomas Petazzoni 8e05ebca22 toolchain: do not check largefile, wchar, IPv6 and locale for glibc toolchains
The check_glibc function contained checks to verify that the user had
properly enabled the largefile, IPv6, locale and wchar options, to
match how glibc is configured. This was useful when the support for
glibc external toolchains was introduced, but since then, we added the
BR2_TOOLCHAIN_USES_GLIBC symbol that automatically enables largefile,
IPv6, locale and wchar support when a glibc or eglibc external
toolchain is used. Therefore, many of the check_glibc checks are
useless now, so we can remove these.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 15:24:45 +02:00
Thomas Petazzoni 2e0cd951fe toolchain: fix the helpers.mk comment
This commit fixes various typos and mistakes in the comment at the top
of the helpers.mk file:

 * usefull -> useful

 * The optional stripping of libraries no longer exists, so there's no
   reason to mention it.

 * Indicate that the copy_toolchain_lib_root function is also used by
   the glibc package, not only by the external toolchain logic.

 * Separate more clearly the top comment introducing the entire file,
   from the comment introducing the first function.

[Peter: reword top comment, add missing 'by']
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 15:24:14 +02:00
Thomas Petazzoni 186a99b1c6 toolchain: modify the wildcard logic for shared libraries copying
Until now, the copy_toolchain_lib_root function took as argument the
base name of a library (e.g: libm.so), and was assuming that the usual
scheme libm.so.<x> being a symbolic link to the real library was used.

However, with musl based toolchains, the C library is named libc.so
directly, with no symbolic link at all. Therefore, this commit changes
the copy_toolchain_lib_root to move the responsibility of using a
wildcard or not after the library name the caller's responsibility.

So, all the existing LIB_EXTERNAL_LIBS values are modified to have a
.* at the end, so that the behavior is effectively unchanged.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 15:15:06 +02:00
Thomas Petazzoni 36ef1b4494 toolchain-external: conditionalize the installation of libraries
The external toolchain code makes the assumption that all C libraries
have a ld*.so, libc.so, libcrypt.so, libdl.so, libgcc_s.so, libm.so,
libnsl.so, libresolv.so, libutil.so, and when thread support is
enabled, libpthread.so, etc.

However, this is not the case with the musl C library, which
integrates all the functionalities in a single libc.so file. In
preparation of the support of the musl library, we make the current
value of LIB_EXTERNAL_LIBS conditional to glibc or uClibc.

The addition of additional libraries through
BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS is kept outside the condition, at
the end.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 15:12:18 +02:00
Thomas Petazzoni d07d2bfeb2 toolchain-external: convert to the package infrastructure
This commit converts the 'toolchain-external' logic to the package
infrastructure.

The TOOLCHAIN_EXTERNAL_DIR variable (which points to where the
toolchain is located) is renamed to TOOLCHAIN_EXTERNAL_INSTALL_DIR,
because the former conflicts with the package infrastructure (which
defines the <pkg>_DIR variable for each package as pointing to its
build directory).

The new _EXTRA_DOWNLOADS mechanism is used for Blackfin toolchains.

The extract, configuration and installation steps are converted inside
the <pkg>_EXTRACT_CMDS, <pkg>_CONFIGURE_CMDS and
<pkg>_INSTALL_STAGING_CMDS.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 14:30:40 +02:00
Thomas Petazzoni 9934630fae toolchain-buildroot: convert to the package infrastructure
This commit converts the toolchain-buildroot logic to the package
infrastructure. The package is fairly simple as it only defines
BUILDROOT_LIBC, and depends on host-gcc-final to get the overall
internal toolchain build logic started.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 14:29:38 +02:00
Thomas Petazzoni 8b0905bf2f toolchain: introduce a virtual package
This commit introduces a virtual package called 'toolchain', located
in 'toolchain/toolchain', which simply depends on
'toolchain-buildroot' or 'toolchain-external' depending on the
selected toolchain backend.

For now, toolchain-buildroot and toolchain-external are still manual
make targets, but the following patches convert those backends to use
the package infrastructure as well.

In addition to this:

 * The main Makefile is modified to always make BASE_TARGETS point to
   this new toolchain virtual package.

 * The main Makefile is changed to include all the toolchain/*/*.mk
   files: the toolchain virtual package, and the toolchain-buildroot
   and toolchain-external directories.

 * The dependency of the toolchain on prepare dirs and dependencies is
   moved to the toolchain virtual package. It is moved as a
   prerequisite of the "toolchain-source" rule to ensure that all
   directories are prepared before we even start extracting the
   toolchain.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-09 12:30:44 +02:00
Thomas Petazzoni c58a80b4cd toolchain-external: make ext-tool.mk includable in all cases
The ext-tool.mk logic uses the TOOLCHAIN_EXTERNAL_PREFIX variable
unconditionally, even if the external toolchain is not used. Until now
this wasn't a problem since ext-tool.mk was only included when the
external toolchain backend was selected, but the next patches are
going to include this file unconditionally.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-06 20:54:37 +02:00
Thomas Petazzoni f742fe4407 toolchain-crosstool-ng: remove support
In order to avoid the work of converting the toolchain-crosstool-ng
logic to the package infrastructure, we remove it from Buildroot,
since it has been deprecated since quite some time.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-06 20:50:41 +02:00
Thomas Petazzoni ebc8193363 Revert "toolchain-internal: skip gcc-intermediate when possible"
While the idea of skipping the intermediate gcc step seems to work
fine in most situations, it causes problems with the SSP
support. Until we can figure out a proper solution for this problem,
we need to revert back to the previous solution of a three stages
build.

This reverts commit 2babed4a50.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-04 08:58:08 +02:00
Peter Korsgaard b9558e0230 toolchain-wrapper: minor code style fixup
Missed from 60cb290475 (add option to print one argument per line).

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-23 09:45:56 +02:00
Yann E. MORIN 60cb290475 toolchain/wrapper: add option to print one argument per line
In case there are many arguments passed to the tools, the command line
can get very long, and difficult to parse visually.

For example, the Linux kernel passes a lot of arguments to gcc (at least
45, which gives 53 with our hard-coded args). Looking at such a command
line is daunting.

So, add the possibility to print each argument on its own line.

Also, enclose all args between single quotes, so the command line
can be safely copy-pasted without special chars (spaces, $) being
inrerpreted by the shell.

Add blurb about toolchain-wrapper to documentation at the same
time.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-22 11:47:35 +02:00
Markos Chandras 58da9b6f7d toolchain-external: Update Sourcery CodeBench MIPS toolchain
Update to the latest update for the 2013.05 toolchain
released on 11 September 2013.

https://sourcery.mentor.com/GNUToolchain/release2554

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-17 23:22:42 +02:00
Thomas Petazzoni 2020c9a957 toolchain: update Linaro AArch64 external toolchains
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-15 23:32:31 +02:00
Thomas Petazzoni 2281fe95ca toolchain: update Linaro ARM external toolchains
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-15 23:28:17 +02:00
Thomas Petazzoni 859b49ed67 toolchain: move elf2flt option inclusion to toolchain-buildroot/Config.in
The only remaining thing in toolchain-buildroot/Config.in.2 is the
inclusion of the elf2flt option. It doesn't really make sense to have
a separate Config.in file for that, so let's move this to
toolchain-buildroot/Config.in.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-15 23:20:54 +02:00
Thomas Petazzoni c5866be0ad toolchain: refactor Stack Smashing Protection support
This commit refactors how Stack Smashing Protection support is handled
in Buildroot:

 *) It turns the BR2_TOOLCHAIN_BUILDROOT_USE_SSP option into an option
    that only enables the SSP support in uClibc, when using the internal
    toolchain backend.

 *) It adds an hidden BR2_TOOLCHAIN_HAS_SSP option that gets enabled
    when the toolchain has SSP support. Here we have the usual dance:
    glibc/eglibc in internal/external backend always select this
    option, in the case of uClibc/internal, it gets selected when
    BR2_TOOLCHAIN_BUILDROOT_USE_SSP is enabled, in the case of
    uClibc/external, there is a new configuration option that the user
    must select (or not) depending on whether the toolchain has SSP
    support.

 *) It adds a new options BR2_ENABLE_SSP in the "Build options" menu,
    to enable the usage of SSP support, by adding
    -fstack-protector-all to the CFLAGS.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-15 23:02:57 +02:00
Thomas Petazzoni 14a2d0b5ab toolchain: add support for glibc
The support for eglibc 2.17 was added to the internal toolchain
backend for 2013.08. This commit now adds glibc 2.18 support to the
internal toolchain backend.

Since the building procedure is very similar to the one of eglibc, we
have renamed the 'eglibc' package to 'glibc', and made it capable of
handling either glibc or eglibc.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-15 22:58:37 +02:00
Thomas Petazzoni 8e12e0a17a gcc: move C++ support option next to Fortran/Objective-C
The option to enable C++ support was still located in
toolchain/toolchain-buildroot/Config.in.2, with misc other toolchain
options. It seems more logical to have this option with the other
options to select the languages supported by the cross-compiler, so we
move it next to the Fortran/Objective-C options in
package/gcc/Config.in.host.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-15 22:58:03 +02:00
Thomas Petazzoni 2babed4a50 toolchain-internal: skip gcc-intermediate when possible
When NPTL support was introduced, gcc required a three stages build
process. Since gcc 4.7, this is no longer necessary, and it is
possible to get back to a two stages build process. This patch takes
advantage of this, by doing a two stages build process when possible.

We introduce a few hidden kconfig options:

 * BR2_GCC_VERSION_NEEDS_THREE_STAGE_BUILD, which is set by the gcc
   Config.in logic to indicate that the compiler might need a three
   stages build. Currently, all versions prior to 4.7.x are selecting
   this kconfig option.

 * BR2_TOOLCHAIN_LIBC_NEEDS_THREE_STAGE_BUILD, which indicates whether
   the C library might need a three stages build. This is the case for
   eglibc, and uClibc when NPTL is enabled.

 * BR2_TOOLCHAIN_NEEDS_THREE_STAGE_BUILD finally is enabled when both
   of the previous options are enabled. It indicates that a three
   stages build is actually needed.

In addition to those options, the uClibc/gcc build logic is changed to
use only a two stages build process when possible.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-15 22:50:20 +02:00
Thomas De Schampheleire f8d89f0510 infra: introduce suitable-extractor helper function
In order to simplify determining the right extractor tool for a given
file type, this patch introduces a make function 'suitable-extractor'.
Its usage is $(call suitable-extractor,filename), and it returns the
path to the suitable extractor.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-06 23:30:27 +02:00
Ezequiel Garcia d1de1c0d1f toolchain-external: Add Sourcery CodeBench for Nios-II
This commit adds the pre-built Sourcery CodeBench toolchains
currently available for the Nios-II architecture.

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-02 21:39:35 +02:00
Ezequiel Garcia 830205c036 nios2: Add new architecture
This commit adds very basic support to build for the Nios II
architecture. Toolchain support is still missing and instead
we need to use an external custom toolchain.

Notice that this architecture had been previously removed in
Buildroot 2010.05-rc1 release (as explained in the CHANGES file)
and this commit adds it back.

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-02 21:38:45 +02:00
Peter Korsgaard 91141b1411 Merge branch 'next' 2013-08-31 23:32:29 +02:00
Samuel Martin 5628776c4a toolchain-external: fix lib64 symlinks
* Always link lib64 or lib32 to lib
* Only copy the architecture's lib directory to staging
* Also cleanup a couple of mkdirs (concerning some 'lib' directories).

Before this patch:

$ ls -ld host/usr/x86_64-buildroot-linux-gnu/sysroot/{,usr/}lib* target/{usr/,}lib*
drwxr-xr-x 2 samuel users 4.0K Aug 12 22:26 host/usr/x86_64-buildroot-linux-gnu/sysroot/lib/
drwxr-xr-x 2 samuel users 4.0K Aug 12 22:27 host/usr/x86_64-buildroot-linux-gnu/sysroot/lib64/
drwxr-xr-x 5 samuel users 4.0K Oct 30  2012 host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/
drwxr-xr-x 5 samuel users 4.0K Aug 12 22:27 host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib64/
drwxr-xr-x 3 samuel users 4.0K Oct 30  2012 host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/libexec/
drwxr-xr-x 2 samuel users 4.0K Aug 12 22:27 target/lib/
lrwxrwxrwx 1 samuel users    3 Aug 12 22:27 target/lib64 -> lib/
drwxr-xr-x 2 samuel users 4.0K Aug 12 22:27 target/usr/lib/
lrwxrwxrwx 1 samuel users    3 Aug 12 22:27 target/usr/lib64 -> lib/

$ find . -type l -xtype l # find broken symlinks
find: `./host/usr/x86_64-buildroot-linux-gnu/sysroot/lib64/lib': Too many levels of symbolic links
find: `./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib64/lib': Too many levels of symbolic links
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnss_files.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnss_nis.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnss_compat.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnss_nisplus.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libutil.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libthread_db.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libcidn.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libcrypt.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libm.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnss_hesiod.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnsl.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/librt.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnss_db.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libanl.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libBrokenLocale.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libnss_dns.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libresolv.so
./host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libdl.so
./target/etc/resolv.conf
./target/dev/log

After this patch:
$ ls -ld host/usr/x86_64-buildroot-linux-gnu/sysroot/{,usr/}lib* target/{usr/,}lib*
drwxr-xr-x 2 samuel users 4.0K Oct 30  2012 host/usr/x86_64-buildroot-linux-gnu/sysroot/lib/
lrwxrwxrwx 1 samuel users    5 Aug 12 22:36 host/usr/x86_64-buildroot-linux-gnu/sysroot/lib64 -> lib/
drwxr-xr-x 5 samuel users 4.0K Oct 30  2012 host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib/
lrwxrwxrwx 1 samuel users    5 Aug 12 22:36 host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/lib64 -> lib/
drwxr-xr-x 3 samuel users 4.0K Oct 30  2012 host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/libexec/
drwxr-xr-x 2 samuel users 4.0K Aug 12 22:36 target/lib/
lrwxrwxrwx 1 samuel users    3 Aug 12 22:36 target/lib64 -> lib/
drwxr-xr-x 2 samuel users 4.0K Aug 12 22:36 target/usr/lib/
lrwxrwxrwx 1 samuel users    3 Aug 12 22:36 target/usr/lib64 -> lib/

$ find . -type l -xtype l # find broken symlinks
./target/etc/resolv.conf
./target/dev/log

Fixes http://autobuild.buildroot.net/results/23fb6b1479d2b5906b72c9437b06ab4700ff246d/

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-08-27 23:39:28 +02:00
Markos Chandras 6f70ba3bed toolchain-external: Restrict Sourcery CodeBench toolchains for MIPS/n32
n32 is not supported in Sourcery CodeBench toolchains.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-08-13 11:56:44 +02:00
Thomas De Schampheleire 97565866e8 toolchain-external: don't create gdb symlink when building host-gdb
The external-toolchain infrastructure creates symbolic links for all
tools in the host directory. However, when buildroot builds its own
version of a cross debugger (BR2_PACKAGE_HOST_GDB), and the toolchain
also provides a cross debugger, there would be two symbolic links for
gdb in the host directory, which is confusing.
An example use case is where the external toolchain only provides a
64-bit gdbserver (e.g. Cavium Networks SDK) but the target is completely
32-bit (e.g. n32 ABI). In this case, using gdbserver on target requires
copying a bunch of 64-bit libraries to the target as well, just for gdb.
In this case, one can let buildroot build both gdbserver as cross-gdb
(both in 32-bit).

This patch modifies the symlink creation so that no gdb (or gdbtui)
symlink is created if buildroot is going to build a cross-gdb.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-08-10 21:11:12 +02:00