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: Problems of cross-compiling SPEC2000 using GNUpro


Tao Zhang <zhangtao@cc.gatech.edu> wrote:

> I tried xscale-unknown-linux-gnu, it is not supported by newlib.

 The Linux support in newlib is similar as Windows support in GCC...
For most people Linux and Windows are opsyses for a PC with a i386
compatible CPU meanwhile WinNT/PPC, WinNT/MIPS and WinNT/Alpha are
never heard about, neither are Linux/PPC, Linux/ARM, Linux/MIPS etc.

 So if someone tells you that "newlib is ported for Linux", please
think what people are thinking the "Linux" means for the majority...

 AFAIK nobody has ported newlib for Linux/ARM, Linux/MIPS, Linux/PPC,
Linux/m68k, Linux/Alpha, Linux/Sparc, Linux/SH,... whatever there then
are. The only C library choice for Linuxes is glibc...

> I tried arm-unknown-linux-gnu too, it doesn't work either. It seems
> the compilation system is looking for glib rather than newlib.

 So your best bet is to use glibc as the C library... You can 'bootstrap'
your 'xscale-linux-gnu' target toolchain using a prebuilt glibc for some
'arm-linux-gnu' toolchain available on the net just as you can use a
'i386-linux-gnu' target glibc to bootstrap a 'i686-linux-gnu' target
toolchain. Or try those scripts from Dan & Co.

 In order to get the 'xscale' CPU recognized in the configury system, you
must learn some basics from those 'config.sub' and 'gcc/config.gcc' scripts,
so you can fix these to accept the 'xscale' as an alias for 'arm' with some
special needs ('-msoft-float' as default while 'arm' has '-mhard-float' and
such). You can start your homework with studying how the 'xscale-elf' config
entry in 'gcc/config.gcc' differs from the 'arm-elf', which config headers
are read instead of those for 'arm-elf'...

 Ok, a config entry for 'xscale-linux-gnu' wasn't present in my latest
'gnupro-xscale-20020523' (gcc-3.1-xscale) sources (are there newer ones now?).
Anyhow I tried this target with my gcc-3.2.3 sources and had patched them as
follows:

--------------------------- clip -------------------------------------------
xscale-*-coff)
	tm_file="arm/semi.h arm/aout.h arm/coff.h arm/xscale-coff.h arm/arm.h"
	tmake_file=arm/t-xscale-coff
	out_file=arm/arm.c
	md_file=arm/arm.md
	;;
xscale*-*-linux*)	# XScale GNU/Linux with ELF
	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/xscale-linux.h"
	tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
	gnu_ld=yes
	case x${enable_threads} in
	x | xyes | xpthreads | xposix)
		thread_file='posix'
		;;
	esac
	;;
xstormy16-*-elf)
--------------------------- clip -------------------------------------------

The added 'gcc/config/arm/xscale-linux.h' (modified from the one for
'arm-linux-gnu': 'linux-elf.h') has been attached...

There already is some support for using:

  --target=arm-linux-gnu --with-cpu=xscale

(and for other ARM CPU-types too) in the 'gcc/config.gcc' :

--------------------------- clip -------------------------------------------
arm*-*-* | strongarm*-*-* | xscale-*-*)
	case "x$with_cpu" in
		x)
			# The most generic
			target_cpu_default2="TARGET_CPU_generic"
			;;

		# Distinguish cores, and major variants
		# arm7m doesn't exist, but D & I don't affect code
		xarm[236789] | xarm250 | xarm[67][01]0 \
		| xarm7m | xarm7dm | xarm7dmi | xarm[79]tdmi \
		| xarm7100 | xarm7500 | xarm7500fe | xarm810 \
		| xxscale \
		| xstrongarm | xstrongarm110 | xstrongarm1100)
			target_cpu_default2="TARGET_CPU_$with_cpu"
			;;

		xyes | xno)
			echo "--with-cpu must be passed a value" 1>&2
			exit 1
			;;

		*)
			if test x$pass2done = xyes
			then
				echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
				exit 1
			fi
			;;
	esac
	;;
--------------------------- clip -------------------------------------------

 So the basic know-how about this script being the main one for GCC and
knowing how to search strings like 'xscale' in an editor leads quite far...

 Anyhow separating the 'xscale-linux-gnu' (like 'xscale-elf' and 'xscale-coff')
from the 'arm-' one sounded better than just using a fake 'arm-linux-gnu' name.

 If recognizing the CPU name 'xscale' in 'config.sub' is missing (not expected
because 'xscale-elf/coff' should work), that will be left as homework...

 The case for the 'athlon_xp-linux-gnu' target was quite similar despite of this
AMD-CPU being much more common in recently sold PCs than those P-IV's...

 Ok, one can build a complete toolchain for 'xscale-linux-gnu' for free, and one
can build the kernel etc. for Linux/XScale also for free, but getting the XScale
HW for free is not that easy...  So where you are going to try the SPEC2000 tests
if not having the HW itself?  With the '-elf' and '-coff' one has the ARM-simulator
in GDB, but with Linux this way doesn't work...

Cheers, Kai





The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  xscale-linux.h
     Date:  1 Sep 2003, 13:53
     Size:  4430 bytes.
     Type:  Program-source

Attachment: xscale-linux.h
Description: Binary data

------
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]