diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-07-20 17:13:50 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-26 13:16:40 +0100 |
commit | 077ad469349734fe82f4cc920ed8375f5282d9dc (patch) | |
tree | 5692c3fe31261aa958f908849999f5f7397d00cd /meta/recipes-kernel | |
parent | b7b203d8ea30056b5e03e7ef04504e5d5bee1a1a (diff) | |
download | poky-077ad469349734fe82f4cc920ed8375f5282d9dc.tar.gz |
systemtap: improve reproducibility
- 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]
(From OE-Core rev: 806a8626c3fb5020666152b295f12541f5f61ffd)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
3 files changed, 67 insertions, 8 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch b/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch index 528864cc93..48cf4aee85 100644 --- a/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch +++ b/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch | |||
@@ -5,32 +5,52 @@ Subject: [PATCH] Install python modules to correct library dir. | |||
5 | 5 | ||
6 | Upstream-Status: Inappropriate [oe-core specific] | 6 | Upstream-Status: Inappropriate [oe-core specific] |
7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | 7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
8 | |||
9 | Add OE's CFLAGS which contains `-fdebug-prefix-map' options to | ||
10 | setup.py | ||
11 | |||
12 | Supply "--root" directory to the "install" command, and use | ||
13 | it as a prefix to strip off the purported filename encoded | ||
14 | in bytecode files. (It strips build path prefix from .pyc files) | ||
15 | |||
16 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
8 | --- | 17 | --- |
9 | python/Makefile.am | 4 ++-- | 18 | python/Makefile.am | 8 ++++++-- |
10 | 1 file changed, 2 insertions(+), 2 deletions(-) | 19 | 1 file changed, 6 insertions(+), 2 deletions(-) |
11 | 20 | ||
12 | diff --git a/python/Makefile.am b/python/Makefile.am | 21 | diff --git a/python/Makefile.am b/python/Makefile.am |
13 | index a254480f9..efe9f3c01 100644 | 22 | index a254480..578602f 100644 |
14 | --- a/python/Makefile.am | 23 | --- a/python/Makefile.am |
15 | +++ b/python/Makefile.am | 24 | +++ b/python/Makefile.am |
16 | @@ -47,7 +47,7 @@ install-exec-local: | 25 | @@ -8,6 +8,10 @@ AUTOMAKE_OPTIONS = subdir-objects |
26 | AM_CPPFLAGS = -I$(srcdir)/../includes | ||
27 | AM_CPPFLAGS += -I$(abs_builddir)/../includes/sys | ||
28 | |||
29 | +# Add OE's CFLAGS which contains `-fdebug-prefix-map' options to | ||
30 | +# fix build path issue | ||
31 | +AM_CPPFLAGS += $(CFLAGS) | ||
32 | + | ||
33 | # Any script in the following variable will get byte-compiled at | ||
34 | # install time. | ||
35 | pkglibexecpython_PYTHON = | ||
36 | @@ -47,7 +51,7 @@ install-exec-local: | ||
17 | if HAVE_PYTHON2_PROBES | 37 | if HAVE_PYTHON2_PROBES |
18 | (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \ | 38 | (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \ |
19 | --build-base $(shell readlink -f $(builddir))/py2build \ | 39 | --build-base $(shell readlink -f $(builddir))/py2build \ |
20 | - install --prefix $(DESTDIR)$(prefix) \ | 40 | - install --prefix $(DESTDIR)$(prefix) \ |
21 | + install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${pythondir} \ | 41 | + install --root $(DESTDIR) --prefix $(prefix) --prefix $(prefix) --install-lib=${pythondir} \ |
22 | --single-version-externally-managed \ | 42 | --single-version-externally-managed \ |
23 | --record $(shell readlink -f $(builddir))/py2build/install_files.txt \ | 43 | --record $(shell readlink -f $(builddir))/py2build/install_files.txt \ |
24 | --verbose) | 44 | --verbose) |
25 | @@ -55,7 +55,7 @@ endif | 45 | @@ -55,7 +59,7 @@ endif |
26 | if HAVE_PYTHON3_PROBES | 46 | if HAVE_PYTHON3_PROBES |
27 | (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \ | 47 | (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \ |
28 | --build-base $(shell readlink -f $(builddir))/py3build \ | 48 | --build-base $(shell readlink -f $(builddir))/py3build \ |
29 | - install --prefix $(DESTDIR)$(prefix) \ | 49 | - install --prefix $(DESTDIR)$(prefix) \ |
30 | + install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${python3dir} \ | 50 | + install --root $(DESTDIR) --prefix $(prefix) --install-lib=${python3dir} \ |
31 | --single-version-externally-managed \ | 51 | --single-version-externally-managed \ |
32 | --record $(shell readlink -f $(builddir))/py3build/install_files.txt \ | 52 | --record $(shell readlink -f $(builddir))/py3build/install_files.txt \ |
33 | --verbose) | 53 | --verbose) |
34 | -- | 54 | -- |
35 | 2.11.0 | 55 | 2.7.4 |
36 | 56 | ||
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 index 0000000000..15a6f2a9a5 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-improve-reproducibility-for-c-compiling.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 6288ba5df0a8c73ef842b609081449ac4de86123 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Wed, 18 Jul 2018 16:58:33 +0800 | ||
4 | Subject: [PATCH] improve reproducibility for c++ compiling | ||
5 | |||
6 | Use relative dir to include header string_ref to | ||
7 | strip build path prefix in c++ object file | ||
8 | |||
9 | Upstream-Status: Inappropriate [oe specific] | ||
10 | |||
11 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
12 | --- | ||
13 | stringtable.h | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/stringtable.h b/stringtable.h | ||
17 | index 5fc42e7..6fd8a1e 100644 | ||
18 | --- a/stringtable.h | ||
19 | +++ b/stringtable.h | ||
20 | @@ -19,7 +19,7 @@ | ||
21 | |||
22 | #if defined(HAVE_BOOST_UTILITY_STRING_REF_HPP) | ||
23 | #include <boost/version.hpp> | ||
24 | -#include <boost/utility/string_ref.hpp> //header with string_ref | ||
25 | +#include "@RELATIVE_STAGING_INCDIR@/boost/utility/string_ref.hpp" //header with string_ref | ||
26 | |||
27 | // XXX: experimental tunables | ||
28 | #define INTERNED_STRING_FIND_MEMMEM 1 /* perf stat indicates a very slight benefit */ | ||
29 | -- | ||
30 | 2.7.4 | ||
31 | |||
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb index b280f583e2..0b7833e901 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.bb +++ b/meta/recipes-kernel/systemtap/systemtap_git.bb | |||
@@ -3,6 +3,8 @@ HOMEPAGE = "https://sourceware.org/systemtap/" | |||
3 | 3 | ||
4 | require systemtap_git.inc | 4 | require systemtap_git.inc |
5 | 5 | ||
6 | SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch" | ||
7 | |||
6 | DEPENDS = "elfutils" | 8 | DEPENDS = "elfutils" |
7 | 9 | ||
8 | EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \ | 10 | EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \ |
@@ -25,6 +27,12 @@ PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes, | |||
25 | 27 | ||
26 | inherit autotools gettext pkgconfig distutils3-base | 28 | inherit autotools gettext pkgconfig distutils3-base |
27 | 29 | ||
30 | do_configure_prepend () { | ||
31 | # Improve reproducibility for c++ object files | ||
32 | reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}" | ||
33 | sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h | ||
34 | } | ||
35 | |||
28 | do_install_append () { | 36 | do_install_append () { |
29 | if [ ! -f ${D}${bindir}/stap ]; then | 37 | if [ ! -f ${D}${bindir}/stap ]; then |
30 | # translator disabled case, need to leave only minimal runtime | 38 | # translator disabled case, need to leave only minimal runtime |