This is the mail archive of the crossgcc@sources.redhat.com 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]

(Fwd) Re: GCC 3.2 Linux to Solaris 7 failure


"Lew Newby Jr." <lnewby@cadence.com> wrote:

> I am building a 3.2 cross compiler for Solaris to be used on a Linux
> system.
> 
> I am using the following:
> binutils-2.13
> gcc-3.2
> 
> binutils configure with:
> ../binutils-2.13/configure --host=i686-pc-linux-gnu
> --target=sparc-sun-solaris2.7
> --prefix=/opt/GNU-cross -v

 Ok...

> --with-headers=/usr/local/sparc-sun-solaris2/include
> --with-libs=/usr/local/sparc-sun-solaris2/lib

 These are vain in the binutils-configure...
 
> gcc configure with:
> ../gcc-3.2/configure
> --with-gcc-version-trigger=/hm/lnewby/Cross-compile/gcc-3.2/gcc/version.c

 Why this option was needed?  Have you the sources splitted and a
modified 'version.c' being there?

> --host=i686-pc-linux-gnu --target=sparc-sun-solaris2.7
> --with-headers=/usr/local/sparc-sun-solaris2/include
> --with-libs=/usr/local/sparc-sun-solaris2/lib

 Why not simply preinstall the target headers&libs into your chosen
'$prefix/$target' (/opt/GNU-cross/sparc-sun-solaris2.7/...) ?

> --with-gnu-as --with-gnu-ld --prefix=/opt/GNU-cross
> 
> The gcc configures fine and builds fine until the use of fix-header. The
> following is an excert from the output.
> 
>   if [ -d /opt/GNU-cross/sparc-sun-solaris2.7/sys-include ] ; then \
>     /bin/sh ../../gcc-3.2/gcc/fixproto include include
> /opt/GNU-cross/sparc-sun-solaris2.7/sys-include; \
>
> fixproto: populating `include'
> fix-header: fixing curses.h
> ../../gcc-3.2/gcc/fixproto: line 282: 21587 Segmentation fault

 Haven't tried what happens when one lets the Solaris7 headers
being 'fixed' by the GCC-3.2.x build, but this doesn't look
promising at all... What I have tried is letting the newlib-1.10.0
headers being 'fixed' and then the 'time.h' and 'signal.h' will be
totally spoiled by the 'fixing' removing all spaces in these headers.
So the headers-fixing is buggy and one should avoid it as much as
possible, "Don't fix if it ain't broken!"...

 Using the '--with-headers=' causes all the target headers being
copied into the '/opt/GNU-cross/sparc-sun-solaris2.7/sys-include'
and then tried to be 'fixed'. The alternative and the 'normal'
method is to believe that the target headers are already suitable
for ISO C and so for GCC, and to put them into the suggested 
'$prefix/$target/include' (GCC-manual), ie. in your case into the:

  /opt/GNU-cross/sparc-sun-solaris2.7/include'

before the GCC-build. And copy only the 'math.h' and 'limits.h'
into the:

  /opt/GNU-cross/sparc-sun-solaris2.7/sys-include'

because the first really needs fixing for the 'struct exception' and
the second must be seen because of fixing the GCC's own 'limits.h'.

> I could use some help on this one. I have found a patch for cppexp.c but
> the code isn't even close to what the patch was to work on.

 It would be nice if the header-fixing could work, but as far as
I remember, it has always involved some troubles and the results
must be checked although it could pass without any errors... In
the Solaris2-cases the headers are well-known and the things needing
fixing in them too. So it is easier to put only the broken headers
for fixing and leave the unbroken ones away...

 The 'bug' in 'math.h' can also fixed manually with 'patch' and with
the following patch:

-------------- clip -------------------
*** math.bak	Tue Dec 28 19:26:13 1999
--- math.h	Tue Dec 28 21:12:03 1999
***************
*** 72,78 ****
--- 72,82 ----
  extern enum version _lib_version;
  #endif
  
+ #ifdef __cplusplus
+ struct __math_exception {
+ #else
  struct exception {
+ #endif
  	int type;
  	char *name;
  	double arg1;
***************
*** 183,189 ****
--- 187,197 ----
  /*
   * SVID
   */
+ #ifdef __cplusplus
+ extern int matherr __P((struct __math_exception *));
+ #else
  extern int matherr __P((struct exception *));
+ #endif
  
  /*
   * IEEE Test Vector
-------------- clip -------------------

 The target headers in a cross-GCC are only copies, not the
originals, so modifying them is not a big sin...

 So no target-header-fixing will be needed if fixing permanently
the 'math.h' for GCC. So only the 'limits.h' must be 'seen' in the
'sys-include', but it will not be 'fixed', the GCC's own one going
into:

  $prefix/lib/gcc-lib/$target/3.2/include

will then be fixed to '#include_next' the system's own 'limits.h'.

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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