Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Embedded (http://www.linux-archive.org/gentoo-embedded/)
-   -   crossdev builds libiberty.a with host arch (http://www.linux-archive.org/gentoo-embedded/596358-crossdev-builds-libiberty-host-arch.html)

Joakim Tjernlund 11-09-2011 02:37 PM

crossdev builds libiberty.a with host arch
 
Tried to build oprofile
./configure --host powerpc-softfloat-linux-gnu LDFLAGS="-L/usr/lib/binutils/powerpc-softfloat-linux-gnu -L/usr/local/src/FS/fsall/basicfs/usr/lib" CPPFLAGS=-I/usr/lib/binutils/powerpc-softfloat-linux-gnu/include

configure: error: liberty library not found

this appears to be caused by crossdevs libiberty.a beeing built with the hosts arch instead of powerpc:
nm /usr/i686-pc-linux-gnu/powerpc-softfloat-linux-gnu/lib/libiberty.a | grep __i686
00000000 T __i686.get_pc_thunk.bx
00000000 T __i686.get_pc_thunk.bx
....

Bug in crossdev, oprofile or user error?

Jocke

"YouTube Support" 11-09-2011 02:49 PM

crossdev builds libiberty.a with host arch
 
You are receiving this automated reply because you have sent mail to
an invalid email address. If you are trying to contact YouTube,
please visit the YouTube Help Center at:
http://www.google.com/support/youtube

If you're unable to find the answer to your question in the Help
Center, you may use the contact forms located there to send us your
question.



Original Message Follows:
------------------------
From: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Subject: [gentoo-embedded] crossdev builds libiberty.a with host arch
Date: Wed, 9 Nov 2011 16:37:18 +0100


Tried to build oprofile
./configure --host powerpc-softfloat-linux-gnu
LDFLAGS="-L/usr/lib/binutils/powerpc-softfloat-linux-gnu
-L/usr/local/src/FS/fsall/basicfs/usr/lib"
CPPFLAGS=-I/usr/lib/binutils/powerpc-softfloat-linux-gnu/include

configure: error: liberty library not found

this appears to be caused by crossdevs libiberty.a beeing built with the
hosts arch instead of powerpc:
nm /usr/i686-pc-linux-gnu/powerpc-softfloat-linux-gnu/lib/libiberty.a |
grep __i686
00000000 T __i686.get_pc_thunk.bx
00000000 T __i686.get_pc_thunk.bx
....

Bug in crossdev, oprofile or user error?

Jocke

Mike Frysinger 11-10-2011 02:53 AM

crossdev builds libiberty.a with host arch
 
On Wednesday 09 November 2011 10:49:23 YouTube Support wrote:
> You are receiving this automated reply because you have sent mail to
> an invalid email address. If you are trying to contact YouTube,
> please visit the YouTube Help Center at:
> http://www.google.com/support/youtube
>
> If you're unable to find the answer to your question in the Help
> Center, you may use the contact forms located there to send us your
> question.

wtf is this
-mike

Mike Frysinger 11-10-2011 02:55 AM

crossdev builds libiberty.a with host arch
 
On Wednesday 09 November 2011 10:37:18 Joakim Tjernlund wrote:
> Tried to build oprofile
> ./configure --host powerpc-softfloat-linux-gnu
> LDFLAGS="-L/usr/lib/binutils/powerpc-softfloat-linux-gnu
> -L/usr/local/src/FS/fsall/basicfs/usr/lib"
> CPPFLAGS=-I/usr/lib/binutils/powerpc-softfloat-linux-gnu/include
>
> configure: error: liberty library not found
>
> this appears to be caused by crossdevs libiberty.a beeing built with the
> hosts arch instead of powerpc: nm
> /usr/i686-pc-linux-gnu/powerpc-softfloat-linux-gnu/lib/libiberty.a | grep
> __i686 00000000 T __i686.get_pc_thunk.bx
> 00000000 T __i686.get_pc_thunk.bx
> ....
>
> Bug in crossdev, oprofile or user error?

user error. this is expected behavior: the libs under
/usr/$CHOST/$CTARGET/lib/ are libraries that will be linked for $CHOST
binaries but used to debug $CTARGET code. libiberty is a bad example as it
generally doesn't have any target info in it, so let's use libbfd.a as an
example instead.

linking against /usr/$CHOST/$CTARGET/lib/libbfd.a will let you run code on
$CHOST but load ELFs that are compiled for $CTARGET.

if you want to build oprofile for $CTARGET, you need to build binutils for
$CTARGET (CHOST==CTARGET).
-mike

Joakim Tjernlund 11-11-2011 07:26 AM

crossdev builds libiberty.a with host arch
 
Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/10 04:55:58:
> From: Mike Frysinger <vapier@gentoo.org>
> On Wednesday 09 November 2011 10:37:18 Joakim Tjernlund wrote:
> > Tried to build oprofile
> > ./configure --host powerpc-softfloat-linux-gnu
> > LDFLAGS="-L/usr/lib/binutils/powerpc-softfloat-linux-gnu
> > -L/usr/local/src/FS/fsall/basicfs/usr/lib"
> > CPPFLAGS=-I/usr/lib/binutils/powerpc-softfloat-linux-gnu/include
> >
> > configure: error: liberty library not found
> >
> > this appears to be caused by crossdevs libiberty.a beeing built with the
> > hosts arch instead of powerpc: nm
> > /usr/i686-pc-linux-gnu/powerpc-softfloat-linux-gnu/lib/libiberty.a | grep
> > __i686 00000000 T __i686.get_pc_thunk.bx
> > 00000000 T __i686.get_pc_thunk.bx
> > ....
> >
> > Bug in crossdev, oprofile or user error?
>
> user error. this is expected behavior: the libs under
> /usr/$CHOST/$CTARGET/lib/ are libraries that will be linked for $CHOST
> binaries but used to debug $CTARGET code. libiberty is a bad example as it
> generally doesn't have any target info in it, so let's use libbfd.a as an
> example instead.
>
> linking against /usr/$CHOST/$CTARGET/lib/libbfd.a will let you run code on
> $CHOST but load ELFs that are compiled for $CTARGET.
>
> if you want to build oprofile for $CTARGET, you need to build binutils for
> $CTARGET (CHOST==CTARGET).
> -mike

Ahh, too long time since I mucked around with sysroot. I installed binutils and now I got
a the correct libbfd.so and libiberty.a under
/usr/powerpc-softfloat-linux-gnu/usr/lib/binutils/powerpc-softfloat-linux-gnu/2.16.1/
There is no symlink under
/usr/powerpc-softfloat-linux-gnu/lib/
though which forces me to pass -L and -I options too gcc in order to
build oprofile. Would be nice if the symlinks were created to make the
x-compile env. mimic the normal host env.

Same for libbfd and headers for those 2 libs.

Jocke

Mike Frysinger 11-11-2011 01:46 PM

crossdev builds libiberty.a with host arch
 
On Friday 11 November 2011 03:26:22 Joakim Tjernlund wrote:
> I installed binutils
> and now I got a the correct libbfd.so and libiberty.a under
> /usr/powerpc-softfloat-linux-gnu/usr/lib/binutils/powerpc-softfloat-linux-
> gnu/2.16.1/ There is no symlink under
> /usr/powerpc-softfloat-linux-gnu/lib/
> though which forces me to pass -L and -I options too gcc in order to
> build oprofile. Would be nice if the symlinks were created to make the
> x-compile env. mimic the normal host env.

try running:
ROOT=/usr/powerpc-softfloat-linux-gnu binutils-config 1
-mike

Joakim Tjernlund 11-11-2011 02:47 PM

crossdev builds libiberty.a with host arch
 
Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/11 15:46:44:
>
> On Friday 11 November 2011 03:26:22 Joakim Tjernlund wrote:
> > I installed binutils
> > and now I got a the correct libbfd.so and libiberty.a under
> > /usr/powerpc-softfloat-linux-gnu/usr/lib/binutils/powerpc-softfloat-linux-
> > gnu/2.16.1/ There is no symlink under
> > /usr/powerpc-softfloat-linux-gnu/lib/
> > though which forces me to pass -L and -I options too gcc in order to
> > build oprofile. Would be nice if the symlinks were created to make the
> > x-compile env. mimic the normal host env.
>
> try running:
> ROOT=/usr/powerpc-softfloat-linux-gnu binutils-config 1
> -mike

:) that got me
/usr/powerpc-softfloat-linux-gnu/usr/i686-pc-linux-gnu/powerpc-softfloat-linux-gnu/lib/libiberty.a ->
/usr/lib/binutils/powerpc-softfloat-linux-gnu/2.16.1/libiberty.a

but this is a host arch libiberty.a so can't use it for x-compile :(

No sign of any new libiberty.h header files though.
Did I miss something?

Jocke

Mike Frysinger 11-11-2011 03:01 PM

crossdev builds libiberty.a with host arch
 
On Friday 11 November 2011 10:47:02 Joakim Tjernlund wrote:
> Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/11 15:46:44:
> > On Friday 11 November 2011 03:26:22 Joakim Tjernlund wrote:
> > > I installed binutils
> > > and now I got a the correct libbfd.so and libiberty.a under
> > >
> > > /usr/powerpc-softfloat-linux-gnu/usr/lib/binutils/powerpc-softfloat-li
> > > nux-
> > >
> > > gnu/2.16.1/ There is no symlink under
> > >
> > > /usr/powerpc-softfloat-linux-gnu/lib/
> > >
> > > though which forces me to pass -L and -I options too gcc in order to
> > > build oprofile. Would be nice if the symlinks were created to make the
> > > x-compile env. mimic the normal host env.
> >
> > try running:
> > ROOT=/usr/powerpc-softfloat-linux-gnu binutils-config 1
>
> :) that got me
> /usr/powerpc-softfloat-linux-gnu/usr/i686-pc-linux-gnu/powerpc-softfloat-l
> inux-gnu/lib/libiberty.a ->
> /usr/lib/binutils/powerpc-softfloat-linux-gnu/2.16.1/libiberty.a
>
> but this is a host arch libiberty.a so can't use it for x-compile :(

hmm, yeah, that's because binutils-config doesn't use relative symlinks. i
wonder if relative would be fine since it isn't crossing the /usr boundary ...


> No sign of any new libiberty.h header files though.
> Did I miss something?

you might also have to manually set CHOST otherwise binutils-config will think
it's setting up a cross-compiler.

CHOST=powerpc-softfloat-linux-gnu
ROOT=/usr/powerpc-softfloat-linux-gnu
binutils-config 1
-mike

Joakim Tjernlund 11-12-2011 08:31 PM

crossdev builds libiberty.a with host arch
 
Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/11 17:01:28:
>
> On Friday 11 November 2011 10:47:02 Joakim Tjernlund wrote:
> > Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/11 15:46:44:
> > > On Friday 11 November 2011 03:26:22 Joakim Tjernlund wrote:
> > > > I installed binutils
> > > > and now I got a the correct libbfd.so and libiberty.a under
> > > >
> > > > /usr/powerpc-softfloat-linux-gnu/usr/lib/binutils/powerpc-softfloat-li
> > > > nux-
> > > >
> > > > gnu/2.16.1/ There is no symlink under
> > > >
> > > > /usr/powerpc-softfloat-linux-gnu/lib/
> > > >
> > > > though which forces me to pass -L and -I options too gcc in order to
> > > > build oprofile. Would be nice if the symlinks were created to make the
> > > > x-compile env. mimic the normal host env.
> > >
> > > try running:
> > > ROOT=/usr/powerpc-softfloat-linux-gnu binutils-config 1
> >
> > :) that got me
> > /usr/powerpc-softfloat-linux-gnu/usr/i686-pc-linux-gnu/powerpc-softfloat-l
> > inux-gnu/lib/libiberty.a ->
> > /usr/lib/binutils/powerpc-softfloat-linux-gnu/2.16.1/libiberty.a
> >
> > but this is a host arch libiberty.a so can't use it for x-compile :(
>
> hmm, yeah, that's because binutils-config doesn't use relative symlinks. i
> wonder if relative would be fine since it isn't crossing the /usr boundary ...

Possibly, can't think of a reason not to.

>
>
> > No sign of any new libiberty.h header files though.
> > Did I miss something?
>
> you might also have to manually set CHOST otherwise binutils-config will think
> it's setting up a cross-compiler.
>
> CHOST=powerpc-softfloat-linux-gnu
> ROOT=/usr/powerpc-softfloat-linux-gnu
> binutils-config 1

Nope, that didn't change anything

Jocke

Joakim Tjernlund 11-12-2011 10:39 PM

crossdev builds libiberty.a with host arch
 
>
> Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/11 17:01:28:
> >
> > On Friday 11 November 2011 10:47:02 Joakim Tjernlund wrote:
> > > Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/11 15:46:44:
> > > > On Friday 11 November 2011 03:26:22 Joakim Tjernlund wrote:
> > > > > I installed binutils
> > > > > and now I got a the correct libbfd.so and libiberty.a under
> > > > >
> > > > > /usr/powerpc-softfloat-linux-gnu/usr/lib/binutils/powerpc-softfloat-li
> > > > > nux-
> > > > >
> > > > > gnu/2.16.1/ There is no symlink under
> > > > >
> > > > > /usr/powerpc-softfloat-linux-gnu/lib/
> > > > >
> > > > > though which forces me to pass -L and -I options too gcc in order to
> > > > > build oprofile. Would be nice if the symlinks were created to make the
> > > > > x-compile env. mimic the normal host env.
> > > >
> > > > try running:
> > > > ROOT=/usr/powerpc-softfloat-linux-gnu binutils-config 1
> > >
> > > :) that got me
> > > /usr/powerpc-softfloat-linux-gnu/usr/i686-pc-linux-gnu/powerpc-softfloat-l
> > > inux-gnu/lib/libiberty.a ->
> > > /usr/lib/binutils/powerpc-softfloat-linux-gnu/2.16.1/libiberty.a
> > >
> > > but this is a host arch libiberty.a so can't use it for x-compile :(
> >
> > hmm, yeah, that\'s because binutils-config doesn\'t use relative symlinks. i
> > wonder if relative would be fine since it isn\'t crossing the /usr boundary ...
>
> Possibly, can\'t think of a reason not to.
>
> >
> >
> > > No sign of any new libiberty.h header files though.
> > > Did I miss something?
> >
> > you might also have to manually set CHOST otherwise binutils-config will think
> > it\'s setting up a cross-compiler.
> >
> > CHOST=powerpc-softfloat-linux-gnu
> > ROOT=/usr/powerpc-softfloat-linux-gnu
> > binutils-config 1
>
> Nope, that didn\'t change anything

oops, my mistake there is
ls -l /usr/powerpc-softfloat-linux-gnu/usr/include/libiberty.h
lrwxrwxrwx 1 root root 72 12 nov 22.26 /usr/powerpc-softfloat-linux-gnu/usr/include/libiberty.h -> /usr/lib/binutils/powerpc-softfloat-linux-gnu/2.16.1/include/libiberty.h

I guess crossdev should run binutils-config automatically?

BTW, somewhat offtopic but why isn\'t libtool-2.4.2 unstable yet?

Jocke


All times are GMT. The time now is 08:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.