[kaffe] CVS kaffe (robilad): fixed build failure with jit on arm-linux

Kaffe CVS cvs-commits at kaffe.org
Sat Feb 2 14:16:07 PST 2008


PatchSet 7735 
Date: 2008/02/02 22:12:26
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
fixed build failure with jit on arm-linux

2008-02-02  Dalibor Topic  <robilad at kaffe.org>

        Fixed build with arm-linux-oabi-jit and arm-linux-eabi-jit.
        Reported by:  Robert Schuster  <robertschuster at fsfe.org>

        * config/Makefile.am (EXTRA_DIST): Added arm/linux/linux-eabi.h
        and arm/linux/linux-gas.h.

        * config/arm/linux/linux-eabi.h,
        onfig/arm/linux/linux-gas.h: New files, imported from GCC.

        * config/arm/linux/md.c: Include linux-eabi.h when using EABI
        and linux-gas otherwise for cache flushing code.
        (flish_dcache) Use CLEAR_INSN_CACHE.

Members: 
	ChangeLog:1.5235->1.5236 
	config/Makefile.am:1.76->1.77 
	config/Makefile.in:1.257->1.258 
	config/arm/linux/linux-eabi.h:INITIAL->1.1 
	config/arm/linux/linux-gas.h:INITIAL->1.1 
	config/arm/linux/md.c:1.9->1.10 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.5235 kaffe/ChangeLog:1.5236
--- kaffe/ChangeLog:1.5235	Sat Feb  2 16:25:49 2008
+++ kaffe/ChangeLog	Sat Feb  2 22:12:26 2008
@@ -1,5 +1,20 @@
 2008-02-02  Dalibor Topic  <robilad at kaffe.org>
 
+	Fixed build with arm-linux-oabi-jit and arm-linux-eabi-jit.
+	Reported by:  Robert Schuster  <robertschuster at fsfe.org>
+
+	* config/Makefile.am (EXTRA_DIST): Added arm/linux/linux-eabi.h
+	and arm/linux/linux-gas.h.
+
+	* config/arm/linux/linux-eabi.h,
+	onfig/arm/linux/linux-gas.h: New files, imported from GCC.
+	
+	* config/arm/linux/md.c: Include linux-eabi.h when using EABI
+	and linux-gas otherwise for cache flushing code.
+	(flish_dcache) Use CLEAR_INSN_CACHE.
+	
+2008-02-02  Dalibor Topic  <robilad at kaffe.org>
+
 	* kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:
 	Don't use __USE_GNU, use _GNU_SOURCE instead.
 
Index: kaffe/config/Makefile.am
diff -u kaffe/config/Makefile.am:1.76 kaffe/config/Makefile.am:1.77
--- kaffe/config/Makefile.am:1.76	Wed Jan  2 21:05:33 2008
+++ kaffe/config/Makefile.am	Sat Feb  2 22:12:31 2008
@@ -61,6 +61,8 @@
 	arm/jit3-arm.def \
 	arm/jit3-icode.h \
 	arm/linux/config.frag \
+	arm/linux/linux-eabi.h \
+	arm/linux/linux-gas.h \
 	arm/linux/jit-md.h \
 	arm/linux/jit3-md.h \
 	arm/linux/md.c \
Index: kaffe/config/Makefile.in
diff -u kaffe/config/Makefile.in:1.257 kaffe/config/Makefile.in:1.258
--- kaffe/config/Makefile.in:1.257	Sat Feb  2 15:58:12 2008
+++ kaffe/config/Makefile.in	Sat Feb  2 22:12:32 2008
@@ -327,6 +327,8 @@
 	arm/jit3-arm.def \
 	arm/jit3-icode.h \
 	arm/linux/config.frag \
+	arm/linux/linux-eabi.h \
+	arm/linux/linux-gas.h \
 	arm/linux/jit-md.h \
 	arm/linux/jit3-md.h \
 	arm/linux/md.c \
===================================================================
Checking out kaffe/config/arm/linux/linux-eabi.h
RCS:  /home/cvs/kaffe/kaffe/config/arm/linux/linux-eabi.h,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/config/arm/linux/linux-eabi.h	Sat Feb  2 22:16:06 2008
@@ -0,0 +1,87 @@
+/* Configuration file for ARM GNU/Linux EABI targets.
+   Copyright (C) 2004, 2005, 2006, 2007
+   Free Software Foundation, Inc.
+   Contributed by CodeSourcery, LLC   
+
+   This file is part of GCC.
+
+   GCC 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 3, or (at your
+   option) any later version.
+
+   GCC 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 GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+/* On EABI GNU/Linux, we want both the BPABI builtins and the
+   GNU/Linux builtins.  */
+#undef  TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() 		\
+  do 						\
+    {						\
+      TARGET_BPABI_CPP_BUILTINS();		\
+      LINUX_TARGET_OS_CPP_BUILTINS();		\
+    }						\
+  while (false)
+
+/* We default to a soft-float ABI so that binaries can run on all
+   target hardware.  */
+#undef  TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+
+/* We default to the "aapcs-linux" ABI so that enums are int-sized by
+   default.  */
+#undef  ARM_DEFAULT_ABI
+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
+
+/* Default to armv5t so that thumb shared libraries work.
+   The ARM10TDMI core is the default for armv5t, so set
+   SUBTARGET_CPU_DEFAULT to achieve this.  */
+#undef  SUBTARGET_CPU_DEFAULT
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
+
+/* TARGET_BIG_ENDIAN_DEFAULT is set in
+   config.gcc for big endian configurations.  */
+#undef  TARGET_LINKER_EMULATION
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
+#else
+#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
+#endif
+
+#undef  SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
+
+/* Use ld-linux.so.3 so that it will be possible to run "classic"
+   GNU/Linux binaries on an EABI system.  */
+#undef  GLIBC_DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
+
+/* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+   use the GNU/Linux version, not the generic BPABI version.  */
+#undef  LINK_SPEC
+#define LINK_SPEC LINUX_TARGET_LINK_SPEC
+
+/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
+   do not use -lfloat.  */
+#undef LIBGCC_SPEC
+
+/* Clear the instruction cache from `beg' to `end'.  This makes an
+   inline system call to SYS_cacheflush.  */
+#undef  CLEAR_INSN_CACHE
+#define CLEAR_INSN_CACHE(BEG, END)					\
+{									\
+  register unsigned long _beg __asm ("a1") = (unsigned long) (BEG);	\
+  register unsigned long _end __asm ("a2") = (unsigned long) (END);	\
+  register unsigned long _flg __asm ("a3") = 0;				\
+  register unsigned long _scno __asm ("r7") = 0xf0002;			\
+  __asm __volatile ("swi 0		@ sys_cacheflush"		\
+		    : "=r" (_beg)					\
+		    : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno));	\
+}
===================================================================
Checking out kaffe/config/arm/linux/linux-gas.h
RCS:  /home/cvs/kaffe/kaffe/config/arm/linux/linux-gas.h,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/config/arm/linux/linux-gas.h	Sat Feb  2 22:16:06 2008
@@ -0,0 +1,56 @@
+/* Definitions of target machine for GNU compiler.
+   ARM Linux-based GNU systems version.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2007
+   Free Software Foundation, Inc.
+   Contributed by Russell King  <rmk92 at ecs.soton.ac.uk>.
+
+   This file is part of GCC.
+
+   GCC 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 3, or (at your
+   option) any later version.
+
+   GCC 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 GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is how we tell the assembler that a symbol is weak.
+   GAS always supports weak symbols.  */
+
+/* Unsigned chars produces much better code than signed.  */
+#define DEFAULT_SIGNED_CHAR 0
+
+#undef  SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC  "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+#undef  SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef  PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+/* Use the AAPCS type for wchar_t, or the previous Linux default for
+   non-AAPCS.  */
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int")
+
+#undef  WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
+
+/* Clear the instruction cache from `beg' to `end'.  This makes an
+   inline system call to SYS_cacheflush.  */
+#define CLEAR_INSN_CACHE(BEG, END)					\
+{									\
+  register unsigned long _beg __asm ("a1") = (unsigned long) (BEG);	\
+  register unsigned long _end __asm ("a2") = (unsigned long) (END);	\
+  register unsigned long _flg __asm ("a3") = 0;				\
+  __asm __volatile ("swi 0x9f0002		@ sys_cacheflush"	\
+		    : "=r" (_beg)					\
+		    : "0" (_beg), "r" (_end), "r" (_flg));		\
+}
Index: kaffe/config/arm/linux/md.c
diff -u kaffe/config/arm/linux/md.c:1.9 kaffe/config/arm/linux/md.c:1.10
--- kaffe/config/arm/linux/md.c:1.9	Sun Jan 27 01:50:22 2008
+++ kaffe/config/arm/linux/md.c	Sat Feb  2 22:12:32 2008
@@ -10,13 +10,14 @@
  */     
                 
 #include "config.h"
-#include "md.h"
 #if defined(TRANSLATOR)
-#include "arm/jit.h"
-#endif
+#if defined(__ARM_EABI__)
+#include "linux-eabi.h"
+#else
+#include "linux-gas.h"
+#endif /* defined(__ARM_EABI__) */
+#endif /* defined(TRANSLATOR) */
 #include <malloc.h>
-#include <sched.h>
-#include <asm/unistd.h>
 
 void            
 init_md(void)
@@ -27,19 +28,7 @@
 }
 
 #ifdef TRANSLATOR
-/**
- * Shamelessly stolen from parrot... ([perl]/parrot/jit/arm/jit_emit.h arm_sync_d_i_cache)
- *
- * r2 should be zero for 2.4 (but it's ignored) so passing VM_EXEC (needed
- * for 2.6) should be okay.
- */
 void flush_dcache(void *start, void *end) {
-  __asm __volatile ("mov r0, %0\n"
-		    "mov r1, %1\n"
-		    "mov r2, #0\n"
-		    "swi " __sys1(__ARM_NR_cacheflush) "\n"
-		    : /* no return value */
-		    : "r" ((long)start), "r" ((long)end)
-		    : "r0","r1","r2");
+  CLEAR_INSN_CACHE(start, end);
 }
 #endif




More information about the kaffe mailing list