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

Bug#656643: Hardened build flags



Source: libreoffice
Severity: normal
Tags: patch

Hi Rene,
attached you can find a patch against libreoffice from experimental
to enable dpkg-buildflags for libreoffice (enabling hardened build 
flags for Wheezy).

This should be backport-friendly for Squeeze, since dpkg-buildflags
exists in Squeeze as well (but w/o emitting the hardened build
flags).

I haven't had a chance to compile libreoffice with that patch,
I'll give it a shot in the next days.

Cheers,
        Moritz
diff -aur libreoffice-3.5.0~beta2.orig/debian/rules libreoffice-3.5.0~beta2/debian/rules
--- libreoffice-3.5.0~beta2.orig/debian/rules	2011-12-30 00:12:06.000000000 +0100
+++ libreoffice-3.5.0~beta2/debian/rules	2012-01-16 11:33:37.694562649 +0100
@@ -592,6 +592,13 @@
 	DBG_DBG_SUGGESTS+= , libc6.1-dbg [alpha ia64], libc0.1-dbg [kfreebsd-i386 kfreebsd-amd64], libc0.3-dbg [hurd-i386], libc6-dbg [!ia64 !alpha !kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libatk1.0-dbg, libglib2.0-0-dbg, libgnomevfs2-0-dbg, libstdc++6-$(SYSTEM_GCC_VERSION)-dbg, libx11-6-dbg, libxext6-dbg, libxaw7-dbg, libxml2-dbg, libgtk2.0-0-dbg, libxau6-dbg, libice6-dbg, libsm6-dbg, libxinerama1-dbg, libfontconfig1-dbg, libhunspell-$(shell pkg-config --modversion hunspell | cut -d. -f1,2)-0-dbg, libcurl4-dbg
 endif
 # Small symbols?
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+CXXFLAGS = `dpkg-buildflags --get CXXFLAGS`
+LDFLAGS = `dpkg-buildflags --get LDFLAGS`
+CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
+export CPPFLAGS
+export LDFLAGS
+
 ifeq "$(SMALL_SYMBOLS)" "y"
 	CONFIGURE_FLAGS += --enable-symbols=SMALL
 	CFLAGS := $(shell echo $(CFLAGS) | sed -e "s/-g/-g1/")
@@ -1560,7 +1567,7 @@
 $(STAMP_DIR)/build: config.status
 	dh_testdir
 
-	PATH=$(BUILD_PATH) LD_LIBRARY_PATH=$(BUILD_LD_LIBRARY_PATH) DEFAULT_TO_ENGLISH_FOR_PACKING=1 ARCH_FLAGS=$(ARCH_FLAGS) TMP=`mktemp -q -d` CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) build
+	PATH=$(BUILD_PATH) LD_LIBRARY_PATH=$(BUILD_LD_LIBRARY_PATH) DEFAULT_TO_ENGLISH_FOR_PACKING=1 ARCH_FLAGS=$(ARCH_FLAGS) TMP=`mktemp -q -d` CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) build
 
 ifeq "$(BUILD_PYUNO)" "y"
   ifeq "$(ENABLE_PYTHON3)" "y"
Nur in libreoffice-3.5.0~beta2/debian/: rules~.

Reply to: