Skip to contentSkip to conversation

sysprof: fix build with musl

PATCH In review Ross Burton 2 participants 2 messages Sep 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysprof: fix build with musl

---
 meta/recipes-kernel/sysprof/files/wordsize.patch | 62 ++++++++++++++++++++++++
 meta/recipes-kernel/sysprof/sysprof_3.30.0.bb    |  1 +
 2 files changed, 63 insertions(+)
 create mode 100644 meta/recipes-kernel/sysprof/files/wordsize.patch
meta/recipes-kernel/sysprof/files/wordsize.patch new file +62 -0
new file mode 100644
index 00000000000..4ce77777825
@@ -0,0 +1,62 @@
+capture: use size of void* instead of glibc-specific __WORDSIZE
+
+__WORDSIZE is glibc-specific so sp-capture-types.h doesn't work with musl.
+
+As this code is all about the size of pointers, do sizeof(void*) at configure
+time and use that to determine what values to use.
+
+Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/sysprof/merge_requests/5]
+Signed-off-by: Ross Burton <[email protected]>
+
+diff --git a/config.h.meson b/config.h.meson
+index 2d8c8fb..d927b1b 100644
+--- a/config.h.meson
++++ b/config.h.meson
+@@ -34,3 +34,6 @@
+ 
+ /* Version number of package */
+ #mesondefine VERSION
++
++/* Size of a pointer */
++#mesondefine VOID_P_SIZE
+diff --git a/lib/capture/sp-capture-types.h b/lib/capture/sp-capture-types.h
+index 48fcfb8..bc3ab9c 100644
+--- a/lib/capture/sp-capture-types.h
++++ b/lib/capture/sp-capture-types.h
+@@ -19,6 +19,7 @@
+ #ifndef SP_CAPTURE_FORMAT_H
+ #define SP_CAPTURE_FORMAT_H
+ 
++#include <config.h>
+ #include <glib.h>
+ 
+ #ifdef SP_ENABLE_GOBJECT
+@@ -32,12 +33,14 @@ G_BEGIN_DECLS
+ #define SP_CAPTURE_MAGIC (GUINT32_TO_LE(0xFDCA975E))
+ #define SP_CAPTURE_ALIGN (sizeof(SpCaptureAddress))
+ 
+-#if __WORDSIZE == 64
++#if VOID_P_SIZE == 8
+ # define SP_CAPTURE_JITMAP_MARK    G_GUINT64_CONSTANT(0xE000000000000000)
+ # define SP_CAPTURE_ADDRESS_FORMAT "0x%016lx"
+-#else
++#elif VOID_P_SIZE == 4
+ # define SP_CAPTURE_JITMAP_MARK    G_GUINT64_CONSTANT(0xE0000000)
+ # define SP_CAPTURE_ADDRESS_FORMAT "0x%016llx"
++#else
++#error Unknown VOID_P_SIZE
+ #endif
+ 
+ #define SP_CAPTURE_CURRENT_TIME   (sp_clock_get_current_time())
+diff --git a/meson.build b/meson.build
+index ff7296b..d841c0d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -35,6 +35,7 @@ has_clockid = cc.has_member('struct perf_event_attr', 'clockid', prefix: '#inclu
+ if has_use_clockid and has_clockid
+   config_h.set10('HAVE_PERF_CLOCKID', true)
+ endif
++config_h.set('VOID_P_SIZE', cc.sizeof('void*'))
+ 
+ add_global_arguments([
+   '-DHAVE_CONFIG_H',
meta/recipes-kernel/sysprof/sysprof_3.30.0.bb +1 -0
index 4f1b75017d2..7783ab27f50 100644
@@ -14,6 +14,7 @@ SRC_URI[archive.sha256sum] = "29cd2c4be277f00698dce48259219557c4fddc2c01254b8fac
 SRC_URI += " \
            file://define-NT_GNU_BUILD_ID.patch \
            file://0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch \
+           file://wordsize.patch \
            "
 RECIPE_NO_UPDATE_REASON = "Waiting for resolution of https://bugzilla.gnome.org/show_bug.cgi?id=794625"
 
Signature · 1 line
2.11.0
#1 lore raw

✗ patchtest: failure for sysprof: fix build with musl

== Series Details ==

Series: sysprof: fix build with musl
Revision: 1
URL : https://patchwork.openembedded.org/series/13947/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 0191456d81)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe