Porting GCC to 8051

Denis Chertykov denisc@overta.ru
Wed Mar 15 01:39:00 GMT 2000


Jeffrey A Law <law@cygnus.com> writes:

> http://www.cygnus.com		http://www.cygnus.com/egcs
> 
>   In message < 38CEBA06.380F26F6@web.de >you write:
>   > =
> 
>   > #define TARGET_INT16    (target_flags & 1)
>   > =
> 
>   > #define INT_TYPE_SIZE        (TARGET_INT16 ? 16 : 8)
>   > =
> 
>   > but I got a error when linking cccp, because target_flags are there n=
> ot
>   > available.
>   > =
> 
>   >         cc -DCROSS_COMPILE -DIN_GCC   -g   -o cccp cccp.o cexp.o \
>   >           version.o obstack.o ` case "cc" in "cc") echo "" ;; esac `
>   >         cccp.o: In function `special_symbol':
>   >         /gnu/gcc-2.7.2.3/cccp.c:4145: undefined reference to
>   > `target_flags'
>   >         cccp.o: In function `initialize_builtins':
>   >         /gnu/gcc-2.7.2.3/cccp.c:9655: undefined reference to
>   > `target_flags'
>   >         cexp.o: In function `yylex':
>   >         /gnu/gcc-2.7.2.3/cexp.y:596: undefined reference to
>   > `target_flags'
>   > =
> 
>   > In the Target Description of pdp11 (pdp11.h) I=B4ve seen such a defin=
> ition
>   > and it works fine.
> See the MAX_*_TYPE_SIZE macros.

You must define `NO_BUILTIN_SIZE_TYPE' and `NO_BUILTIN_PTRDIFF_TYPE'.
This works for gcc-2.95.2

`NO_BUILTIN_SIZE_TYPE'
     If this macro is defined, the preprocessor will not define the
     builtin macro `__SIZE_TYPE__'.  The macro `__SIZE_TYPE__' must
     then be defined by `CPP_SPEC' instead.

     This should be defined if `SIZE_TYPE' depends on target dependent
     flags which are not accessible to the preprocessor.  Otherwise, it
     should not be defined.

`NO_BUILTIN_PTRDIFF_TYPE'
     If this macro is defined, the preprocessor will not define the
     builtin macro `__PTRDIFF_TYPE__'.  The macro `__PTRDIFF_TYPE__'
     must then be defined by `CPP_SPEC' instead.

     This should be defined if `PTRDIFF_TYPE' depends on target
     dependent flags which are not accessible to the preprocessor.
     Otherwise, it should not be defined.

Denis.



More information about the Gcc mailing list