Alpha Cross compiler

Mahshid Sedghi mahshid.sedghy@gmail.com
Thu Mar 7 20:11:00 GMT 2013


Hello.

I actually have no question for you this time. Instead, I just want to
give an update on the status of the problem I was facing. I finally
could get my cross compiled benchmarks to work on an alpha image. As
you mentioned, I used "-static" option for gcc, and also used "-L"
followed by the path to the static libraries of the cross compiler.
Initially I had problems with glibc and libc versions, although I was
linking statically. So, I tried cross compiling on a machine whose gcc
and glibc was pretty close to the cross compiler's, and then it
worked.

Thanks for your help,
Mahshid


On Thu, Feb 14, 2013 at 12:21 AM, Mahshid Sedghi
<mahshid.sedghy@gmail.com> wrote:
>
> Thanks for your response. My application is a multi-threaded one, and
> when I use -static along with -v, it's showing me that on the first
> hand it's unable to find pthread library. I can see a lib folder in
> the cross compiler directory containing both shared objects and static
> versions of the libraries needed. Although I gave the path to to this
> folder using -L option, it still cannot find them!
>
>
>
> On Wed, Feb 13, 2013 at 3:13 PM, Jan-Benedict Glaw <jbglaw@lug-owl.de>
> wrote:
> > On Mon, 2013-02-11 14:41:29 -0500, Mahshid Sedghi
> > <mahshid.sedghy@gmail.com> wrote:
> >> Hello again,
> >>
> >> I actually replaced the inline assembly code with some c++ atomic
> >> operations such as "fetch_and_inc", and now I am able to cross compile
> >> the application for alpha. But when I run the binaries in the guest OS
> >> using an alpha image, I am getting the following errors:
> >>
> >> ./word_count: /lib/libc.so.6.1: version `GLIBC_2.4' not found
> >> (required by ./word_count)
> >> ./word_count: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.10' not
> >> found (required by ./word_count
> >>
> >> Even when I use static linking (using -static-libgcc), the problem
> >> still remains. For some reason, it seems that static linking does not
> >> work, and the application is trying to access those shared objects at
> >> runtime, but it is not found in the alpha disk image. Do you have any
> >> solution for this problem?
> >
> > Basically, the libc (and its headers) used for compilation needs to be
> > the same as on the target system, or older. So you should either use
> > the libc you just built along with the cross-compiler, or use your
> > target's headers to build with.
> >
> > For static linking, -static is the most important part. libgcc is
> > another component handled specifically. To see if a program uses
> > dynamically linked libs, you can use the `ldd' program to see what's
> > dynamically linked by the dynamic linker. (Another way is to use
> > readelf or objdump so peek into the binary.)
> >
> > MfG, JBG
> >
> > --
> >       Jan-Benedict Glaw      jbglaw@lug-owl.de
> > +49-172-7608481
> > Signature of:          GDB has a 'break' feature; why doesn't it have
> > 'fix' too?
> > the second  :
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.10 (GNU/Linux)
> >
> > iEYEARECAAYFAlEb8+IACgkQHb1edYOZ4buzzACfQJjl1dzbCc8ZSn5ARkGJ+6G1
> > UgEAnRB75KazpCAzTx6mEYy35+dcSfCt
> > =AJR7
> > -----END PGP SIGNATURE-----
> >

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list