Source: guile-2.0 Version: 2.0.11+1-9 Severity: important Tags: patch The debian/rules file in the guile-2.0 package tries to handle various DEB_BUILD_OPTIONS flags (nostrip, debug, noopt) manually, but as far as I can tell it doesn't work properly.
First of all, the logic seems to be wrong: Debian policy seems to imply that packages should always be compiled with debugging information (i.e. CFLAGS should contain -g); and that debugging symbols should be subsequently stripped on installation, unless "nostrip" is specified: https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options However, the rules in the guile-2.0 package only try to add -g to CFLAGS if "debug" occurs in D_B_O, meaning that "nostrip" on its own has no effect, as there are no debugging symbols to strip in the first place. In fact, even if you specify "debug", the CFLAGS get overridden in the override_dh_auto_configure stanza. Thus AFAICT, regardless of what, if anything, you specify in DEB_BUILD_OPTIONS, guile ends up being compiled without -O2 or -g. (I found it useful to export DH_VERBOSE=1 when debugging these issues, to see which compile flags are actually used.) I would suggest removing the explicit handling of DEB_BUILD_OPTIONS from debian/rules, and leaving it to dh_auto_configure to supply correct build flags. (It invokes dpkg-buildflags, which handles "noopt" automatically. You can arrange for the -DPACKAGE_PACKAGER* flags to be appended to CFLAGS using DEB_CFLAGS_MAINT_APPEND.) Similarly, I suggest leaving the stripping of binaries to dh_strip, which will respect "nostrip". A beneficent side-effect of letting dpkg-buildflags do the work is that the correct hardening flags are also set. Note that debian policy doesn't mention or specify the semantics of "debug" in DEB_BUILD_OPTIONS. It shouldn't be necessary simply to get a build with debugging symbols, "nostrip" alone should produce that. I don't think that the guile package needs to handle "debug" at all. The following patch implements the suggested changes: --- a/debian/rules +++ b/debian/rules @@ -70,20 +70,10 @@ endef DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -deb_cflags := \ - -DPACKAGE_PACKAGER='\"Debian\"' \ - -DPACKAGE_PACKAGER_VERSION='\"$(upstream_ver)-deb+$(deb_src_src_rev)-$(deb_src_rev)\"' \ - -DPACKAGE_PACKAGER_BUG_REPORTS='\"http://www.debian.org/Bugs/Reporting\"' - -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif -ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O2 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif +export DEB_CFLAGS_MAINT_APPEND := \ + -DPACKAGE_PACKAGER='"Debian"' \ + -DPACKAGE_PACKAGER_VERSION='"$(upstream_ver)-deb+$(deb_src_src_rev)-$(deb_src_rev)"' \ + -DPACKAGE_PACKAGER_BUG_REPORTS='"http://www.debian.org/Bugs/Reporting"' # When this is eventually removed, remove the guile-snarf sed below. ifeq (arm,$(DEB_HOST_ARCH_CPU)) @@ -159,7 +149,7 @@ override_dh_autoreconf: dh_autoreconf ./autogen.sh override_dh_auto_configure: - CFLAGS="$(deb_cflags)" dh_auto_configure -- --disable-error-on-warning + dh_auto_configure -- --disable-error-on-warning # Let libtool forget about hardcoding -rpath into the libraries sed -i -e "s/^[[:space:]]*hardcode_into_libs=.*/hardcode_into_libs=no/" libtool -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

