From f6cb5491d1ddf7e3a2cfb7575d1b843fa02308f4 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 2 Aug 2018 21:57:00 +0800 Subject: [PATCH] cpupower: Fix handling of noopt and nostrip build options The upstream Makefile uses DEBUG to control both stripping of debug information *and* disabling optimisations. We want to disable stripping of debug information so that (normally) dh_strip can move it into a separate package later. However we also want to enable optimisations by default. Therefore: - Set the STRIP variable (a command prefix) to "true" - Set the DEBUG variable (a pseudo-boolean) to "true" if and only if the "noopt" build option is used --- debian/changelog | 1 + debian/rules.d/tools/power/cpupower/Makefile | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1ca6f5002..f0a216e79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,7 @@ linux (4.18~rc7-1~exp1) UNRELEASED; urgency=medium - linux-kbuild: Change "#!/usr/bin/env perl" to "#!/usr/bin/perl" - Build with KBUILD_VERBOSE=1 by default - objtool, usbip: Build with V=1 by default + * cpupower: Fix handling of noopt and nostrip build options -- Uwe Kleine-König Sat, 21 Jul 2018 16:52:01 +0200 diff --git a/debian/rules.d/tools/power/cpupower/Makefile b/debian/rules.d/tools/power/cpupower/Makefile index d83393906..7cb91da9a 100644 --- a/debian/rules.d/tools/power/cpupower/Makefile +++ b/debian/rules.d/tools/power/cpupower/Makefile @@ -2,7 +2,10 @@ include $(top_rulesdir)/Makefile.inc MAKE_CPUPOWER := $(shell dpkg-buildflags --export=cmdline) $(MAKE) O=$(CURDIR) CPUFREQ_BENCH=false V=true mandir=/usr/share/man -MAKE_CPUPOWER += DEBUG=$(if $(findstring nostrip,$(DEB_BUILD_OPTIONS)),true,) +MAKE_CPUPOWER += DEBUG=$(if $(filter noopt,$(DEB_BUILD_OPTIONS)),true,) + +# Don't strip binaries here; let dh_strip determine what to do +MAKE_CPUPOWER += STRIP=true MAKE_CPUPOWER += CROSS='$(CROSS_COMPILE)'