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]

Re: crosscompiler x86->solaris2.8


Per Fransson wrote:
> 
> I've been trying to build a cross-compiler for sparc-sun-solaris2.8 on
> an x86 running linux. No matter what I do I get the same error message.
> I start by building binutils with sparc-sun-solaris2.8 as target into
> $prefix (=foo/myGCC). That works fine. Then I put the /usr/include tree
> from solaris into foo/myGCC/sparc-sun-solaris2.8/sys-include/

 Please check what the aim for the '$prefix/$target/sys-include' is, and
what for the '$prefix/$target/include'...

 RTFM, "Standard Header Directories"...

 Ok, the 'limits.h' and 'math.h' must be symlinked into the 'sys-include'
during the build because of the current mess with the 'SYSTEM_INCLUDE_DIR'
and 'STANDARD_INCLUDE_DIR', ie. someone not knowing these not being the same...

 RTFM for these ignorant people too:

------------------ clip --------------------------------------
SYSTEM_INCLUDE_DIR
	Define this macro as a C string constant if you wish to specify
	a system-specific directory to search for header files before the
	standard directory.
	SYSTEM_INCLUDE_DIR comes before STANDARD_INCLUDE_DIR in the search
	order.

STANDARD_INCLUDE_DIR
	Define this macro as a C string constant if you wish to override
	the standard choice of /usr/include as the default prefix to try
	when searching for header files.
------------------ clip --------------------------------------

 Please check with the resulted 'cpp0', using './cpp0 -v', what the search
order is with the 'sys-include' and the 'include' in your cross-compiler...

 A little bit more standardization for this issue would be needed...

> foo/build-gcc/gcc/xgcc -Bfoo/build-gcc/gcc/ -Bfoo/myGCC//sparc-sun-solaris2.8/bin/

 Putting a '/' in the end of $prefix is an error, then one gets these double '/'s...

> -Wl,-h,libgcc_s.so.1 -Wl,-z,text -Wl,-z,defs -Wl,-M,libgcc.map -o libgcc_s.so
                                               #################
> foo/myGCC//sparc-sun-solaris2.8/bin/ld:libgcc.map: file format not recognized;
> treating as linker script
> foo/myGCC//sparc-sun-solaris2.8/bin/ld:libgcc.map:1: parse error

 As I have told it many times on this list, everybody should learn to use
the '--help' option with the GNU tools as an on-line manual :

------------------ clip --------------------------------------
H:\usr\local\sparc-solaris2.7\bin>ld --help
Usage: ld [options] file...
Options:
  -a KEYWORD                  Shared library control for HP/UX compatibility
<snip>
  -m EMULATION                Set emulation
  -M, --print-map             Print map file on standard output
  -n, --nmagic                Do not page align data
  -N, --omagic                Do not page align data, do not make text readonly
  -o FILE, --output FILE      Set output file name
------------------ clip --------------------------------------

 If we see the GCC-option '-Wl,-M,libgcc.map', which gives the options/parameters
'-M libgcc.map' to the linker, the '-M' will be understood as an option, while the
'libgcc.map' will be understood as a parameter for the linker, not to the option
'-M'. The '-M' uses no parameter while the '-m' has the 'EMULATION', the '-o' the
'FILE' and so on...

 So this is clearly a bug in the GCC sources, please report it...

 Meanwhile you can try to find where this comes from, the 'gcc/configure.in' could
be the obvious place to have the bug... Search for settings for 'solaris2' there.
But the quick workaround would be to edit this away from the '$build/gcc/libgcc.mk'.

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]