This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Targetting Sparc/Solaris


Sam Brightman wrote:
> The differences I have from you are that I'm building for Solaris 2.9
> and using full gcc (for C++) support. 

I found including C++ support made building the cross compilers way more
trouble and for many platforms I gave up trying to solve all the
attendant problems.  But then I could do this because our code is C.

> Since I was building from Solaris
> 2.11 (Nexenta A7) I initially tried to skip the library/header copy
> stuff and mess around with the tree. This just led to trouble (PATH_MAX
> stuff: not fixed by the patch in crosstools), so I've gone with pretty
> much exactly as you wrote.

If you want your binary to run on Solaris 2.9 you can't link with a libc
from e.g. 2.11.  Newer libc symbols will get referenced in your app that
won't resolve on an older libc.

> I have
> to leave for the day now, but wondering if the cause of this libc.so
> link problem is immediately obvious to anyone? 
...
> Here is the tail of the build log:
> 
> /mnt/build/xgcc-4.1-build/sparc-sun-solaris2.9/gcc/./gcc/xgcc
> -B/mnt/build/xgcc-4.1-build/sparc-sun-solaris2.9/gcc/./gcc/
> -B/mnt/build/xgcc-4.1/sparc-sun-solaris2.9/sparc-sun-solaris2.9/bin/
> -B/mnt/build/xgcc-4.1/sparc-sun-solaris2.9/sparc-sun-solaris2.9/lib/
...
> -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc/./libgcc.map -o
> ./libgcc_s.so.1.tmp  libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o
...
> /mnt/build/xgcc-4.1/sparc-sun-solaris2.9/bin/sparc-sun-solaris2.9-ld:
> skipping incompatible /usr/lib/libc.so when searching for -lc
> /mnt/build/xgcc-4.1/sparc-sun-solaris2.9/bin/sparc-sun-solaris2.9-ld:
> cannot find -lc

Following the notes I had, you should have a solaris 2.9 libc under
/mnt/build/xgcc-4.1/sparc-sun-solaris2.9/sparc-sun-solaris2.9/usr/lib/

E.g. on my system:

> $ ls -l /xgcc-4.1/sparc-sun-solaris2.8/sparc-sun-solaris2.8/usr/lib/libc.*
> -rw-r--r--  1 nathan staff 1788084 Dec  9  2002 libc.a
> lrwxrwxrwx  1 nathan staff      11 Oct  5  2006 libc.so -> ./libc.so.1
> -rwxr-xr-x  1 nathan staff 1157888 Dec  9  2002 libc.so.1

Questions to ask yourself:

1. Do you have the proper libc in that location?
2. Does your build try looking in that location? (e.g. use 'truss' to
find out what which libc.so files sparc-sun-solaris2.9-ld tries to open).


-Nathan


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]