]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemtap: improve reproducibility
authorHongxu Jia <hongxu.jia@windriver.com>
Fri, 20 Jul 2018 09:13:50 +0000 (17:13 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jul 2018 12:16:31 +0000 (13:16 +0100)
- Fix build path issue of .pyc files:
  Supply "--root" directory to the "install" command.

- Fix build path issue of c++ object files:
  Use relative dir to include header string_ref.

- Fix build path issue of c library generated by distutils:
  Add OE's CFLAGS which contains `-fdebug-prefix-map' options
  to setup.py

[YOCTO #12528]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch
meta/recipes-kernel/systemtap/systemtap/0001-improve-reproducibility-for-c-compiling.patch [new file with mode: 0644]
meta/recipes-kernel/systemtap/systemtap_git.bb

index 528864cc939dc9adfec722dd3f023a13501cd89f..48cf4aee856ec4c9f44d1281882f6caccbc39dda 100644 (file)
@@ -5,32 +5,52 @@ Subject: [PATCH] Install python modules to correct library dir.
 
 Upstream-Status: Inappropriate [oe-core specific]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+Add OE's CFLAGS which contains `-fdebug-prefix-map' options to
+setup.py
+
+Supply "--root" directory to the "install" command, and use
+it as a prefix to strip off the purported filename encoded
+in bytecode files. (It strips build path prefix from .pyc files)
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
- python/Makefile.am | ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ python/Makefile.am | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
 
 diff --git a/python/Makefile.am b/python/Makefile.am
-index a254480f9..efe9f3c01 100644
+index a254480..578602f 100644
 --- a/python/Makefile.am
 +++ b/python/Makefile.am
-@@ -47,7 +47,7 @@ install-exec-local:
+@@ -8,6 +8,10 @@ AUTOMAKE_OPTIONS = subdir-objects
+ AM_CPPFLAGS = -I$(srcdir)/../includes
+ AM_CPPFLAGS += -I$(abs_builddir)/../includes/sys
++# Add OE's CFLAGS which contains `-fdebug-prefix-map' options to
++# fix build path issue
++AM_CPPFLAGS += $(CFLAGS)
++
+ # Any script in the following variable will get byte-compiled at
+ # install time.
+ pkglibexecpython_PYTHON =
+@@ -47,7 +51,7 @@ install-exec-local:
  if HAVE_PYTHON2_PROBES
        (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \
           --build-base $(shell readlink -f $(builddir))/py2build \
 -       install --prefix $(DESTDIR)$(prefix) \
-+       install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${pythondir} \
++       install --root $(DESTDIR) --prefix $(prefix) --prefix $(prefix) --install-lib=${pythondir} \
         --single-version-externally-managed \
         --record $(shell readlink -f $(builddir))/py2build/install_files.txt \
           --verbose)
-@@ -55,7 +55,7 @@ endif
+@@ -55,7 +59,7 @@ endif
  if HAVE_PYTHON3_PROBES
        (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
           --build-base $(shell readlink -f $(builddir))/py3build \
 -       install --prefix $(DESTDIR)$(prefix) \
-+       install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${python3dir} \
++       install --root $(DESTDIR) --prefix $(prefix) --install-lib=${python3dir} \
         --single-version-externally-managed \
         --record $(shell readlink -f $(builddir))/py3build/install_files.txt \
           --verbose)
 -- 
-2.11.0
+2.7.4
 
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-improve-reproducibility-for-c-compiling.patch b/meta/recipes-kernel/systemtap/systemtap/0001-improve-reproducibility-for-c-compiling.patch
new file mode 100644 (file)
index 0000000..15a6f2a
--- /dev/null
@@ -0,0 +1,31 @@
+From 6288ba5df0a8c73ef842b609081449ac4de86123 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 18 Jul 2018 16:58:33 +0800
+Subject: [PATCH] improve reproducibility for c++ compiling
+
+Use relative dir to include header string_ref to
+strip build path prefix in c++ object file
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ stringtable.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/stringtable.h b/stringtable.h
+index 5fc42e7..6fd8a1e 100644
+--- a/stringtable.h
++++ b/stringtable.h
+@@ -19,7 +19,7 @@
+ #if defined(HAVE_BOOST_UTILITY_STRING_REF_HPP)
+ #include <boost/version.hpp>
+-#include <boost/utility/string_ref.hpp> //header with string_ref
++#include "@RELATIVE_STAGING_INCDIR@/boost/utility/string_ref.hpp" //header with string_ref
+ // XXX: experimental tunables
+ #define INTERNED_STRING_FIND_MEMMEM 1 /* perf stat indicates a very slight benefit */
+-- 
+2.7.4
+
index b280f583e26d90df06d803d1427df77911cca351..0b7833e901b9a624daf6204614dcdbd6e4acafca 100644 (file)
@@ -3,6 +3,8 @@ HOMEPAGE = "https://sourceware.org/systemtap/"
 
 require systemtap_git.inc
 
+SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch"
+
 DEPENDS = "elfutils"
 
 EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
@@ -25,6 +27,12 @@ PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,
 
 inherit autotools gettext pkgconfig distutils3-base
 
+do_configure_prepend () {
+    # Improve reproducibility for c++ object files
+    reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}"
+    sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h
+}
+
 do_install_append () {
    if [ ! -f ${D}${bindir}/stap ]; then
       # translator disabled case, need to leave only minimal runtime