Skip to contentSkip to conversation

builddeb: Skip gcc-plugins when not configured

PATCH In review Kees Cook 2 participants 2 messages Aug 15, 2016 – Aug 16, 2016 Kbuild

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 builddeb: Skip gcc-plugins when not configured

When attempting to build a Debian kernel package, the "scripts/gcc-plugins" directory does not exist in the output tree unless CONFIG_GCC_PLUGINS=y. To avoid errors when not defined, this wraps the failing "find" in a config test.

---
This should go into v4.8...

---
 scripts/package/builddeb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/package/builddeb +3 -1
index e1c09e2f9be7..8ea9fd2b6573 100755
@@ -332,7 +332,9 @@ if grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then
 	(cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles"
 fi
 (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
-(cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
+if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then
+	(cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
+fi
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
 mkdir -p "$destdir"
 (cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
Signature · 6 lines
2.7.4


-- 
Kees Cook
Nexus Security
#1 lore raw

Dne 15.8.2016 v 19:36 Kees Cook napsal(a):

Quoted 10 lines

When attempting to build a Debian kernel package, the "scripts/gcc-plugins" directory does not exist in the output tree unless CONFIG_GCC_PLUGINS=y. To avoid errors when not defined, this wraps the failing "find" in a config test.

---
This should go into v4.8...

Applied to kbuild.git#rc-fixes.

Thanks,
Michal