Tags 697805 +patch
Thanks
Taking another look I noticed there was already a variable called
"derivative" which is set to "Ubuntu" for distributions that derive from
Ubuntu, "Debian" for distributions that derive from Debian but not from
Ubuntu and "Unknown" for systems that dervive from neither Debian or
Ubuntu. So I went through and changed the various blocks that
distinguish between Debian and Ubuntu to use this variable. This fixes
the build on LMDE and paves the way for fixing things for Raspbian.
I then added code to make the packaging detect Raspbian and use
appropriate settings.
Debdiff (with some noise stripped out) is attatched. The patch is
against gcc-4.8 but I imagine it should be fairly easy to port it to
other versions.
--- gcc-4.8-4.8.2/debian/changelog
+++ gcc-4.8-4.8.2/debian/changelog
@@ -1,3 +1,12 @@
+gcc-4.8 (4.8.2-1+plugwash1) unreleased; urgency=low
+
+ * Use $(derivative) instead of $(distribution) to distinguish between Debian
+ and Ubuntu so Debian derivatives get the Debian settings and Ubuntu
+ derivatives get the Ubuntu settings.
+ * Add conditionalised defaults for Raspbian.
+
+ -- Peter Michael Green <plugw...@raspbian.org> Sat, 02 Nov 2013 14:17:09
+0000
+
gcc-4.8 (4.8.2-1) unstable; urgency=low
* GCC 4.8.2 release.
--- gcc-4.8-4.8.2/debian/rules.conf
+++ gcc-4.8-4.8.2/debian/rules.conf
@@ -215,7 +215,7 @@
libc_ver := 2.11
libc_dev_ver := $(libc_ver)
ifeq ($(with_multiarch_lib),yes)
- ifeq ($(distribution),Debian)
+ ifeq ($(derivative),Debian)
libc_dev_ver := 2.13-5
#ifeq (,$(filter arm, $(go_no_cpus)))
# libc_dev_ver := 2.13-31
@@ -1079,7 +1079,7 @@
ifeq ($(DEB_HOST_ARCH),hppa)
echo 'dep:prctl=prctl' >> debian/substvars.local.tmp
endif
-ifeq ($(distribution)-$(DEB_HOST_ARCH),Debian-amd64)
+ifeq ($(derivative)-$(DEB_HOST_ARCH),Debian-amd64)
echo 'confl:lib32=libc6-i386 (<< 2.9-22)' >> debian/substvars.local.tmp
endif
ifeq ($(with_multiarch_lib),yes)
--- gcc-4.8-4.8.2/debian/rules.defs
+++ gcc-4.8-4.8.2/debian/rules.defs
@@ -290,9 +290,13 @@
# separate gcj builds
ifeq (,$(findstring gcj,$(PKGSOURCE)))
ifeq ($(DEB_TARGET_ARCH),armhf)
- with_arm_thumb := yes
+ ifeq ($(distribution),Raspbian)
+ with_arm_thumb := no
+ else
+ with_arm_thumb := yes
+ endif
else
- ifeq ($(distribution)-$(DEB_TARGET_ARCH),Ubuntu-armel)
+ ifeq ($(derivative)-$(DEB_TARGET_ARCH),Ubuntu-armel)
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
with_arm_thumb := yes
endif
@@ -301,21 +305,21 @@
endif
# build using fsf or linaro
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derivative),Ubuntu)
ifeq (,$(findstring gnat, $(PKGSOURCE)))
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm64 armel armhf))
with_linaro_branch = yes
endif
endif
endif
-ifeq ($(distribution)-$(DEB_TARGET_ARCH),Debian-arm64)
+ifeq ($(derivative)-$(DEB_TARGET_ARCH),Debian-arm64)
with_linaro_branch = yes
endif
# check if we're building for armel or armhf
ifeq ($(DEB_TARGET_ARCH),armhf)
float_abi := hard
-else ifneq (,$(filter $(distribution)-$(DEB_TARGET_ARCH), Ubuntu-armel))
+else ifneq (,$(filter $(derivative)-$(DEB_TARGET_ARCH), Ubuntu-armel))
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
float_abi := softfp
else
@@ -935,7 +939,7 @@
with_ssp := $(call envfilt, ssp, , , $(with_ssp))
ifeq ($(with_ssp),yes)
- ifneq ($(distribution),Debian)
+ ifneq ($(derivative),Debian)
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
with_ssp_default := yes
endif
@@ -1009,7 +1013,7 @@
# Don't include docs with GFDL invariant sections
GFDL_INVARIANT_FREE := yes
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derivative),Ubuntu)
GFDL_INVARIANT_FREE := no
endif
@@ -1146,7 +1150,7 @@
# neon build -------------------
# FIXME: build as a cross compiler to build on armv4 as well
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
- ifeq ($(distribution),Ubuntu)
+ ifeq ($(derivative),Ubuntu)
# neon_archs = armel armhf
# ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
# with_neon = yes
@@ -1176,7 +1180,7 @@
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM)
endif
-ifeq ($(distribution)-$(DEB_HOST_ARCH),Ubuntu-hppa)
+ifeq ($(derivative)-$(DEB_HOST_ARCH),Ubuntu-hppa)
ifneq ($(single_package),yes)
with_check := disabled, testsuite timeouts with expect
endif
@@ -1221,7 +1225,7 @@
biarch_map := $(subst i686=,i486=,$(biarch_map))
endif
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derivative),Ubuntu)
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick
natty))
biarch_map += arm=arm
endif
@@ -1341,7 +1345,7 @@
biarch32archs :=
/amd64/ppc64/kfreebsd-amd64/s390x/sparc64/x32/mipsn32/mipsn32el/mips64/mips64el/
biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/mipsn32/mipsn32el/x32/
biarchn32archs := /mips/mipsel/mips64/mips64el/
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derivative),Ubuntu)
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick
natty))
biarchhfarchs := /armel/
biarchsfarchs := /armhf/
@@ -1350,7 +1354,7 @@
biarchx32archs := /amd64/i386/
endif
endif
-ifeq ($(distribution),Debian)
+ifeq ($(derivative),Debian)
#ifeq (,$(filter $(distrelease),etch squeeze wheezy))
ifeq (,$(filter $(distrelease),etch squeeze))
biarchx32archs := /amd64/i386/
--- gcc-4.8-4.8.2/debian/rules.patch
+++ gcc-4.8-4.8.2/debian/rules.patch
@@ -99,7 +99,7 @@
ifeq ($(with_ssp)-$(with_ssp_default),yes-yes)
hardening_patches += gcc-default-ssp
endif
-ifneq ($(distribution),Debian)
+ifeq ($(distribution),Ubuntu)
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
hardening_patches += \
gcc-default-format-security \
@@ -306,7 +306,7 @@
#debian_patches += gcc-as-needed
endif
debian_patches += mips-fix-loongson2f-nop
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derivative),Ubuntu)
ifeq ($(DEB_TARGET_ARCH),ppc64)
debian_patches += gcc-ppc64-O3
endif
@@ -345,6 +345,7 @@
# files (AUTO <dir> <auto-command with options>) and run them separately,
# maybe only once per directory).
$(patch_stamp): $(unpack_stamp) $(series_stamp)
+ echo GFDL_INVARIANT_FREE $(GFDL_INVARIANT_FREE)
QUILT_PATCHES=$(patchdir) \
quilt --quiltrc /dev/null push -a || test $$? = 2
--- gcc-4.8-4.8.2/debian/rules2
+++ gcc-4.8-4.8.2/debian/rules2
@@ -95,7 +95,7 @@
CC_FOR_TARGET = $(DEB_TARGET_GNU_TYPE)-gcc
endif
-ifneq ($(distribution),Ubuntu)
+ifneq ($(derivative),Ubuntu)
ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel mips mipsel))
STAGE1_CFLAGS = -g -O2
endif
@@ -364,7 +364,7 @@
else
CONFARGS += --disable-multilib
endif
- ifeq ($(distribution),Ubuntu)
+ ifeq ($(derivative),Ubuntu)
CONFARGS += --with-cpu-32=power7 --with-cpu-64=power7
endif
endif
@@ -400,15 +400,21 @@
# FIXME: libjava is not ported for thumb, this hack only works for
# separate gcj builds
ifneq (,$(filter armhf,$(DEB_TARGET_ARCH)))
- ifneq (,$(findstring gcj,$(PKGSOURCE)))
+ ifeq ($(distribution),Raspbian)
with_arm_arch = armv6
+ with_arm_fpu = vfp
+
else
- with_arm_arch = armv7-a
+ ifneq (,$(findstring gcj,$(PKGSOURCE)))
+ with_arm_arch = armv6
+ else
+ with_arm_arch = armv7-a
+ endif
+ with_arm_fpu = vfpv3-d16
endif
- with_arm_fpu = vfpv3-d16
else
# armel
- ifeq ($(distribution),Debian)
+ ifeq ($(derivative),Debian)
with_arm_arch = armv4t
else ifneq (,$(filter $(distrelease),karmic))
with_arm_arch = armv6
@@ -438,7 +444,7 @@
CONFARGS += --disable-werror
endif
# FIXME: correct fix-warnings.dpatch
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derivative),Ubuntu)
CONFARGS += --disable-werror
endif
@@ -640,12 +646,12 @@
endif
# disable profiled bootstrap on slow archs, get to testing first ...
- ifeq ($(distribution),Debian)
+ ifeq ($(derivative),Debian)
ifneq (,$(filter $(DEB_TARGET_ARCH), arm arm64 armel armhf mips mipsel
sparc))
bootstrap_target = bootstrap-lean
endif
endif
- ifeq ($(distribution),Ubuntu)
+ ifeq ($(derivative),Ubuntu)
ifneq (,$(filter $(DEB_TARGET_ARCH), arm64 sparc))
bootstrap_target = bootstrap-lean
endif
@@ -654,7 +660,7 @@
DEJAGNU_TIMEOUT=300
# Increase the timeout for one testrun on slow architectures
-ifeq ($(distribution),Debian)
+ifeq ($(derivative),Debian)
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm arm64 armel armhf hppa m68k
sparc))
DEJAGNU_TIMEOUT=600
else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
@@ -663,7 +669,7 @@
ifeq ($(DEB_TARGET_GNU_SYSTEM),gnu)
DEJAGNU_TIMEOUT=900
endif
-else ifeq ($(distribution),Ubuntu)
+else ifeq ($(derivative),Ubuntu)
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm64 armel armhf hppa ia64 sparc))
DEJAGNU_TIMEOUT=600
else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
@@ -681,7 +687,7 @@
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
DEJAGNU_RUNS =
endif
- ifeq ($(distribution),Ubuntu)
+ ifeq ($(derivative),Ubuntu)
# the buildds are just slow ... don't check the non-default
ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),ia64 powerpc sparc))
DEJAGNU_RUNS =
@@ -690,7 +696,7 @@
endif
endif
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derivative),Ubuntu)
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
ifeq ($(with_arm_thumb),yes)
#DEJAGNU_RUNS += -marm