This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Patch to fix i960 build


Currently attempting to build a i960 cross-compiler results in:

gcc -DCROSS_COMPILE -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H  -o f771 f/bad.o f/bit.o f/bld.o f/com.o f/data.o f/equiv.o f/expr.o f/global.o f/implic.o f/info.o f/intrin.o f/lab.o f/lex.o f/malloc.o f/name.o f/parse.o f/proj.o f/src.o f/st.o f/sta.o f/stb.o f/stc.o f/std.o f/ste.o f/storag.o f/stp.o f/str.o f/sts.o f/stt.o f/stu.o f/stv.o f/stw.o f/symbol.o f/target.o f/top.o f/type.o f/version.o f/where.o main.o libbackend.a obstack.o       ../libiberty/libiberty.a
Undefined			first referenced
 symbol  			    in file
c_lex                               libbackend.a(i960.o)
ld: fatal: Symbol referencing errors. No output written to f771

This patch implements the same approach to the problem as used
in the c4x port.

ChangeLog:

Wed Mar 14 00:03:46 EST 2001  John Wehle  (john@feith.com)

	* i960.c (c_lex_func): New variable.
	(i960_pr_align, i960_pr_noalign): Use it.
	(i960_init_pragma): New function.
	* i960.h (REGISTER_TARGET_PRAGMAS): Call it.
	* i960-protos.h (c4x_init_pragma): New prototype.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/i960/i960.c.ORIGINAL	Thu Sep  7 18:24:33 2000
--- gcc/config/i960/i960.c	Tue Mar 13 23:45:55 2001
*************** static int ret_label = 0;
*** 91,96 ****
--- 91,105 ----
  
  /* Handle pragmas for compatibility with Intel's compilers.  */
  
+ static int (*c_lex_func) (tree *);
+ 
+ void
+ i960_init_pragma (get_token)
+   int (*get_token) PARAMS ((tree *));
+ {
+   c_lex_func = get_token;
+ }
+ 
  /* NOTE: ic960 R3.0 pragma align definition:
  
     #pragma align [(size)] | (identifier=size[,...])
*************** i960_pr_align (pfile)
*** 116,124 ****
    enum cpp_ttype type;
    int align;
  
!   type = c_lex (&number);
    if (type == CPP_OPEN_PAREN)
!     type = c_lex (&number);
    if (type == CPP_NAME)
      {
        warning ("sorry, not implemented: #pragma align NAME=SIZE");
--- 125,133 ----
    enum cpp_ttype type;
    int align;
  
!   type = c_lex_func (&number);
    if (type == CPP_OPEN_PAREN)
!     type = c_lex_func (&number);
    if (type == CPP_NAME)
      {
        warning ("sorry, not implemented: #pragma align NAME=SIZE");
*************** i960_pr_noalign (pfile)
*** 159,167 ****
    enum cpp_ttype type;
    tree number;
  
!   type = c_lex (&number);
    if (type == CPP_OPEN_PAREN)
!     type = c_lex (&number);
    if (type == CPP_NAME)
      {
        warning ("sorry, not implemented: #pragma noalign NAME");
--- 168,176 ----
    enum cpp_ttype type;
    tree number;
  
!   type = c_lex_func (&number);
    if (type == CPP_OPEN_PAREN)
!     type = c_lex_func (&number);
    if (type == CPP_NAME)
      {
        warning ("sorry, not implemented: #pragma noalign NAME");
*** gcc/config/i960/i960-protos.h.ORIGINAL	Thu Sep  7 18:24:33 2000
--- gcc/config/i960/i960-protos.h	Tue Mar 13 23:47:29 2001
*************** extern void i960_function_epilogue PARAM
*** 107,112 ****
--- 107,113 ----
  extern void i960_scan_opcode PARAMS ((const char *));
  
  #ifdef _C_PRAGMA_H
+ extern void i960_init_pragma PARAMS ((int (*) (tree *)));
  extern void i960_pr_align PARAMS ((cpp_reader *));
  extern void i960_pr_noalign PARAMS ((cpp_reader *));
  #endif
*** gcc/config/i960/i960.h.ORIGINAL	Thu Mar  1 22:41:20 2001
--- gcc/config/i960/i960.h	Wed Mar 14 00:01:02 2001
*************** Boston, MA 02111-1307, USA.  */
*** 134,139 ****
--- 134,140 ----
  #define REGISTER_TARGET_PRAGMAS(PFILE) do {			\
    cpp_register_pragma (PFILE, 0, "align", i960_pr_align);	\
    cpp_register_pragma (PFILE, 0, "noalign", i960_pr_noalign);	\
+   i960_init_pragma (&c_lex);					\
  } while (0)
  
  /* Run-time compilation parameters selecting different hardware subsets.  */
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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