cross compiler for solaris - success -well, kinda, I think

Gianni Mariani gmariani@chaincast.com
Sun Aug 4 20:08:00 GMT 2002


woo hoo ... I build a cross compiler for solaris hosted on RH Linux.

So, I had to 'fix' a bunch of stuff - I probably broke a bunch o stuff 
too ...

I've attached a patch file that I created using :

diff -Naur gcc-3.1.1 gcc-3.1.1-fixed > gcc-3.1.1-patch

I've also created a Makefile that does almost everything for anyone else 
who wants to give it a go.

So the problems were:

a)
So, the first thing was sol2-bi.h - I have no idea what this stuff does 
but it had some absolute paths that seem happy if their converted to 
relative paths.  Otherwise the linker gets all upset about not being 
able find certain objs.  (thanks to Jeff Sturm)

b)
gcc/fixproto was changed to ignore errors from gcc/fix-header - because 
of a SEGV on exit (only on RH7.3) in free_chunk after calling exit(). 
 When I tried to debug this by using efence the problem went away.  It 
seems there is a memory corruption problem with fix-header - if someone 
has purify - give it a go. (not all headers had problems - just some 
headers - always the same error for the respective header but also 2 
different kinds of failures).  Ignoring the error seemed sufficeint 
since it was obviously dying just before exit in system run-time linker 
code.  Any more help I can give here, let me know, it seems that 
fix-header was built with a gcc3.1.1 compiler on RH7.3 .

c)
ctype problems - it seems like the wrong ctype was coming through 
(config/os/newlib).  I fixed this by adding a case to 
gcc-3.1.1-fixed/libstdc++-v3/configure and new files in 
solaris/solaris2.8/bits.  I'm not sure if it was the right thing to do 
but it seems like it worked.  I probably left some cruft in 
gcc-3.1.1-fixed/libstdc++-v3/configure ...

d)
cwchar ended up getting mbstate_t multiply defined.  I think this was a 
problem with expecting a glibc header, I added a new condition to the 
ifdef around the std_cwchar.h files.

e)
libiberty did not get a Makefile after configuration - I don't think I 
needed it so I created an empty sparcv9/libiberty/Makefile with empty 
all: and install: rules.  I have no idea what the right(tm) thing is to 
do here.

f)
It seems I could not build a static version of the libraries, it seems 
the loader was told to go load the wrong ld.so, I gave up on static linking.

So I read through most of the docs - is it really so hard ?

Is there a standard cross compiler test suite that's run for regression 
tests ?

Now I go and see if I can actually use the compiler - I was at least 
able to build a c++ Hello World program and it ran like a champ.

Regards
G


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc-3.1.1-patch
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20020804/c4e6b8cb/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile.gcc_x
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20020804/c4e6b8cb/attachment-0001.ksh>


More information about the Gcc mailing list