diff options
author | Giovanni Panozzo <giovanni@panozzo.it> | 2020-07-31 00:05:59 +0300 |
---|---|---|
committer | Giovanni Panozzo <giovanni@panozzo.it> | 2020-07-31 00:05:59 +0300 |
commit | fabe85c948ebe2d789438e24374e081776dd6737 (patch) | |
tree | 40d191b24cceb96fed7f3e9032be9a2cf92af1ef | |
parent | 9d7ae584a1abac1a95435e83898e30cdd0d1a1ab (diff) |
Fix -O2 suppression on armhf
-rwxr-xr-x | debian/rules | 16 |
1 files 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 $@ |