Gentoo Archives: gentoo-embedded

From: Mike Frysinger <vapier@g.o>
To: gentoo-embedded@l.g.o
Cc: Joakim Tjernlund <joakim.tjernlund@×××××××××.se>
Subject: Re: [gentoo-embedded] crossdev builds libiberty.a with host arch
Date: Thu, 10 Nov 2011 03:56:17
Message-Id: 201111092255.59462.vapier@gentoo.org
In Reply to: [gentoo-embedded] crossdev builds libiberty.a with host arch by Joakim Tjernlund
1 On Wednesday 09 November 2011 10:37:18 Joakim Tjernlund wrote:
2 > Tried to build oprofile
3 > ./configure --host powerpc-softfloat-linux-gnu
4 > LDFLAGS="-L/usr/lib/binutils/powerpc-softfloat-linux-gnu
5 > -L/usr/local/src/FS/fsall/basicfs/usr/lib"
6 > CPPFLAGS=-I/usr/lib/binutils/powerpc-softfloat-linux-gnu/include
7 >
8 > configure: error: liberty library not found
9 >
10 > this appears to be caused by crossdevs libiberty.a beeing built with the
11 > hosts arch instead of powerpc: nm
12 > /usr/i686-pc-linux-gnu/powerpc-softfloat-linux-gnu/lib/libiberty.a | grep
13 > __i686 00000000 T __i686.get_pc_thunk.bx
14 > 00000000 T __i686.get_pc_thunk.bx
15 > ....
16 >
17 > Bug in crossdev, oprofile or user error?
18
19 user error. this is expected behavior: the libs under
20 /usr/$CHOST/$CTARGET/lib/ are libraries that will be linked for $CHOST
21 binaries but used to debug $CTARGET code. libiberty is a bad example as it
22 generally doesn't have any target info in it, so let's use libbfd.a as an
23 example instead.
24
25 linking against /usr/$CHOST/$CTARGET/lib/libbfd.a will let you run code on
26 $CHOST but load ELFs that are compiled for $CTARGET.
27
28 if you want to build oprofile for $CTARGET, you need to build binutils for
29 $CTARGET (CHOST==CTARGET).
30 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-embedded] crossdev builds libiberty.a with host arch Joakim Tjernlund <joakim.tjernlund@×××××××××.se>