Skip to contentSkip to conversation

systemtap: Add patch to remove quotes

PATCH New Saul Wold 1 participant 2 messages Mar 7, 2017

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH 1/2 systemtap: Add patch to remove quotes

This fixes the -I include lines that are getting passed to the kernel macros

[YOCTO #10990]

---
 ...ldrun-remove-quotes-around-I-include-line.patch | 38 ++++++++++++++++++++++
 meta/recipes-kernel/systemtap/systemtap_git.inc    |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch
meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch new file +38 -0
new file mode 100644
index 0000000..7996fdd
@@ -0,0 +1,38 @@
+From 75c4aec6de3a615909f3283eac585760de101b8c Mon Sep 17 00:00:00 2001
+From: Saul Wold <[email protected]>
+Date: Tue, 7 Mar 2017 10:46:12 -0800
+Subject: [PATCH] buildrun: remove quotes around -I include line
+
+By having the quotes, the kernel Makefile addtree macro adds the
+kernel $srctree directory as a prefix and causes compilation failures.
+Removing the quotes resolves the issue.
+
+This is trimmed from the verbose output of the GCC command line
+Before:
+ -I/srv/sdb/builds/4.9/tmp/work-shared/qemux86-64/kernel-source/"/srv/sdb/releases/jethro/builds/4.1/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime"
+
+After:
+ -I/srv/sdb/builds/4.9/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime
+
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <[email protected]>
+---
+ buildrun.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/buildrun.cxx b/buildrun.cxx
+index aaea64c..8a8ee9f 100644
+--- a/buildrun.cxx
++++ b/buildrun.cxx
+@@ -495,7 +495,7 @@ compile_pass (systemtap_session& s)
+   #if CHECK_POINTER_ARITH_PR5947
+   o << "EXTRA_CFLAGS += -Wpointer-arith" << endl;
+   #endif
+-  o << "EXTRA_CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
++  o << "EXTRA_CFLAGS += -I" << s.runtime_path << endl;
+   // XXX: this may help ppc toc overflow
+   // o << "CFLAGS := $(subst -Os,-O2,$(CFLAGS)) -fminimal-toc" << endl;
+   o << "obj-m := " << s.module_name << ".o" << endl;
+-- 
+2.7.4
+
meta/recipes-kernel/systemtap/systemtap_git.inc +1 -0
index c961230..a6aedd3 100644
@@ -11,6 +11,7 @@ SRC_URI = "git://sourceware.org/git/systemtap.git \
            file://no-msgfmt-check.patch \
            file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \
            file://0001-Install-python-modules-to-correct-library-dir.patch \
+           file://0001-buildrun-remove-quotes-around-I-include-line.patch \
           "
 
 # systemtap doesn't support mips
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 crosstap: Changes to support Recipe specific sysroot

The crosstap script needed to be updated for recipe specific sysroot changes including adding support for finding the systemtap binaries.

[YOCTO #10990]

---
 scripts/crosstap | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
scripts/crosstap +9 -2
index 58317cf..39739bb 100755
@@ -104,13 +104,19 @@ STAGING_BINDIR_TOOLCHAIN=$(echo "$BITBAKE_VARS" | grep ^STAGING_BINDIR_TOOLCHAIN
   | cut -d '=' -f2 | cut -d '"' -f2)
 STAGING_BINDIR_TOOLPREFIX=$(echo "$BITBAKE_VARS" | grep ^TARGET_PREFIX \
   | cut -d '=' -f2 | cut -d '"' -f2)
-SYSTEMTAP_HOST_INSTALLDIR=$(echo "$BITBAKE_VARS" | grep ^STAGING_DIR_NATIVE \
-  | cut -d '=' -f2 | cut -d '"' -f2)
 TARGET_ARCH=$(echo "$BITBAKE_VARS" | grep ^TRANSLATED_TARGET_ARCH \
   | cut -d '=' -f2 | cut -d '"' -f2)
 TARGET_KERNEL_BUILDDIR=$(echo "$BITBAKE_VARS" | grep ^B= \
   | cut -d '=' -f2 | cut -d '"' -f2)
 
+# Build and populate the recipe-sysroot-native with systemtap-native
+pushd $PWD
+cd $BUILDDIR
+BITBAKE_VARS=`bitbake -e systemtap-native`
+popd
+SYSTEMTAP_HOST_INSTALLDIR=$(echo "$BITBAKE_VARS" | grep ^STAGING_DIR_NATIVE \
+  | cut -d '=' -f2 | cut -d '"' -f2)
+
 systemtap_target_arch "$TARGET_ARCH"
 
 if [ ! -d $TARGET_KERNEL_BUILDDIR ] ||
@@ -125,6 +131,7 @@ if [ ! -f $SYSTEMTAP_HOST_INSTALLDIR/usr/bin/stap ]; then
     echo -e "\nError: Native (host) systemtap not found."
     echo -e "Did you accidentally build a local non-sdk image? (or forget to"
     echo -e "add 'tools-profile' to EXTRA_IMAGE_FEATURES in your local.conf)?"
+    echo -e "You can also: bitbake -c addto_recipe_sysroot systemtap-native"
     setup_usage
     exit 1
 fi
Signature · 1 line
2.7.4