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]
Other format: [Raw text]

Patch to get ia64-aix cross-compiling cc1


When cross-compiling from sparc-sun-solaris2.7 to ia64-unknown-aix, I
get the following error:

 > In file included from hconfig.h:9,
 >                  from gengenrtl.c:22:
 > config/ia64/aix.h:256:25: sys/machine.h: No such file or directory
 > make: *** [gengenrtl.o] Error 1

There is a hack in ia64/aix.h to handle the fact that on ia64-aix the
sys/machine.h header defines REG_SIZE which conflicts with gcc's copy
of that macro.  The problem is that this fix is only relevant on that
platform where sys/machine.h exists, not in the cross-compile case
when host/build != ia64-aix.

I think the right fix is to create an xm- file and move that hack
there.  Tested by cross-compiling cc1, however I would like some
confirmation that this is the right approach in the native case as
well.

Ok to install?

		Thanks,
		--Kaveh


2001-11-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* ia64/xm-aix.h: New file.
	* ia64/aix.h: Move REG_SIZE hack to ia64/xm-aix.h.
	* config.gcc (ia64*-*-aix*): Set xm_file to ia64/xm-aix.h.

diff -rup orig/egcs-CVS20011111/gcc/config/ia64/aix.h egcs-CVS20011111/gcc/config/ia64/aix.h
--- orig/egcs-CVS20011111/gcc/config/ia64/aix.h	Fri Nov  9 23:36:29 2001
+++ egcs-CVS20011111/gcc/config/ia64/aix.h	Tue Nov 13 10:43:31 2001
@@ -251,11 +251,6 @@ extern unsigned int ia64_section_thresho
 #define WCHAR_TYPE "unsigned short"
 #endif
 
-/* Have to get rid of the system's definition so that we can use gcc's
-   instead. */
-#include <sys/machine.h>
-#undef REG_SIZE
-
 /* Define the `__builtin_va_list' type for AIX.  Use char* b/c that's what the
    system headers expect.  */
 #define BUILD_VA_LIST_TYPE(VALIST) \
diff -rup orig/egcs-CVS20011111/gcc/config/ia64/xm-aix.h egcs-CVS20011111/gcc/config/ia64/xm-aix.h
--- orig/egcs-CVS20011111/gcc/config/ia64/xm-aix.h	Tue Nov 13 10:46:47 2001
+++ egcs-CVS20011111/gcc/config/ia64/xm-aix.h	Tue Nov 13 10:43:36 2001
@@ -0,0 +1,25 @@
+/* Definitions of target machine GNU compiler.  IA-64/AIX version.
+   Copyright (C) 2001 Free Software Foundation, Inc.
+   Contributed by Timothy Wall (twall@cygnus.com)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Have to get rid of the system's definition so that we can use gcc's
+   instead. */
+#include <sys/machine.h>
+#undef REG_SIZE
diff -rup orig/egcs-CVS20011111/gcc/config.gcc egcs-CVS20011111/gcc/config.gcc
--- orig/egcs-CVS20011111/gcc/config.gcc	Tue Nov 13 10:47:48 2001
+++ egcs-CVS20011111/gcc/config.gcc	Tue Nov 13 10:42:31 2001
@@ -1527,6 +1527,7 @@ i960-*-*)			# Default i960 environment.
 	cxx_target_objs="i960-c.o"
 	;;
 ia64*-*-aix*)
+	xm_file=ia64/xm-aix.h
 	tm_file="${tm_file} elfos.h svr4.h ia64/sysv4.h ia64/aix.h"
 	tmake_file="ia64/t-ia64 ia64/t-aix"
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"



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