| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, the function copy_toolchain_lib_root was copying a given
library to the target filesystem by assuming that it should be at the
same place it was in the toolchain sysroot.
However, with Buildroot hiding libstdc++ in
/usr/<target-name>/lib(64), this isn't correct, and it is probably
safer not to rely on the toolchain organization anyway.
Therefore :
* Instead of having a single EXTERNAL_LIBS variable, we now have
LIB_EXTERNAL_LIBS and USR_LIB_EXTERNAL_LIBS, which respectively
list the libraries that should be copied to /lib and /usr/lib. As
of today, only libstdc++ is part of the second list.
* The copy_toolchain_lib_root takes another argument, which is the
destination directory of the library, relative to $(TARGET_DIR)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
Most toolchains have their libraries either in /lib or /usr/lib
relative to their ARCH_SYSROOT_DIR. Buildroot toolchains, however,
have basic libraries in /lib, and libstdc++/libgcc_s in
/usr/<target-name>/lib(64).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
With uClibc 64 bits toolchain, the dynamic loader is named
ld64-uClibc.so.0 and not ld-uClibc.so.0. So, this commit adjust the
uClibc detection code for external toolchains.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
| |
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create lib64 -> lib and usr/lib64 -> usr/lib symbolic links in the
target and staging directories. This is needed for some 64 bits
toolchains such as the Crosstool-NG toolchains, for which the path to
the dynamic loader and other libraries is /lib64, but the libraries
are stored in /lib.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
On 64 bits glibc toolchains, the dynamic loader is named
ld-linux-x86-64.so and not simply ld-linux.so. So, adjust the
detection of the C library accordingly.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
Instead of copying all directories in "etc lib sbin usr", check that
each of them exists before doing the copy. This is only to avoid an
harmless error message.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the detection of the ARCH_SYSROOT_DIR (which contains the C
library variant specific to the compiler flags), we used to pass only
the -march argument instead of the full TARGET_CFLAGS. This was done
because TARGET_CFLAGS contains --sysroot, and we don't want to tell
here the compiler which sysroot to use, because we're specifically
asking the compiler where the *normal* arch sysroot directory is.
Unfortunately, there are some multilib variants that aren't decided
only based on -march, but also on -msoft-float or other compiler
flags. Therefore, we take the opposite approach: pass the full
TARGET_CFLAGS, from which we have stripped the --sysroot option.
For example, this allows a PowerPC CodeSourcery toolchain, on which
we're using the soft-float multilib variant, to work properly as an
external toolchain.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
|
|
| |
External toolchains using Glibc have different names for the dynamic
loader. Some of them name it ld-linux.so.*, while some others (such as
the PowerPC and MIPS CodeSourcery toolchains) name it simply ld.so.*.
Therefore, we fix the glibc detection code to handle this case.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
gdbserver dlopen(3)s libthread_db.so at runtime, so there is no
dependency on it (does not appear as being (NEEDED)).
Copy libthread_db.so from external toolchain when gdbserver is enbled.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
If threads are disabled, do not try to copy the libpthread.so from the
external library.
It is still expected that the BR configuration matches the external
toolchain setup, and no check is done to enforce that.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
| |
Verify that the value of BR2_INSTALL_LIBSTDCPP set by the user in the
Buildroot configuration really matches the external toolchain
capabilities by checking that a C++ cross-compiler is available.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multilib toolchains provide different versions of the base libraries
for different architecture variants. For example, the ARM Codesourcery
toolchain provides base libraries for ARMv5 (default), ARMv4t and
Thumb2.
Depending on the -march= argument passed to gcc, the sysroot used by
the compiler is therefore different. This means that the sysroot
location in CROSS-gcc -v cannot be used. Instead, we must use
CROSS-gcc -print-sysroot when available and fall back to the old way
if unavailable.
Moreover, we cannot simply copy the full sysroot as we used to do,
because the sysroot organization of multilib toolchain is more
complicated. In Codesourcery toolchains, we have :
/
etc -- for ARMv5
lib -- for ARMv5
sbin -- for ARMv5
usr -- for ARMv5 (includes headers)
armv4t
etc -- for ARMv4t
lib -- for ARMv4t
sbin -- for ARMv4t
usr -- for ARMv4t (no headers!)
thumb2
etc -- for Thumb2
lib -- for Thumb2
sbin -- for Thumb2
usr -- for Thumb2 (no headers!)
So we have the default ARMv5 architecture variant that is installed in
the main directory, and we have subdirectories for the ARMv4t and
Thumb2 architecture variants.
Copying the full sysroot to the staging directory doesn't work. All
our packages are based on the fact that they should install libraries
in staging/usr/lib. But if ARMv4t is used, the compiler would only
look in staging/armv4t/usr/lib for libraries (even when overriding the
sysroot with the --sysroot option, the multilib compiler suffixes the
sysroot directory with the architecture variant if it matches a
recognized one).
Therefore, we have to copy only the sysroot that we are interested
in. This is rendered a little bit complicated by the fact that the
armv4t and thumb2 sysroot do not contain the headers since they are
shared with the armv5 sysroot.
So, this patch :
* Modifies how we compute SYSROOT_DIR in order to use -print-sysroot
if it exists. SYSROOT_DIR contains the location of the main sysroot
directory, i.e the sysroot for the default architecture variant.
* Defines ARCH_SUBDIR as the subdirectory in the main sysroot for the
currently selected architecture variant (in our case, it can be
".", "armv4t" or "thumb2"). ARCH_SYSROOT_DIR is defined as the full
path to the sysroot of the currently selected architecture variant.
* Modifies copy_toolchain_lib_root (which copies a library to the
target/ directory) so that libraries are taken from
ARCH_SYSROOT_DIR instead of SYSROOT_DIR. This ensures that
libraries for the correct architecture variant are properly copied
to the target.
* Modifies copy_toolchain_sysroot (which copies the sysroot to the
staging/ directory), so that it copies the contents of
ARCH_SYSROOT_DIR, and if needed, adds the headers from the main
sysroot directory and a symbolic link (armv4t -> . or thumb2 -> .)
to make the compiler believe that its sysroot is really in armv4t/
or thumb2/.
Tested with Codesourcery 2009q1 ARM toolchain, Crosstool-NG ARM glibc
and ARM uClibc toolchains.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The copy_toolchain_lib_root function was making the assumption that
all libraries were stored inside the /lib directory of the sysroot
directory. However, this isn't true for certain toolchains,
particularly for the libstdc++ library.
The function is therefore reworked to find the library and its related
symlink either in /lib or /usr/lib in the sysroot, and copies it at
the same location in the target directory.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The toolchains built with buildroot use specially crafted paths for their
sysroot and prefix. Fix that by asking gcc where it finds a file we
know by relative path to the sysroot.
This has the side effect of greatly simplifying the sysroot detection
in every cases tested so far (BR toolchains, CT-NG toolchains, and
CodeSourcery toolchains).
Fixes bug #851.
Thanks Thomas Petazzoni for the hint and some testings.
Thanks Grant Edwards for the report and the comments.
Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
| |
Sysrooted toolchain can be relocated. In this case, the sysroot is no
longer located at the place it was configured at.
Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Acked-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
Fix problem with dns resolv, by copying the libnss_dns.so to the rootfs.
Using glibc from external toolchain, name resolving does not work,
unless libnss_dns.so is available on the target.
Signed-off-by: Anders Darander <ad@datarespons.se>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BR2_UCLIBC_PROGRAM_INVOCATION is a toolchain configuration option,
like BR2_INET_IPV6, BR2_INET_RPC, on which some packages
depend. Therefore, it should be handled like BR2_INET_IPV6 and
BR2_INET_RPC in order to work properly with external toolchains.
Since we move it out of toolchain/uClibc/Config.in into
toolchain/Config.in.2, we rename the option to BR2_PROGRAM_INVOCATION
(since BR2_INET_RPC and others don't have UCLIBC in their name).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
| |
As a minimal test to the external toolchain, check that $(TARGET_CC)
is actually an existing executable file. That way, if the user
misconfigures the toolchain path and/or prefix, a meaningful error
message will be shown.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
| |
Use $(Q) in external toolchain support so that the user can get the
full output by passing V=1 to make, and still get a nice and clean
output by default.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
| |
Obey the BR2_INSTALL_LIBSTDCPP configuration option to copy the C++
standard library to the target. Suggested by Lionel Landwerlin
<lionel.landwerlin@openwide.fr>.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
| |
Do not copy .so symbolic links to target when not needed. Only copy
.so.X symbolic links and the library itself.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
| |
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lionel Landwerlin <lionel.landwerlin@openwide.fr> reported that using
the external toolchain support when LANG=fr_FR.UTF-8 doesn't work,
since the messages printed by gcc -v are translated in another
language, defeating the grep ^Configured test.
Therefore, as per Lionel suggestion, we force LANG=C when calling
$(TARGET_CC) -v.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Introduce documentation for each function of ext-tool.mk, and
document all parameters of the functions.
* Pass SYSROOT_DIR as argument to all functions that require it,
instead of computing it manually everywhere
* Use $(shell) instead of backquotes
* Check that the SYSROOT_DIR variable is not empty, which means that
the external toolchain doesn't support --sysroot. In that case,
bail out with a nice error message.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
| |
Instead of hardcoding the C library versions, just copy the version
available in $SYSROOT_DIR/lib.
Add a check on the ARM ABI configured in Buildroot with regard to the
ABI of the external toolchain provided.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds some checks on the external toolchains.
First, it checks that the C library selection is correct, by looking
if gcc is able to find the main C library file through the
-print-file-name option.
Then, it attempts to check if the Buildroot toolchain options match
the configuration of the toolchain :
* for glibc, it checks that IPv6, RPC, locales, wide-char, large file
support Buildroot options are enabled, since with glibc all these
features are always available (at least this is the assumption we
make) ;
* for uClibc, it checks the Buildroot options with the uClibc
configuration file in $SYSROOT_DIR/usr/include/bits/uClibc_config.h
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current Buildroot works just well with sysrootable glibc
toolchains, using the external toolchain feature. The only thing that
needs to be customized is the set of libraries that must be compiled
to the target.
The following patch takes a simple approach to making it easier for
users to use glibc toolchains. It just adds a uClibc/glibc choice in
the external toolchain menu. Then, depending on that selection, the
configuration system will choose a sane default value for the library
files list.
The other advantage of having a uClibc/glibc choice is that in the
future, we'll be able to add checks verifying that the external
toolchain configuration matches the features selected in Buildroot (in
terms of IPv6, RPC, locales or large file support).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
| |
As discussed on the list.
|
|
|
|
|
|
|
|
|
|
|
| |
that the options become visible just below
the config, instead of at bottom of screen
Create a more useful default as toolchain path.
Allow generation of a script which sets up
paths to a binary toolchain generated by buildroot.
|
|
|
|
|
|
|
| |
Only copy the sysroot files if the toolchain was built with sysroot support.
Signed-off-by: Daniel Laird <daniel.j.laird@nxp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* In toolchain/external-toolchain/ext-tool.mk, copy the contents of
the sysroot directory to the staging dir.
* In package/Makefile.in, add a --sysroot CFLAGS pointing to the
staging dir
* Remove the CFLAGS and LDFLAGS definition from
TARGET_CONFIGURE_OPTS. I haven't investigated exactly why, but with
these options, DirectFB fails to build because it cannot find
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, even if DirectFB's Makefile
properly sets -D_GNU_SOURCE.
I have already sent this patch on December, 2nd to the mailing-list,
but got no feedback. So let's commit and see what happens :-)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix issues with binary external toolchains
Fix two problems encountered while using an external binary toolchain
generated by crosstool-ng:
- Don't remove the ending / in LIB_DIR, otherwise find $LIB_DIR
-maxdepth 1 doesn't find any file in the case LIB_DIR is a symbolic
link and not a directory.
For some reason, find -maxdepth 1 doesn't have the same behaviour
on directories and symbolic links. Demonstration:
$ mkdir foobar
$ touch foobar/t1
$ touch foobar/t2
$ ln -s foobar barfoo
$ find foobar -maxdepth 1 -name 't*'
foobar/t1
foobar/t2
$ find barfoo -maxdepth 1 -name 't*'
$ find barfoo/ -maxdepth 1 -name 't*'
barfoo/t1
barfoo/t2
* Make sure the libraries are writable, otherwise the strip operation
might fail. The library files may not be writable if the toolchain
is not writable (which may happen if one wants to prevent anyone
from overwriting the toolchain, which is done by crosstool-ng, for
example).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
| |
From: Grant Likely <grant.likely@secretlab.ca>
Comment block header documentation typo
|
| |
|
| |
|
| |
|
| |
|
|
and all other comments to <biteme@devnull.com>.
|