Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] External toolchain improvements
Date: Wed, 1 Jul 2009 16:05:13 +0200	[thread overview]
Message-ID: <20090701160513.2ce29151@surf> (raw)
In-Reply-To: <1246406073.21132.13.camel@coalu.atr>

Hi Lionel,

Le Wed, 01 Jul 2009 01:54:33 +0200,
Lionel Landwerlin <lionel.landwerlin@openwide.fr> a ?crit :

> I'm interested by your patches, I'm using a STLinux external toolchain
> (Linux for SH4 SetTop Boxes).

Ok. Nice to see interest in external toolchain support, which is still
experimental, as you saw.

> The problem is that copying only libraries is not enough to build
> even a simple program like this one :

I'm not sure which Buildroot version you're using, but 2009.05 and
current Git don't only copy the libraries. Here is what we do :

 1) Copy + strip the libraries to the target space
    (project_build_ARCH/PROJECT/root). Only the files needed for
    execution need to be copied to the target space.

 2) Copy the full sysroot to the staging space (build_ARCH/staging_dir).

This is done in toolchain/external-toolchain/ext-took.mk.

> int main (void) { return 0; }
> 
> With my current toolchain, I also need :
> 
>       * crt1.o crti.o crtn.o
>       * All headers from the libc & linux

In current Buildroot, all these are copied to the staging directory. In
an example build, I have :

$ find . -name '*crt*'
./build_arm/staging_dir/usr/lib/Scrt1.o
./build_arm/staging_dir/usr/lib/crt1.o
./build_arm/staging_dir/usr/lib/crti.o
./build_arm/staging_dir/usr/lib/crtn.o

$ find build_arm/staging_dir/ -name '*.h' | head -5
build_arm/staging_dir/usr/include/neteconet/ec.h
build_arm/staging_dir/usr/include/strings.h
build_arm/staging_dir/usr/include/ttyent.h
build_arm/staging_dir/usr/include/pty.h
build_arm/staging_dir/usr/include/mntent.h

> After that, I also have problems with packages using pkg-config.
> Pkg-config returns paths relatives to the build directory ( -L/usr/lib
> for example). Gcc tries to link with host libraries...

This should theorically not happen since we should pass --sysroot to
every gcc/ld compilation step, and therefore all paths should be
interpreted relative to the sysroot (which is in fact the staging dir).

> We probably need a double --sysroot parameter to look first where the
> toolchain is installed and then in the given sysroot path.

Could you give more details about what you're doing :

 * Buildroot version
 * Buildroot .config file
 * Error messages
 * External toolchain used

Thanks !

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2009-07-01 14:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.0.1246405094.1110.buildroot@busybox.net>
2009-06-30 23:50 ` [Buildroot] External toolchain improvements Lionel Landwerlin
2009-06-30 23:54 ` Lionel Landwerlin
2009-07-01 14:05   ` Thomas Petazzoni [this message]
2009-07-01 21:43     ` Lionel Landwerlin
2009-07-02 12:50       ` Thomas Petazzoni
2009-07-03  6:01         ` Lionel Landwerlin
2009-07-03  8:13           ` Thomas Petazzoni
2009-07-03 21:24             ` Lionel Landwerlin
2009-07-06  0:51             ` Lionel Landwerlin
2009-07-13 19:26         ` Lionel Landwerlin
2009-07-14 14:41           ` Thomas Petazzoni
2009-07-14 19:51             ` Lionel Landwerlin
2009-06-01 16:54 Thomas Petazzoni

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20090701160513.2ce29151@surf \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

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

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