Configuring new target
Alexandre Courbot
Alexandre.Courbot@lifl.fr
Wed Apr 16 10:12:00 GMT 2003
> I am trying to configure GCC 3.2.2 to recognise a new target called NPE.
> I have written the machine description files and placed them in a
> subdirectory(called NPE) of the config directory. I realise that i need to
> modify gcc/configure.in (the input file for the configure script) and also
> the the config.sub file. However I am not sure of how exactly to go about
> this. Do I need to modify any other files? What should I put in the
> conigure.in and the configure.sub files. Is it recommened to use autoconf?
Hi,
Here is how I did to get my target (named camille for reference in the patches
below) to build. There are two files you need to slightly modify: config.sub
and gcc/config.gcc. You don't need to change configure.in AFAIK.
In config.sub you need a add an entry for your target, so it is recognized by
the configure phase. Here is the diff for my target:
*** gcc-3.2.2/config.sub 2003-02-10 13:34:25.000000000 +0100
--- gcc-3.2.2-camille/config.sub 2003-03-07 17:29:42.000000000 +0100
***************
*** 1052,1055 ****
--- 1052,1057 ----
basic_machine=powerpc-apple
;;
+ camille)
+ ;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
gcc/config.gcc let you add entries so your target is recognized by gcc. You
can also specify additional target objects to be built and do many other
interesting things by setting some variables. The beginning of the file is
very informative regarding this. If your backend is made of the classic 3
files (target.h, target.c and target.md) then something like the following is
fine:
*** gcc-3.2.2/gcc/config.gcc 2003-02-10 13:34:21.000000000 +0100
--- gcc-3.2.2-camille/gcc/config.gcc 2003-02-11 14:40:46.000000000 +0100
***************
*** 288,291 ****
--- 288,294 ----
cpu_type=`echo $machine | sed 's/-.*$//'`
case $machine in
+ camille*-*-*)
+ cpu_type=camille
+ ;;
alpha*-*-*)
cpu_type=alpha
***************
*** 3434,3437 ****
--- 3437,3443 ----
gas=yes gnu_ld=yes
;;
+ camille-*)
+ ;;
+
*)
echo "Configuration $machine not supported" 1>&2
Then, you can specify your new target to the configure script with --target.
As an example, here is my configure line from the build directory:
../gcc-3.2.2-camille/configure --target=camille --host=i686-pc-linux-gnu
--program-prefix=camille --enable-languages=c --disable-nls --enable-checking
Maybe you'll be interesting in the technical report of my own port. The
information is certainly not 100% correct, but I've roughly logged my
experiences with this first port:
http://www.lifl.fr/~courbot/TR_GCC4Camille.ps.gz
Hope this helps, have fun! ;)
Alex.
More information about the Gcc-help
mailing list