ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] Sourcery G++ Lite 2010.09-55 for Power GNU/Linux toolchain


From: Stuart Hughes
Subject: Re: [Ltib] Sourcery G++ Lite 2010.09-55 for Power GNU/Linux toolchain
Date: Tue, 26 Jul 2011 08:46:52 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11

Hi Aaron,

Could you post the "gcc" -v output from the attempt to build helloworld?

It may be worth asking on the gcc mailing list why there is a difference in behaviour between 32 and 64 bit hosts.

* Are you running exactly the same toolchain on both? (or is one built for 64 bit and one for 32 bit?)

Regards, Stuart

Regards, Stuart

On 25/07/11 16:53, Aaron Wegner wrote:
Hi Stuart.  I added your debug line to the spoof_wrapper file and it
prints out "rootfs stating area: /home/aaron/ltib/rootfs" as expected.
The new toolchain is definitely not liking the -B flag for some reason.
My attempt to build vim is below.  The helloworld package reports the
exact same error: it can't link executables.  Works fine in Fedora 32 bit,
just not in a 64 bit version.

----

address@hidden ~/ltib/rpm/BUILD/vim62 Mon Jul 25 11:31:36]
$ cat src/auto/config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:616: checking whether make sets ${MAKE}
configure:646: checking for gcc
configure:759: checking whether the C compiler (gcc  ) works
configure:775: gcc -o conftest    conftest.c  1>&5
rootfs stating area: /home/aaron/ltib/rootfs
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
cannot find /lib/libc.so.6
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
cannot find /usr/lib/libc_nonshared.a
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
cannot find /lib/ld.so.1
collect2: ld returned 1 exit status
configure: failed program was:

#line 770 "configure"
#include "confdefs.h"

main(){return(0);}

----

Editing /opt/ltib/usr/spoof/spoof_wrapper in the following way fixes
things and I am able to link.

#    @srch  = ('-B', "$ENV{DEV_IMAGE}/usr/lib//",
     @srch  = ("-Wl,-L$ENV{DEV_IMAGE}/usr/lib//", # fixes 64-bit Fedora

Don't know if anyone else has seen this with the LTIB and a 64-bit
GNU/Linux distro.


Thanks again,

Aaron


Hi Aaron,

It's a while since I looked at this, but the -B switch, does pretty much
the same thing are your direct version.  The odd looking trailing // is
necessary as otherwise (much) older toolchains will fail (it's a bug in
the toolchains).

Once possibility is that for some reason the environment variable:
DEV_IMAGE does not get set properly, which would explain accessing
/usr/lib.  Alternately maybe the the path is not found using -B.

Unfortunately I don't have time to look into this at the moment.  Could
you try the following:

Put the code back as it was, but add:
        print "rootfs stating area: $ENV{DEV_IMAGE}\n";
near the top of the spoof_wrapper file.

If that looks okay, can you try building the helloworld test rpm with -v
added to the compiler line, along the lines of:

./ltib -p helloworld -m prep

Edit rpm/BUILD/helloworld-1.1/Makefile and change the line:

CFLAGS   = -Wall
to:
CFLAGS   = -Wall -v

and then run:
./ltib -p helloworld 2>&1 | tee helloworld_log.txt

If you look at the file you may be able to see whether the right paths
are being found for the linking.

Regards, Stuart


On 14/07/11 22:50, Aaron Wegner wrote:
I downloaded the latest CodeSourcery G++ Lite toolchain from their site
and popped it into the LPP.

/opt/ltib/pkgs/freescale-powerpc-linux-gnu-2010.09-55.i686.rpm

This RPM works fine with my 32-bit Fedora 12 development workstation.
In
my defconfig.dev I have:

CONFIG_TOOLCHAIN="freescale-powerpc-linux-gnu-2010.09-55.i686.rpm"
CONFIG_TOOLCHAIN_PATH="/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu"
CONFIG_TOOLCHAIN_PREFIX="powerpc-linux-gnu-"
CONFIG_TOOLCHAIN_CFLAGS="-msoft-float -mcpu=860"

However, when I try the same on my 64-bit Fedora 15 development
workstation I find that I'm not able to link.  It bails with linker
errors
such as:

----
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
cannot find /lib/libc.so.6
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
cannot find /usr/lib/libc_nonshared.a
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/../../../../powerpc-linux-gnu/bin/ld:
cannot find /lib/ld.so.1
collect2: ld returned 1 exit status
----

I poked around a little and found that if I edit the gcc spoof source
found in

/opt/ltib/usr/spoof/gcc

and put in the following hack around line 46

#    @srch  = ('-B', "$ENV{DEV_IMAGE}/usr/lib//",
     @srch  = ("-Wl,-L/home/aaron/ltib/rootfs/usr/lib//",

that all my programs compile and link like normal.  Is this a product of
the toolchain?  Is there a workaround that is an easy fix, or is this a
more difficult issue?


Thanks,

Aaron


_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/ltib





reply via email to

[Prev in Thread] Current Thread [Next in Thread]