From fabe85c948ebe2d789438e24374e081776dd6737 Mon Sep 17 00:00:00 2001 From: Giovanni Panozzo Date: Thu, 30 Jul 2020 21:05:59 +0000 Subject: Fix -O2 suppression on armhf --- debian/rules | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/debian/rules b/debian/rules index 3174d2d..12a299d 100755 --- a/debian/rules +++ b/debian/rules @@ -37,7 +37,16 @@ LINUX_URBDRC_CLIENT = -DCHANNEL_URBDRC=OFF \ $(NULL) endif -DEB_CMAKE_EXTRA_FLAGS := -DCMAKE_INSTALL_INCLUDEDIR=include/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) \ +# gcc on ubuntu 18.04 targeting at armhf is bugged when using -O2. Replace with -O1 +DEB_TARGET_ARCH?=$(shell dpkg-architecture -qDEB_TARGET_ARCH) +ifneq (,$(filter armhf,$(DEB_TARGET_ARCH))) +CMAKE_ARMHF_C_FLAGS = -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O1 -g -DNDEBUG" +else +CMAKE_ARMHF_C_FLAGS = +endif + +DEB_CMAKE_EXTRA_FLAGS := ${CMAKE_ARMHF_C_FLAGS} \ + -DCMAKE_INSTALL_INCLUDEDIR=include/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) \ -DCMAKE_SKIP_RPATH=FALSE \ -DCMAKE_SKIP_INSTALL_RPATH=TRUE \ -DWITH_PULSE=ON \ @@ -62,11 +71,6 @@ DEB_CMAKE_EXTRA_FLAGS := -DCMAKE_INSTALL_INCLUDEDIR=include/$(shell dpkg-archit # Add FFmpeg and GSM support to Ubuntu DEB_CMAKE_EXTRA_FLAGS += -DWITH_FFMPEG=ON -DWITH_GSM=ON -# gcc on ubuntu 18.04 targeting at armhf is bugged when using -O2. Replace with -O1 -DEB_TARGET_ARCH?=$(shell dpkg-architecture -qDEB_TARGET_ARCH) -ifneq (,$(filter armhf,$(DEB_TARGET_ARCH))) -DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_C_FLAGS="-O1 -g" -endif %: dh $@ -- cgit v1.2.3