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

Bug#603945: gcc-4.4: armhf support



Source: gcc-4.4
Version: 4.4.5-8
Severity: wishlist
Tags: patch


This is the patch used right now for the armhf port of gcc-4.4. It works 
against 4.4.5-8, and contrary to the first versions it's very short -no
extra linaro patches are necessary.

Regards

Konstantinos
diff -ruN gcc-4.4-4.4.5/debian/rules.conf gcc-4.4-4.4.5.armhf//debian/rules.conf
--- gcc-4.4-4.4.5/debian/rules.conf	2010-11-10 15:59:43.000000000 +0000
+++ gcc-4.4-4.4.5.armhf//debian/rules.conf	2010-11-10 15:58:39.000000000 +0000
@@ -47,7 +47,7 @@
       $1_no_archs += !alpha !hurd-alpha !knetbsd-alpha
     endif
     ifneq (,$$(filter arm,$$($1_no_cpus)))
-      $1_no_archs += !arm !armel
+      $1_no_archs += !arm !armel !armhf
     endif
     ifneq (,$$(strip $3))
       $1_no_systems_tmp := $$(subst $$(SPACE)gnu$$(SPACE),$$(SPACE)hurd-gnu$$(SPACE),$$(SPACE)$3$$(SPACE))
@@ -292,7 +292,7 @@
   # gstreamer peer
   #JAVA_BUILD_DEP += libgstreamer-plugins-base0.10-dev$(bd_java_archs),
   ifneq ($(PKGSOURCE),gcc-snapshot)
-    JAVA_BUILD_DEP += g++-4.4 [armel],
+    JAVA_BUILD_DEP += g++-4.4 [armel armhf],
   endif
 endif
 ifneq ($(with_standalone_gcj),yes)
@@ -314,7 +314,7 @@
 
 ECJ_DEP = ecj, libecj-java (>= 3.3.0-2)
 ECJ_DEP = ecj-gcj, libecj-java-gcj (>= 3.3.0-2)
-ifneq (,$(filter $(DEB_HOST_ARCH),arm armel))
+ifneq (,$(filter $(DEB_HOST_ARCH),arm armel armhf))
   ECJ_DEP +=, ecj1
 endif
 
@@ -342,7 +342,7 @@
   # Ditto, as part of the gcc-snapshot package.
   # FIXME: ad hoc dependency, better fix setting of ada_no_archs
   #GNAT_BUILD_DEP := gnat (>= 4.1) [$(ada_no_archs)], gcc-snapshot (>= 20090821-1) [armel],
-  GNAT_BUILD_DEP := gnat (>= 4.1) [!arm !armel !m68k !hurd-i386], gcc-snapshot (>= 20100116-1) [armel],
+  GNAT_BUILD_DEP := gnat (>= 4.1) [!arm !armel !armhf !m68k !hurd-i386], gcc-snapshot (>= 20100116-1) [armel armhf],
   PASCAL_BUILD_DEP :=
 else ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
   # Special source package just for gnat. Fail early if gnat is not present,
@@ -785,7 +785,7 @@
   endif
 endif
 ifneq ($(with_standalone_gcj),yes)
-  ifeq ($(DEB_HOST_ARCH),armel)
+  ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf))
 	echo 'dep:gcj=g++$(pkg_ver) (>= $(DEB_GCC_SOFT_VERSION))' \
 		>> debian/substvars.local.tmp
   else
diff -ruN gcc-4.4-4.4.5/debian/rules.defs gcc-4.4-4.4.5.armhf//debian/rules.defs
--- gcc-4.4-4.4.5/debian/rules.defs	2010-11-10 15:59:43.000000000 +0000
+++ gcc-4.4-4.4.5.armhf//debian/rules.defs	2010-11-10 15:58:39.000000000 +0000
@@ -266,6 +266,15 @@
   endif
 endif
 
+# check if we're building for armel or armhf
+ifeq ($(DEB_TARGET_ARCH),armhf)
+  with_linaro_branch := yes
+  arm_float_abi := hard
+  with_arm_thumb := yes
+else
+  arm_float_abi := softfp
+ endif
+
 # -------------------------------------------------------------------
 # basic config
 
@@ -397,7 +406,7 @@
   # that support both (see ada-sjlj.diff).  Most cpus support both
   # mechanisms; here, we declare the few that support only one.
   libgnat_zcx_only_cpus :=
-  libgnat_sjlj_only_cpus := arm armel
+  libgnat_sjlj_only_cpus := arm armel armhf
   ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_sjlj_only_cpus)))
     with_gnat_zcx := no
   else
@@ -546,7 +555,7 @@
 
 ifeq ($(with_java),yes)
   # use the same names as OpenJDK
-  java_cpu_map = armel=arm hppa=parisc i686=i386 i586=i386 i486=i386 mipsel=mips powerpc=ppc sh4=sh
+  java_cpu_map = armel=arm armhf=arm hppa=parisc i686=i386 i586=i386 i486=i386 mipsel=mips powerpc=ppc sh4=sh
   java_cpu = $(patsubst $(DEB_TARGET_ARCH_CPU)=%,%, \
                          $(filter $(DEB_TARGET_ARCH_CPU)=%,$(java_cpu_map)))
   ifeq (,$(java_cpu))
@@ -682,7 +691,7 @@
   with_objc_gc := yes
 
   # disable ObjC garbage collection library (needs libgc)
-  libgc_no_cpus := avr mips mipsel # alpha amd64 arm armel hppa i386 ia64 m68k mips mipsel powerpc s390 sparc
+  libgc_no_cpus := avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc s390 sparc
   libgc_no_systems := knetbsd-gnu
   ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus)))
     with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU)
@@ -774,7 +783,7 @@
 endif # ifndef DEB_STAGE
 
 # gold --------------------
-gold_archs = amd64 armel i386 lpia powerpc sparc
+gold_archs = amd64 armel armhf i386 lpia powerpc sparc
 gold_archs = amd64 i386 lpia
 ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs)))
   ifneq (,$(findstring snapshot,$(PKGSOURCE))$(findstring 4.5,$(PKGSOURCE)))
@@ -895,7 +904,7 @@
   # FIXME: build as a cross compiler to build on armv4 as well
   ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
     ifeq ($(distribution),Ubuntu)
-#      neon_archs = armel
+#      neon_archs = armel armhf
 #      ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
 #        with_neon = yes
 #      endif
diff -ruN gcc-4.4-4.4.5/debian/rules.patch gcc-4.4-4.4.5.armhf//debian/rules.patch
--- gcc-4.4-4.4.5/debian/rules.patch	2010-11-10 15:59:43.000000000 +0000
+++ gcc-4.4-4.4.5.armhf//debian/rules.patch	2010-11-10 15:58:39.000000000 +0000
@@ -216,7 +216,7 @@
   endif
 endif
 
-ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel))
+ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel armhf))
   debian_patches += libjava-armel-unwind
   debian_patches += $(if $(with_linaro_branch),,arm-gcc-gcse)
 endif
diff -ruN gcc-4.4-4.4.5/debian/rules2 gcc-4.4-4.4.5.armhf//debian/rules2
--- gcc-4.4-4.4.5/debian/rules2	2010-11-10 15:59:43.000000000 +0000
+++ gcc-4.4-4.4.5.armhf//debian/rules2	2010-11-10 15:58:39.000000000 +0000
@@ -87,7 +87,7 @@
 endif
 
 ifneq ($(distribution),Ubuntu)
-  ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel mips mipsel))
+  ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel armhf mips mipsel))
     STAGE1_CFLAGS = -g -O2
   endif
 endif
@@ -298,7 +298,9 @@
   CONFARGS += --with-fpu=vfp
 endif
 
-ifneq (,$(findstring arm-linux-gnueabi,$(DEB_TARGET_GNU_TYPE)))
+# FIXME: this should be again used when the triplet is again one
+# ifneq (,$(findstring arm-linux-gnueabi,$(DEB_TARGET_GNU_TYPE)))
+ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),arm armel armhf))
   CONFARGS += --disable-sjlj-exceptions
   # FIXME: libjava is not ported for thumb, this hack only works for
   # separate gcj builds
@@ -308,7 +310,19 @@
     else
       CONFARGS += --with-arch=armv7-a
     endif
-    CONFARGS += --with-float=softfp --with-fpu=vfpv3-d16
+    CONFARGS += --with-float=$(arm_float_abi) --with-fpu=vfpv3-d16
+  endif
+  # This would be so much simpler if "or" were supported, we would just add "or ifeq ($(DEB_TARGET_ARCH),armhf)" to the above
+  # Now we have to duplicate the case.
+  ifeq ($(distribution),Debian)
+    ifeq ($(DEB_TARGET_ARCH),armhf)
+      ifneq (,$(findstring gcj,$(PKGSOURCE)))
+        CONFARGS += --with-arch=armv6
+      else
+        CONFARGS += --with-arch=armv7-a
+      endif
+      CONFARGS += --with-float=$(arm_float_abi) --with-fpu=vfpv3-d16
+    endif
   endif
   ifeq ($(with_arm_thumb),yes)
     CONFARGS += --with-mode=thumb
@@ -447,7 +461,7 @@
 ifeq ($(with_bootstrap),)
   # no profiledbootstrap on the following architectures
   # - m68k: we're happy that it builds at all
-  no_profiled_bs_archs := arm armel m68k
+  no_profiled_bs_archs := arm armel armhf m68k
   ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),$(no_profiled_bs_archs)))
     bootstrap_target = bootstrap-lean
   else
@@ -466,7 +480,7 @@
 
 # disable profiled bootstrap on slow archs, get to testing first ...
 ifeq ($(distribution),Debian)
-  ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel hppa mips mipsel sparc))
+  ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel armhf hppa mips mipsel sparc))
     bootstrap_target = bootstrap-lean
   endif
 endif
@@ -480,7 +494,7 @@
 DEJAGNU_TIMEOUT=300
 # Increase the timeout for one testrun on slow architectures
 ifeq ($(distribution),Debian)
-  ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel hppa m68k sparc))
+  ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel armhf hppa m68k sparc))
     DEJAGNU_TIMEOUT=600
   else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
     DEJAGNU_TIMEOUT=180

Reply to: