Mailing List Archive

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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
>
> 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
Re: crossdev builds libiberty.a with host arch [ In reply to ]
On Saturday 12 November 2011 18:39:33 Joakim Tjernlund wrote:
> I guess crossdev should run binutils-config automatically?

nah ... binutils eclass itself should be doing this already in toolchain-
binutils_pkg_postinst

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

no real reason. i forgot about it, and since no one has filed bugs about it
breaking them horribly, i'll move it into ~arch now.
-mike
Re: crossdev builds libiberty.a with host arch [ In reply to ]
Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/13 19:06:17:
>
> On Saturday 12 November 2011 18:39:33 Joakim Tjernlund wrote:
> > I guess crossdev should run binutils-config automatically?
>
> nah ... binutils eclass itself should be doing this already in toolchain-
> binutils_pkg_postinst
>
> > BTW, somewhat offtopic but why isn't libtool-2.4.2 unstable yet?
>
> no real reason. i forgot about it, and since no one has filed bugs about it
> breaking them horribly, i'll move it into ~arch now.

Something else I noted. I remembered I had binutils 2.18 installed too:
$ binutils-config -l
[1] i686-pc-linux-gnu-2.20.1 *

[2] powerpc-softfloat-linux-gnu-2.16.1
[3] powerpc-softfloat-linux-gnu-2.18 *

and I can select it but

CHOST=powerpc-softfloat-linux-gnu \
ROOT=/usr/powerpc-softfloat-linux-gnu \
binutils-config -l

Using binutils-config info in /usr/powerpc-softfloat-linux-gnu/
[1] powerpc-softfloat-linux-gnu-2.16.1 *

Only shows 2.16.1

...

CHOST=powerpc-softfloat-linux-gnu binutils-config -l
[1] i686-pc-linux-gnu-2.20.1 *
[2] powerpc-softfloat-linux-gnu-2.16.1
[3] powerpc-softfloat-linux-gnu-2.18 *

Shows both though(why is i686-pc-linux-gnu-2.20.1?)

Jocke
Re: crossdev builds libiberty.a with host arch [ In reply to ]
On Wednesday 16 November 2011 04:55:52 Joakim Tjernlund wrote:
> Mike Frysinger <vapier@gentoo.org> wrote on 2011/11/13 19:06:17:
> > On Saturday 12 November 2011 18:39:33 Joakim Tjernlund wrote:
> > > I guess crossdev should run binutils-config automatically?
> >
> > nah ... binutils eclass itself should be doing this already in toolchain-
> > binutils_pkg_postinst
> >
> > > BTW, somewhat offtopic but why isn't libtool-2.4.2 unstable yet?
> >
> > no real reason. i forgot about it, and since no one has filed bugs about
> > it breaking them horribly, i'll move it into ~arch now.
>
> Something else I noted. I remembered I had binutils 2.18 installed too:
> $ binutils-config -l
> [1] i686-pc-linux-gnu-2.20.1 *
>
> [2] powerpc-softfloat-linux-gnu-2.16.1
> [3] powerpc-softfloat-linux-gnu-2.18 *

these are toolchains in ROOT=/

[1] is probably: CHOST=i686-pc-linux-gnu CTARGET=i686-pc-linux-gnu
[2] and [3] is probably: CHOST=i686-pc-linux-gnu CTARGET=powerpc-softfloat-
linux-gnu

> and I can select it but
>
> CHOST=powerpc-softfloat-linux-gnu \
> ROOT=/usr/powerpc-softfloat-linux-gnu \
> binutils-config -l
>
> Using binutils-config info in /usr/powerpc-softfloat-linux-gnu/
> [1] powerpc-softfloat-linux-gnu-2.16.1 *
>
> Only shows 2.16.1

these are toolchains in ROOT=/usr/powerpc-softfloat-linux-gnu/

[1] is probably: CHOST=powerpc-softfloat-linux-gnu CTARGET=powerpc-softfloat-
linux-gnu
-mike
Re: crossdev builds libiberty.a with host arch [ In reply to ]
Mike Frysinger wrote:
> > $ binutils-config -l
> > [1] i686-pc-linux-gnu-2.20.1 *
> >
> > [2] powerpc-softfloat-linux-gnu-2.16.1
> > [3] powerpc-softfloat-linux-gnu-2.18 *
>
> these are toolchains in ROOT=/
>
> [1] is probably: CHOST=i686-pc-linux-gnu CTARGET=i686-pc-linux-gnu
> [2] and [3] is probably: CHOST=i686-pc-linux-gnu CTARGET=powerpc-softfloat-
> linux-gnu
>
> > CHOST=powerpc-softfloat-linux-gnu \
> > ROOT=/usr/powerpc-softfloat-linux-gnu \
> > binutils-config -l
> >
> > Using binutils-config info in /usr/powerpc-softfloat-linux-gnu/
> > [1] powerpc-softfloat-linux-gnu-2.16.1 *
>
> these are toolchains in ROOT=/usr/powerpc-softfloat-linux-gnu/
>
> [1] is probably: CHOST=powerpc-softfloat-linux-gnu CTARGET=powerpc-softfloat-
> linux-gnu

Does anyone have ideas for how to visualize this nicely? The tuples
are kinda long and will not really fit on every line.. :\


//Peter