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

Bug#697805: gcc-4.(7|8) FTBFS on non-ubuntu based derivatives that change output of lsb_release -is (was: gcc-4.7 fails to build with dpkg-buildpackage)

reopen 697805
retitle 697805 gcc-4.(7|8) FTBFS on non-ubuntu based derivatives that change output of lsb_release -is
severity 697805 normal

I just ran into this issue while updating gcc in raspbian. It is a real bug IMO but it is more subtule than the original submitter realised. I have run into it with both 4.7 and 4.8 and it may affect other versions too.

The problem is there are a couple of chunks of logic which basically say "apply these patches on anything except Debian". So anyone who makes a derivative of Debian and changes the lsb_release -is output (as is apparently encouraged to allow software to identify that it is building/running on the derivative) will get those patches applied. However the patches in question will only apply to the ubuntu version of the source that has the non-dfsg documentation present. So the package FTBFS on non-ubuntu based derivatives that change the vendor reported by lsb_release.

In the raspbian version of the packages I just switched the logic arround so it was "apply these patches on ubuntu only" instead of "apply these patches on everything but debian" (see hunks at the end of this mail for details). That would work for ubuntu and for direct derivatives of debian but it would mean derivatives of ubuntu don't get the patches which is probablly not what you want.

IMO what you should really be checking is not "is this Debian" or "is this Ubuntu" but "does this derive from Ubuntu". This can be done using dpkg-vendor, specificually something along the lines of.

UBUNTU_DERIVED = $(shell dpkg-vendor --derives-from Ubuntu && echo yes || echo no)

relavent changes made to package in raspbian are below for reference:

--- gcc-4.8-4.8.2/debian/rules.defs
+++ gcc-4.8-4.8.2/debian/rules.defs
@@ -935,7 +935,7 @@
with_ssp := $(call envfilt, ssp, , , $(with_ssp))

ifeq ($(with_ssp),yes)
-  ifneq ($(distribution),Debian)
+  ifeq ($(distribution),Ubuntu)
    ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
      with_ssp_default := yes

--- 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
-ifneq ($(distribution),Debian)
+ifeq ($(distribution),Ubuntu)
  ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
    hardening_patches += \
       gcc-default-format-security \

Reply to: