[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#331216: gcc-3.4: Please add big-endian arm (armeb) support



Package: gcc-3.4
Version: 3.4.4-8
Severity: wishlist
Tags: patch

Attached is a patch for gcc-3.4 to add support for the armeb
architecture.  It's pretty similar to the corresponding patch
for gcc-4.0 that can be found in Bug#330730.


-- System Information:
Debian Release: 3.1
Architecture: armeb (armv5teb)
Kernel: Linux 2.6.13
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages gcc-3.4 depends on:
ii  binutils             2.16.1cvs20050902-1 The GNU assembler, linker and bina
ii  cpp-3.4              3.4.4-8             The GNU C preprocessor
ii  gcc-3.4-base         3.4.4-8             The GNU Compiler Collection (base 
ii  libc6                2.3.5-6             GNU C Library: Shared libraries an
ii  libgcc1              1:4.0.1-8           GCC support library

-- no debconf information
--- gcc-3.4-3.4.4/debian/rules2.orig	2005-09-23 17:12:32.000000000 +0000
+++ gcc-3.4-3.4.4/debian/rules2	2005-09-23 17:12:40.000000000 +0000
@@ -177,7 +177,7 @@
 bootstrap_target = bootstrap-lean
 
 # Increase the timeout for one testrun on slow architectures
-ifeq ($(DEB_TARGET_GNU_CPU), $(findstring $(DEB_TARGET_GNU_CPU),arm hppa m68k))
+ifeq ($(DEB_TARGET_GNU_CPU), $(findstring $(DEB_TARGET_GNU_CPU),arm armeb hppa m68k))
   DEJAGNU_TIMEOUT=600
 else
   DEJAGNU_TIMEOUT=450
@@ -602,7 +602,7 @@
 	done
 
 # start the script only on architectures known to have slow autobilders ...
-logwatch_archs := arm hppa m68k mips mipsel sparc
+logwatch_archs := arm armeb hppa m68k mips mipsel sparc
 ifeq ($(DEB_HOST_GNU_CPU), $(findstring $(DEB_HOST_GNU_CPU),$(logwatch_archs)))
   start_logwatch = yes
 endif
--- gcc-3.4-3.4.4/debian/control.orig	2005-09-23 17:12:47.000000000 +0000
+++ gcc-3.4-3.4.4/debian/control	2005-09-23 17:13:03.000000000 +0000
@@ -4,7 +4,7 @@
 Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
 Uploaders: Matthias Klose <doko@debian.org>, Gerhard Tonn <gt@debian.org>
 Standards-Version: 3.6.2
-Build-Depends: dpkg-dev (>= 1.13.9), libc6.1-dev (>= 2.3.2.ds1-16) [alpha ia64] | libc0.3-dev (>= 2.3.2.ds1-16) | libc0.1-dev (>= 2.3.2.ds1-16) | libc12-dev (>= 2.3.2.ds1-16) | libc6-dev (>= 2.3.2.ds1-16), libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], libc6-dev-i386 [amd64] | ia32-libs-dev [amd64], libc6-dev-powerpc [ppc64], libc6-dev-ppc64 [powerpc], lib32gcc1 [amd64 ppc64], lib64gcc1 [powerpc i386 sparc s390], amd64-libs-dev [i386], libunwind7-dev (>= 0.98.5-7) [ia64], libatomic-ops-dev [ia64], m4, autoconf2.13, autoconf, automake1.4, automake1.7, libtool, autotools-dev, gawk, dejagnu (>= 1.4.3) [!hurd-i386 !knetbsd-gnu], expect-tcl8.3 [hppa], expect (>= 5.38.0) [!hppa !hurd-i386 !knetbsd-gnu], bzip2, binutils (>= 2.15-7) | binutils-multiarch (>= 2.15-7), binutils-hppa64 (>= 2.15-7) [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [!avr !knetbsd-gnu], gcc-3.4, gnat-3.4 [!arm !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu] | gnat-3.3 [!arm !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu], locales [!knetbsd-gnu !netbsd-elf-gnu !hurd-i386], procps [!hurd-i386 !knetbsd-gnu], sharutils, libncurses5-dev [!netbsd-elf-gnu], tetex-bin [!netbsd-elf-gnu], libgmp3-dev [!netbsd-elf-gnu], help2man [!netbsd-elf-gnu],  realpath (>= 1.9.12), lsb-release
+Build-Depends: dpkg-dev (>= 1.13.9), libc6.1-dev (>= 2.3.2.ds1-16) [alpha ia64] | libc0.3-dev (>= 2.3.2.ds1-16) | libc0.1-dev (>= 2.3.2.ds1-16) | libc12-dev (>= 2.3.2.ds1-16) | libc6-dev (>= 2.3.2.ds1-16), libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], libc6-dev-i386 [amd64] | ia32-libs-dev [amd64], libc6-dev-powerpc [ppc64], libc6-dev-ppc64 [powerpc], lib32gcc1 [amd64 ppc64], lib64gcc1 [powerpc i386 sparc s390], amd64-libs-dev [i386], libunwind7-dev (>= 0.98.5-7) [ia64], libatomic-ops-dev [ia64], m4, autoconf2.13, autoconf, automake1.4, automake1.7, libtool, autotools-dev, gawk, dejagnu (>= 1.4.3) [!hurd-i386 !knetbsd-gnu], expect-tcl8.3 [hppa], expect (>= 5.38.0) [!hppa !hurd-i386 !knetbsd-gnu], bzip2, binutils (>= 2.15-7) | binutils-multiarch (>= 2.15-7), binutils-hppa64 (>= 2.15-7) [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [!avr !knetbsd-gnu], gcc-3.4, gnat-3.4 [!arm !armeb !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu] | gnat-3.3 [!arm !armeb !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu], locales [!knetbsd-gnu !netbsd-elf-gnu !hurd-i386], procps [!hurd-i386 !knetbsd-gnu], sharutils, libncurses5-dev [!netbsd-elf-gnu], tetex-bin [!netbsd-elf-gnu], libgmp3-dev [!netbsd-elf-gnu], help2man [!netbsd-elf-gnu],  realpath (>= 1.9.12), lsb-release
 Build-Depends-Indep: doxygen (>= 1.4.2), graphviz (>= 2.2)
 
 Package: gcc-3.4-base
@@ -374,7 +374,7 @@
  stage. For production use, please use gpc or gpc-2.95.
 
 Package: gcc-3.4-soft-float
-Architecture: arm
+Architecture: arm armeb
 Priority: optional
 Depends: gcc-3.4-base (= ${gcc:Version}), gcc-3.4 (= ${gcc:Version}), ${shlibs:Depends}
 Replaces: gcc-soft-float-ss
--- gcc-3.4-3.4.4/debian/rules.defs.orig	2005-09-23 17:13:29.000000000 +0000
+++ gcc-3.4-3.4.4/debian/rules.defs	2005-09-23 17:13:45.000000000 +0000
@@ -437,7 +437,7 @@
 endif
 
 with_libgnat := yes
-ada_no_cpus := arm m68k m32r
+ada_no_cpus := arm armeb m68k m32r
 ada_no_systems := hurd-i386 kfreebsd-gnu knetbsd-gnu netbsd-elf-gnu
 ifeq ($(DEB_TARGET_ARCH_CPU), $(findstring $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
   with_ada := disabled for architecure $(DEB_TARGET_ARCH_CPU)
@@ -524,7 +524,7 @@
 ifeq ($(DEB_TARGET_GNU_SYSTEM), $(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
   with_check := disabled for $(DEB_TARGET_GNU_SYSTEM)
 endif
-check_no_cpus := # arm m68k
+check_no_cpus := # arm armeb m68k
 ifeq ($(DEB_TARGET_ARCH_CPU), $(findstring $(DEB_TARGET_ARCH_CPU),$(check_no_cpus)))
   with_check := disabled for architecure $(DEB_TARGET_ARCH_CPU)
 endif
--- gcc-3.4-3.4.4/debian/rules.patch.orig	2005-09-23 17:13:57.000000000 +0000
+++ gcc-3.4-3.4.4/debian/rules.patch	2005-09-23 17:14:27.000000000 +0000
@@ -28,6 +28,7 @@
 	libltdl \
 	m68k-update \
 	libf2c-mxunit \
+	arm-bigendian \
 
 #	cvs-updates \
 #	disable-gnat-testsuite \
--- gcc-3.4-3.4.4/debian/patches/arm-bigendian.dpatch.orig	2005-09-23 17:15:22.000000000 +0000
+++ gcc-3.4-3.4.4/debian/patches/arm-bigendian.dpatch	2005-09-23 17:15:22.000000000 +0000
@@ -0,0 +1,86 @@
+#! /bin/sh -e
+
+src=gcc
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+    pdir="-d $3"
+    src=$3/gcc
+elif [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch)
+        patch $pdir -f --no-backup-if-mismatch -p0 --fuzz 10 < $0
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p0 --fuzz 10 < $0
+        ;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1
+esac
+exit 0
+
+--- gcc/config/arm/linux-elf.h	2004-01-31 07:18:11.000000000 +0100
++++ gcc/config/arm/linux-elf.h	2004-07-02 14:46:29.225443757 +0200
+@@ -30,17 +30,34 @@
+ /* Do not assume anything about header files.  */
+ #define NO_IMPLICIT_EXTERN_C
+ 
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
++#define TARGET_ENDIAN_OPTION "mbig-endian"
++#define TARGET_LINKER_EMULATION "armelfb_linux"
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#define TARGET_LINKER_EMULATION "armelf_linux"
++#endif
++
+ /* Default is to use APCS-32 mode.  */
+ #undef  TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++		( ARM_FLAG_APCS_32 | \
++		  ARM_FLAG_MMU_TRAPS | \
++		  TARGET_ENDIAN_DEFAULT )
+ 
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+ 
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+ 
+ #undef  MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+-	{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
+ 
+ #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+ 
+@@ -89,7 +106,7 @@
+    %{rdynamic:-export-dynamic} \
+    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
+    -X \
+-   %{mbig-endian:-EB}" \
++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+    SUBTARGET_EXTRA_LINK_SPEC
+ 
+ #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
+--- gcc/config.gcc	2004-04-17 04:28:24.000000000 +0200
++++ gcc/config.gcc	2004-07-02 14:44:40.045822542 +0200
+@@ -666,6 +666,11 @@
+ 	;;
+ arm*-*-linux*)			# ARM GNU/Linux with ELF
+ 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
++	case $target in
++	arm*b-*)
++		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
++		;;
++	esac
+ 	tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+ 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ 	gnu_ld=yes
--- gcc-3.4-3.4.4/debian/control.m4.orig	2005-09-23 17:14:36.000000000 +0000
+++ gcc-3.4-3.4.4/debian/control.m4	2005-09-23 17:14:42.000000000 +0000
@@ -702,7 +702,7 @@
 ifdef(`TARGET',`',`dnl
 ifenabled(`libs',`
 Package: gcc`'PV-soft-float
-Architecture: arm
+Architecture: arm armeb
 Priority: PRI(optional)
 Depends: gcc`'PV-base (= ${gcc:Version}), ifenabled(`cdev',`gcc`'PV (= ${gcc:Version}),') ${shlibs:Depends}
 Replaces: gcc-soft-float-ss

Reply to: