John Poole | 7 Jun 20:35
Favicon

Clarification of 5.e Embedded Handbook

I'm trying to install a cross compiler on my AMD64 for arm (SheevaPlug) 
and have been following your Gentoo Embedded Handbook at 
http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml

I do not fully understand Chapter 5 "Cross-Compiling with Portage", 
specifically the section 5.e on "Helper: pkg-config".

The instructions state:

vvvvvvvvvvvv

Many packages are moving to installing pkg-config files (*.pc) and using 
those to discover needed libraries and includes. To ease the build 
process, you should install a pkg-config wrapper for your target which 
will tell pkg-config to only search your cross-compiler paths rather 
than your host paths.

You should install this into your PATH so that configure scripts will 
detect it properly. Name it with a CTARGET prefix and the script will do 
the rest. In other words, if your CTARGET is set to arm-linux-uclibc, 
the canonical name is arm-linux-uclibc-pkg-config. Older configure 
scripts would only search for pkg-config, so in those cases you will 
need to export the PKG_CONFIG variable to the wrapper script.
^^^^^^^^^^^^^^

So, I created a file arm-softfloat-linux-gnueabi-pkg-config and placed 
same under my directory "/usr/arm-softfloat-linux-gnueabi/etc".  The 
contents of the file were copied form the web page, to wit:

vvvvvvvvvvvvvvv
(Continue reading)

Picon
Gravatar

Re: Clarification of 5.e Embedded Handbook

2009/6/7 John Poole <jlpoole@...>:
> I'm trying to install a cross compiler on my AMD64 for arm (SheevaPlug) and
> have been following your Gentoo Embedded Handbook at
> http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml
>
> I do not fully understand Chapter 5 "Cross-Compiling with Portage",
> specifically the section 5.e on "Helper: pkg-config".
>
> The instructions state:
>
> vvvvvvvvvvvv
>
> Many packages are moving to installing pkg-config files (*.pc) and using
> those to discover needed libraries and includes. To ease the build process,
> you should install a pkg-config wrapper for your target which will tell
> pkg-config to only search your cross-compiler paths rather than your host
> paths.
>
> You should install this into your PATH so that configure scripts will detect
> it properly. Name it with a CTARGET prefix and the script will do the rest.
> In other words, if your CTARGET is set to arm-linux-uclibc, the canonical
> name is arm-linux-uclibc-pkg-config. Older configure scripts would only
> search for pkg-config, so in those cases you will need to export the
> PKG_CONFIG variable to the wrapper script.
> ^^^^^^^^^^^^^^
>
> So, I created a file arm-softfloat-linux-gnueabi-pkg-config and placed same
> under my directory "/usr/arm-softfloat-linux-gnueabi/etc".  The contents of
> the file were copied form the web page, to wit:
>
(Continue reading)

Tim Erwin | 8 Jun 03:21
Picon

chroot

I am trying to create a stage3 image for my phone. I have emerge-armv4tl-softfloat-linux-gnueabi -av system successfully and transferred this to my phone  but when I try to chroot into this image I get the error:

/bin/bash: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory

Is there something I am missing?

Regards,

Tim

Sven Rebhan | 8 Jun 09:29

Re: chroot

2009/6/8 Tim Erwin <taerwin@...>:
> /bin/bash: error while loading shared libraries: libgcc_s.so.1: cannot open
> shared object file: No such file or directory

You need to select a gcc for you chroot. Please take a look at

http://gentoo.mindzoo.de/index.cgi/wiki/Cross%20Install

Especially the step

ROOT=<path to stage3 dir> gcc-config -l
ROOT=<path to stage3 dir> gcc-config <the gcc you want!>

This needs to be executed _before_ executing chroot the first time.

Hope this helps!?

    Sven

Tim Erwin | 8 Jun 15:09
Picon

Re: chroot


Especially the step

ROOT=<path to stage3 dir> gcc-config -l
ROOT=<path to stage3 dir> gcc-config <the gcc you want!>

Nope not that.

It seems that libgcc_s.so.1 is missing from /lib directory (it exists in /usr/lib/gcc/armv4tl-softfloat-linux-gnueabi/4.3.2/)

Copied it over and presto! Anyone else with this problem? Cross-compile bug?

Cheers,

Tim

Picon
Gravatar

Re: chroot

2009/6/8 Tim Erwin <taerwin@...>:
>
>> Especially the step
>>
>> ROOT=<path to stage3 dir> gcc-config -l
>> ROOT=<path to stage3 dir> gcc-config <the gcc you want!>
>
> Nope not that.
>
> It seems that libgcc_s.so.1 is missing from /lib directory (it exists in
> /usr/lib/gcc/armv4tl-softfloat-linux-gnueabi/4.3.2/)
>
> Copied it over and presto! Anyone else with this problem? Cross-compile bug?
>
> Cheers,
>
> Tim
>
>

I have the same.
Workaround is

1. copy host machine's cross-gcc lib into
/usr/arm-unknown-linux-gnueabi/usr/lib/gcc/arm-unlnown-linux-gnueabi/4.4.0

2. make symlinks /usr/arm-unknown-linux-gnueabi/usr/lib/libgcc_s.so*
(HOST path) to point to
/usr/lib/gcc/arm-unlnown-linux-gnueabi/4.4.0/libgcc_s.so* (TARGET
path)

think, that it is a bug..

--

-- 
С Уважением,
Сергей.

Sven Rebhan | 8 Jun 18:18

Re: chroot

2009/6/8 Tim Erwin <taerwin@...>:
> It seems that libgcc_s.so.1 is missing from /lib directory (it exists in
> /usr/lib/gcc/armv4tl-softfloat-linux-gnueabi/4.3.2/)

Did you install gcc on the target? If not, then this is your problem.
However, I would appreciate if anyone would manage to create a libgcc
ebuild that only builds and installs libgcc without the whole gcc
machinery.

Sven

Ned Ludd | 8 Jun 18:31
Picon
Favicon

Re: chroot

On Mon, 2009-06-08 at 23:09 +1000, Tim Erwin wrote:
> 
>         Especially the step
>         
>         ROOT=<path to stage3 dir> gcc-config -l
>         ROOT=<path to stage3 dir> gcc-config <the gcc you want!>
> 
> Nope not that.
> 
> It seems that libgcc_s.so.1 is missing from /lib directory (it exists
> in /usr/lib/gcc/armv4tl-softfloat-linux-gnueabi/4.3.2/)
> 
> Copied it over and presto! Anyone else with this problem?
> Cross-compile bug?

When you enter the chroot. You most likely forget to initialy run an
env-update. Which should update the /etc/ld.so.conf and then the
ld.so.cache

Or simply: 

echo /usr/lib/gcc/armv4tl-softfloat-linux-gnueabi/4.3.2/ \
  >> $ROOT/etc/ld.so.conf ; chroot $ROOT /sbin/ldconfig -a

Mike Frysinger | 9 Jun 02:55
Picon
Favicon
Gravatar

Re: chroot

On Monday 08 June 2009 09:09:45 Tim Erwin wrote:
> > Especially the step
> >
> > ROOT=<path to stage3 dir> gcc-config -l
> > ROOT=<path to stage3 dir> gcc-config <the gcc you want!>
>
> Nope not that.

except that it's *exactly* that

> It seems that libgcc_s.so.1 is missing from /lib directory (it exists in
> /usr/lib/gcc/armv4tl-softfloat-linux-gnueabi/4.3.2/)

that's because gcc-config handles the installation

> Copied it over and presto! Anyone else with this problem? Cross-compile
> bug?

not-following-good-directions bug
-mike
Tim Erwin | 9 Jun 04:06
Picon

Re: chroot


> > Especially the step
> >
> > ROOT=<path to stage3 dir> gcc-config -l
> > ROOT=<path to stage3 dir> gcc-config <the gcc you want!>
>
> Nope not that.

except that it's *exactly* that

Then it is definitely something I am missing ...

# ROOT=/mnt/gentoo_arm_stage3/ gcc-config -l
Using gcc-config info in /mnt/gentoo_arm_stage3/
 [1] armv4tl-softfloat-linux-gnueabi-4.3.2 *
 
# ls /mnt/gentoo_arm_stage3/lib/libgcc*
ls: cannot access /mnt/gentoo_arm_stage3/lib/libgcc*: No such file or directory

> Did you install gcc on the target?

Sure did gets pulled in with emerge system

Cheers,

Tim

Gmane