diff options
| author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> | 2023-04-04 20:34:03 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-05 17:26:53 +0100 |
| commit | f5fc2acb4e6927e370aff08ff015e5314f4757fe (patch) | |
| tree | 54dc3f67eb3ed0a0073cc5562b0e5178f14a4deb | |
| parent | b8bfd3b01b660d0536a272fafa0157aac2aaab0b (diff) | |
| download | poky-f5fc2acb4e6927e370aff08ff015e5314f4757fe.tar.gz | |
qemu: make tracetool-generated output reproducible
'#line' directives written by qemu's tracetool makes the 'debug' package not
reproducible due to absolute paths. Apply a patch to use a relative path
instead.
(From OE-Core rev: 85e30c507b63fa9126887dc6435d1ee6e23bd887)
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch | 87 |
2 files changed, 88 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index b41055fe5d..36b2f14638 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -32,6 +32,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 32 | file://0001-configure-Fix-check-tcg-not-executing-any-tests.patch \ | 32 | file://0001-configure-Fix-check-tcg-not-executing-any-tests.patch \ |
| 33 | file://0001-Revert-linux-user-add-more-compat-ioctl-definitions.patch \ | 33 | file://0001-Revert-linux-user-add-more-compat-ioctl-definitions.patch \ |
| 34 | file://0002-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch \ | 34 | file://0002-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch \ |
| 35 | file://0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch \ | ||
| 35 | file://qemu-guest-agent.init \ | 36 | file://qemu-guest-agent.init \ |
| 36 | file://qemu-guest-agent.udev \ | 37 | file://qemu-guest-agent.udev \ |
| 37 | " | 38 | " |
diff --git a/meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch b/meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch new file mode 100644 index 0000000000..5ef1184e3c --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | From 348ea441db84a211d4fca7ef5544b5cd06a8a872 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> | ||
| 3 | Date: Tue, 4 Apr 2023 15:26:07 +0200 | ||
| 4 | Subject: [PATCH] tracetool: use relative paths for '#line' preprocessor | ||
| 5 | directives | ||
| 6 | |||
| 7 | The event filename is an absolute path. Convert it to a relative path when | ||
| 8 | writing '#line' directives, to preserve reproducibility of the generated | ||
| 9 | output when different base paths are used. | ||
| 10 | |||
| 11 | Upstream-Status: Pending | ||
| 12 | |||
| 13 | --- | ||
| 14 | scripts/tracetool/backend/ftrace.py | 4 +++- | ||
| 15 | scripts/tracetool/backend/log.py | 4 +++- | ||
| 16 | scripts/tracetool/backend/syslog.py | 4 +++- | ||
| 17 | 3 files changed, 9 insertions(+), 3 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backend/ftrace.py | ||
| 20 | index 5fa30ccc08..baed2ae61c 100644 | ||
| 21 | --- a/scripts/tracetool/backend/ftrace.py | ||
| 22 | +++ b/scripts/tracetool/backend/ftrace.py | ||
| 23 | @@ -12,6 +12,8 @@ | ||
| 24 | __email__ = "stefanha@redhat.com" | ||
| 25 | |||
| 26 | |||
| 27 | +import os.path | ||
| 28 | + | ||
| 29 | from tracetool import out | ||
| 30 | |||
| 31 | |||
| 32 | @@ -45,7 +47,7 @@ def generate_h(event, group): | ||
| 33 | args=event.args, | ||
| 34 | event_id="TRACE_" + event.name.upper(), | ||
| 35 | event_lineno=event.lineno, | ||
| 36 | - event_filename=event.filename, | ||
| 37 | + event_filename=os.path.relpath(event.filename), | ||
| 38 | fmt=event.fmt.rstrip("\n"), | ||
| 39 | argnames=argnames) | ||
| 40 | |||
| 41 | diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/log.py | ||
| 42 | index 17ba1cd90e..de27b7e62e 100644 | ||
| 43 | --- a/scripts/tracetool/backend/log.py | ||
| 44 | +++ b/scripts/tracetool/backend/log.py | ||
| 45 | @@ -12,6 +12,8 @@ | ||
| 46 | __email__ = "stefanha@redhat.com" | ||
| 47 | |||
| 48 | |||
| 49 | +import os.path | ||
| 50 | + | ||
| 51 | from tracetool import out | ||
| 52 | |||
| 53 | |||
| 54 | @@ -53,7 +55,7 @@ def generate_h(event, group): | ||
| 55 | ' }', | ||
| 56 | cond=cond, | ||
| 57 | event_lineno=event.lineno, | ||
| 58 | - event_filename=event.filename, | ||
| 59 | + event_filename=os.path.relpath(event.filename), | ||
| 60 | name=event.name, | ||
| 61 | fmt=event.fmt.rstrip("\n"), | ||
| 62 | argnames=argnames) | ||
| 63 | diff --git a/scripts/tracetool/backend/syslog.py b/scripts/tracetool/backend/syslog.py | ||
| 64 | index 5a3a00fe31..012970f6cc 100644 | ||
| 65 | --- a/scripts/tracetool/backend/syslog.py | ||
| 66 | +++ b/scripts/tracetool/backend/syslog.py | ||
| 67 | @@ -12,6 +12,8 @@ | ||
| 68 | __email__ = "stefanha@redhat.com" | ||
| 69 | |||
| 70 | |||
| 71 | +import os.path | ||
| 72 | + | ||
| 73 | from tracetool import out | ||
| 74 | |||
| 75 | |||
| 76 | @@ -41,7 +43,7 @@ def generate_h(event, group): | ||
| 77 | ' }', | ||
| 78 | cond=cond, | ||
| 79 | event_lineno=event.lineno, | ||
| 80 | - event_filename=event.filename, | ||
| 81 | + event_filename=os.path.relpath(event.filename), | ||
| 82 | name=event.name, | ||
| 83 | fmt=event.fmt.rstrip("\n"), | ||
| 84 | argnames=argnames) | ||
| 85 | -- | ||
| 86 | 2.39.2 | ||
| 87 | |||
