Skip to contentSkip to conversation

breakpad: Do not fallback to android implementation for getcontext/setcontext on musl

PATCH New Khem Raj 1 participant 1 message Mar 15, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 breakpad: Do not fallback to android implementation for getcontext/setcontext on musl

with musl, it tried to use local implementation which is geared towards android and does not compile with musl/linux

---
 ...ONTEXT-check-to-add-local-implementa.patch | 54 +++++++++++++++++++
 ...isable-calls-to-getcontext-with-musl.patch | 47 ----------------
 .../recipes-devtools/breakpad/breakpad_git.bb |  5 +-
 3 files changed, 58 insertions(+), 48 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/breakpad/breakpad/0001-Remove-HAVE_GETCONTEXT-check-to-add-local-implementa.patch
 delete mode 100644 meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch
meta-oe/recipes-devtools/breakpad/breakpad/0001-Remove-HAVE_GETCONTEXT-check-to-add-local-implementa.patch new file +54 -0
new file mode 100644
index 0000000000..d7a5c06753
@@ -0,0 +1,54 @@
+From 70441611d4e8200d9d16dfed493873b8c1bb57c5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 15 Mar 2021 11:33:38 -0700
+Subject: [PATCH] Remove HAVE_GETCONTEXT check to add local implementation
+
+On musl getcontext/setcontext APIs are implemented in libucontext which
+can be used
+
+Upstream-Status: Inappropriate [Musl Specific]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile.am | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index ee7454e4..69700192 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -187,10 +187,6 @@ src_client_linux_libbreakpad_client_a_SOURCES = \
+ 	src/common/linux/linux_libc_support.cc \
+ 	src/common/linux/memory_mapped_file.cc \
+ 	src/common/linux/safe_readlink.cc
+-if !HAVE_GETCONTEXT
+-src_client_linux_libbreakpad_client_a_SOURCES += \
+-	src/common/linux/breakpad_getcontext.S
+-endif
+ endif LINUX_HOST
+ 
+ if !DISABLE_PROCESSOR
+@@ -508,10 +504,6 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \
+ 	src/processor/minidump.cc \
+ 	src/processor/pathname_stripper.cc \
+ 	src/processor/proc_maps_linux.cc
+-if !HAVE_GETCONTEXT
+-src_client_linux_linux_client_unittest_shlib_SOURCES += \
+-	src/common/linux/breakpad_getcontext.S
+-endif
+ 
+ src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
+ 	$(AM_CPPFLAGS) $(TEST_CFLAGS)
+@@ -541,10 +533,6 @@ src_client_linux_linux_client_unittest_shlib_LDADD = \
+ 	src/common/string_conversion.o \
+ 	$(TEST_LIBS) \
+ 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+-if !HAVE_GETCONTEXT
+-src_client_linux_linux_client_unittest_shlib_SOURCES += \
+-	src/common/linux/breakpad_getcontext_unittest.cc
+-endif
+ if ANDROID_HOST
+ src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
+ 	-llog -lm
+-- 
+2.30.2
+
meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch deleted +0 -47

47 lines not on this page · raw message

meta-oe/recipes-devtools/breakpad/breakpad_git.bb +4 -1
index 4d9038a92c..81955f450d 100644
@@ -11,6 +11,8 @@ SECTION = "libs"
 
 inherit autotools
 
+DEPENDS_append_libc-musl = " libucontext"
+
 BBCLASSEXTEND = "native"
 
 PE = "2"
@@ -37,7 +39,7 @@ SRC_URI = "git://github.com/google/breakpad;name=breakpad;branch=main \
            file://0003-Dont-include-stab.h.patch \
            file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \
            file://mcontext.patch \
-           file://0001-disable-calls-to-getcontext-with-musl.patch \
+           file://0001-Remove-HAVE_GETCONTEXT-check-to-add-local-implementa.patch \
            file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \
            file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \
            file://0001-Do-not-add-stack-pointer-to-clobber-list.patch;patchdir=src/third_party/lss \
@@ -45,6 +47,7 @@ SRC_URI = "git://github.com/google/breakpad;name=breakpad;branch=main \
 S = "${WORKDIR}/git"
 
 CXXFLAGS += "-D_GNU_SOURCE"
+LDFLAGS_append_libc-musl = " -lucontext"
 
 COMPATIBLE_HOST_powerpc = "null"
 COMPATIBLE_HOST_powerpc64 = "null"
Signature · 1 line
2.30.2