Bug#865310: sfcgal: Reduce build-time memory usage on mips/mipsel

Adrian Bunk bunk at debian.org
Tue Jun 20 12:58:02 UTC 2017


Source: sfcgal
Version: 1.3.1-1
Severity: important
Tags: patch

https://buildd.debian.org/status/fetch.php?pkg=sfcgal&arch=mips&ver=1.3.1-1&stamp=1497851040&raw=0

...
cc1plus: out of memory allocating 5842196 bytes after a total of 57806848 bytes
src/CMakeFiles/SFCGAL.dir/build.make:1241: recipe for target 'src/CMakeFiles/SFCGAL.dir/algorithm/union.cpp.o' failed
make[3]: *** [src/CMakeFiles/SFCGAL.dir/algorithm/union.cpp.o] Error 1
...


On mips/mipsel only 2 GB address space are available for userspace.

The following change addresses this by reducing the amount of
debug info generated to what is required for backtraces:

--- debian/rules.old	2017-06-19 22:17:14.000000000 +0000
+++ debian/rules	2017-06-19 23:42:31.000000000 +0000
@@ -6,9 +6,15 @@
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 DEB_BUILD_ARCH     ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
+# reduce debug info to fix FTBFS on archs with few address space
+ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
+    CMAKECXXFLAGS="-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=' -O2 -g1 -DNDEBUG'"
+endif
+
 # main packaging script based on dh7 syntax
 %:
 	dh $@ --with pkgkde_symbolshelper --parallel
@@ -16,6 +22,7 @@
 override_dh_auto_configure:
 	dh_auto_configure -- \
 		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
+		$(CMAKECXXFLAGS) \
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
 		-DCMAKE_VERBOSE_MAKEFILE=ON \



More information about the Pkg-grass-devel mailing list