Skip to contentSkip to conversation

Recipe fixes needed for upcoming glibc 2.26

PATCH New Khem Raj 1 participant 5 messages Jun 29, 2017

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

cover Recipe fixes needed for upcoming glibc 2.26

glibc has dropped certain exposed APIs and types which require changes in packages to get them built, these changes should be backward compatible since now it is using more standard types

The following changes since commit c594cacc88b4239f2be2ee97ea127ae27186dbcd:

lz4: Add patch to fix re-builds (2017-06-28 20:54:55 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib kraj/pu
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=kraj/pu

Khem Raj (4):
valgrind: Fix build with glibc 2.26
strace: upgrade to 4.17
qemu: Replace use of struct ucontext with ucontext_t
epiphany: Fix build errors when compiling with security flags

 ...lace-struct-ucontext-with-ucontext_t-type.patch | 265 +++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_2.8.1.1.bb         |  46 ++--
 ...8-replace-struct-ucontext-with-ucontext_t.patch |  31 +++
 .../strace/strace/Makefile-ptest.patch             |  19 +-
 .../strace/{strace_4.16.bb => strace_4.17.bb}      |   5 +-
 ...sts-Use-ucontext_t-instead-of-struct-ucon.patch |  30 +++
 meta/recipes-devtools/valgrind/valgrind_3.12.0.bb  |   1 +
 meta/recipes-gnome/epiphany/epiphany_3.24.2.bb     |   6 +-
 ...bookmarks-Check-for-return-value-of-fread.patch |  32 +++
 9 files changed, 400 insertions(+), 35 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu/0001-replace-struct-ucontext-with-ucontext_t-type.patch
 create mode 100644 meta/recipes-devtools/strace/strace/0008-replace-struct-ucontext-with-ucontext_t.patch
 rename meta/recipes-devtools/strace/{strace_4.16.bb => strace_4.17.bb} (87%)
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch
 create mode 100644 meta/recipes-gnome/epiphany/files/0001-bookmarks-Check-for-return-value-of-fread.patch
Signature · 1 line
2.13.2
author
#1 lore raw

PATCH 1/4 valgrind: Fix build with glibc 2.26

---
 ...sts-Use-ucontext_t-instead-of-struct-ucon.patch | 30 ++++++++++++++++++++++
 meta/recipes-devtools/valgrind/valgrind_3.12.0.bb  |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch
meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch new file +30 -0
new file mode 100644
index 0000000000..bf16a1adfe
@@ -0,0 +1,30 @@
+From 629ac492b1d9bc709d17337eb9b1c28603eca250 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 28 Jun 2017 11:01:25 -0700
+Subject: [PATCH] memcheck/tests: Use ucontext_t instead of struct ucontext
+
+glibc 2.26 does not expose struct ucontext anymore
+
+Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=381769]
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ memcheck/tests/linux/stack_changes.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/memcheck/tests/linux/stack_changes.c b/memcheck/tests/linux/stack_changes.c
+index ffb49c6..acc4109 100644
+--- a/memcheck/tests/linux/stack_changes.c
++++ b/memcheck/tests/linux/stack_changes.c
+@@ -11,7 +11,7 @@
+ // checks that Valgrind notices their stack changes properly.
+ 
+ #ifdef __GLIBC__
+-typedef  struct ucontext  mycontext;
++typedef ucontext_t  mycontext;
+ 
+ mycontext ctx1, ctx2, oldc;
+ int count;
+-- 
+2.13.2
+
meta/recipes-devtools/valgrind/valgrind_3.12.0.bb +1 -0
index a81adc31d6..3fce5de0a7 100644
@@ -31,6 +31,7 @@ SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
            file://0004-pth_atfork1.c-Define-error-API-for-musl.patch \
            file://0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch \
            file://0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch \
+           file://0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch \
            "
 SRC_URI_append_libc-musl = "\
            file://0001-fix-build-for-musl-targets.patch \
Signature · 1 line
2.13.2
author
#2 lore raw

PATCH 2/4 strace: upgrade to 4.17

In reply to Khem Raj

Fix build with upcoming glibc 2.26

---
 ...8-replace-struct-ucontext-with-ucontext_t.patch | 31 ++++++++++++++++++++++
 .../strace/strace/Makefile-ptest.patch             | 19 ++++++++-----
 .../strace/{strace_4.16.bb => strace_4.17.bb}      |  5 ++--
 3 files changed, 47 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-devtools/strace/strace/0008-replace-struct-ucontext-with-ucontext_t.patch
 rename meta/recipes-devtools/strace/{strace_4.16.bb => strace_4.17.bb} (87%)
meta/recipes-devtools/strace/strace/0008-replace-struct-ucontext-with-ucontext_t.patch new file +31 -0
new file mode 100644
index 0000000000..1985d8104d
@@ -0,0 +1,31 @@
+From 07f71a12cb88919c6113284fc43bf4967e5e2bc1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 28 Jun 2017 11:36:57 -0700
+Subject: [PATCH 8/8] replace struct ucontext with ucontext_t
+
+glibc >= 2.26 has dropped the tag struct ucontext
+from ucontext_t type
+
+Upstream-Status: Submitted
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ linux/arm/arch_sigreturn.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/linux/arm/arch_sigreturn.c b/linux/arm/arch_sigreturn.c
+index b60dad8..a2b7100 100644
+--- a/linux/arm/arch_sigreturn.c
++++ b/linux/arm/arch_sigreturn.c
+@@ -9,7 +9,7 @@ arch_sigreturn(struct tcb *tcp)
+ #ifdef AARCH64
+ 		tcp->currpers == 0 ?
+ 			(*aarch64_sp_ptr + SIZEOF_STRUCT_SIGINFO +
+-			 offsetof(struct ucontext, uc_sigmask)) :
++			 offsetof(ucontext_t, uc_sigmask)) :
+ #endif
+ 			(*arm_sp_ptr +
+ 			 OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK);
+-- 
+2.13.2
+
meta/recipes-devtools/strace/strace/Makefile-ptest.patch +13 -6
index 876c2d8629..07ea0b37f2 100644
@@ -1,19 +1,23 @@
-strace: Add ptest
+From 0574ae9926308dcbca78bd8cd0f0f143f19cbcb5 Mon Sep 17 00:00:00 2001
+From: Gabriel Barbu <[email protected]>
+Date: Thu, 25 Jul 2013 15:28:33 +0200
+Subject: [PATCH 4/8] strace: Add ptest
 
 Upstream-Status: Inappropriate
 
 Signed-off-by: Gabriel Barbu <[email protected]>
 Signed-off-by: Chong Lu <[email protected]>
+
 ---
  configure.ac      |  2 +-
  tests/Makefile.am | 18 ++++++++++++++++++
  2 files changed, 19 insertions(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index b2b03c6..464a9dc 100644
+index 61d6425..6387c24 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -39,7 +39,7 @@ AC_COPYRIGHT([Copyright (C) 1999-2017 The strace developers.])
+@@ -41,7 +41,7 @@ AC_COPYRIGHT([Copyright (C) 1999-]copyright_year[ The strace developers.])
  AC_CONFIG_SRCDIR([strace.c])
  AC_CONFIG_AUX_DIR([.])
  AC_CONFIG_HEADERS([config.h])
@@ -23,11 +27,11 @@ index b2b03c6..464a9dc 100644
  AM_MAINTAINER_MODE
  AC_CANONICAL_HOST
 diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 311d3bb..72f9022 100644
+index 5aa7f89..a55a355 100644
 --- a/tests/Makefile.am
 +++ b/tests/Makefile.am
-@@ -960,3 +960,21 @@ $(objects): scno.h
- CLEANFILES = ksysent.h $(TESTS:=.tmp)
+@@ -379,3 +379,21 @@ clean-local-check:
+ CLEANFILES = ksysent.h
  
  include ../scno.am
 +
@@ -48,3 +52,6 @@ index 311d3bb..72f9022 100644
 +		sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \
 +	done
 +	for i in net net-fd scm_rights-fd sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done
+-- 
+2.13.2
+
meta/recipes-devtools/strace/strace_4.17.bb renamed from meta/recipes-devtools/strace/strace_4.16.bb +3 -2
similarity index 87%
rename from meta/recipes-devtools/strace/strace_4.16.bb
rename to meta/recipes-devtools/strace/strace_4.17.bb
index b6cd2ac9b9..72fa994489 100644
@@ -13,10 +13,11 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
            file://0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch \
            file://mips-SIGEMT.patch \
            file://0001-caps-abbrev.awk-fix-gawk-s-path.patch \
+           file://0008-replace-struct-ucontext-with-ucontext_t.patch \
            "
 
-SRC_URI[md5sum] = "2873366cac98770efcbed6e748d5ef23"
-SRC_URI[sha256sum] = "98487cb5178ec1259986cc9f6e2a844f50e5d1208c112cc22431a1e4d9adf0ef"
+SRC_URI[md5sum] = "8d7eb10eba68bad83a269197e634b626"
+SRC_URI[sha256sum] = "81f35b085fbb3cfa806eb521a8522ac3406deaccfe121ce35064bad268237419"
 
 inherit autotools ptest bluetooth
 
Signature · 1 line
2.13.2
author
#3 lore raw

PATCH 3/4 qemu: Replace use of struct ucontext with ucontext_t

In reply to Khem Raj
---
 ...lace-struct-ucontext-with-ucontext_t-type.patch | 265 +++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_2.8.1.1.bb         |  46 ++--
 2 files changed, 286 insertions(+), 25 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu/0001-replace-struct-ucontext-with-ucontext_t-type.patch
meta/recipes-devtools/qemu/qemu/0001-replace-struct-ucontext-with-ucontext_t-type.patch new file +265 -0
new file mode 100644
index 0000000000..c3eb543ec0
@@ -0,0 +1,265 @@
+From 80954c03163fdbf8b905595a69008093096ee2f6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 28 Jun 2017 13:28:37 -0700
+Subject: [PATCH] replace struct ucontext with ucontext_t type
+
+The ucontext_t type had a tag struct ucontext until now
+but newer glibc will drop it so we need to adjust and use
+the exposed type instead
+
+Signed-off-by: Khem Raj <[email protected]>
+Cc: Kamil Rytarowski <[email protected]>
+Cc: Riku Voipio <[email protected]>
+Cc: Laurent Vivier <[email protected]>
+Cc: Paolo Bonzini <[email protected]>
+
+Upstream-Status: Submitted
+---
+ linux-user/host/aarch64/hostdep.h |  2 +-
+ linux-user/host/arm/hostdep.h     |  2 +-
+ linux-user/host/i386/hostdep.h    |  2 +-
+ linux-user/host/ppc64/hostdep.h   |  2 +-
+ linux-user/host/s390x/hostdep.h   |  2 +-
+ linux-user/host/x86_64/hostdep.h  |  2 +-
+ linux-user/signal.c               | 10 +++++-----
+ tests/tcg/test-i386.c             |  4 ++--
+ user-exec.c                       | 18 +++++++++---------
+ 9 files changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
+index 64f75cef49..a8d41a21ad 100644
+--- a/linux-user/host/aarch64/hostdep.h
++++ b/linux-user/host/aarch64/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     __u64 *pcreg = &uc->uc_mcontext.pc;
+ 
+     if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/arm/hostdep.h b/linux-user/host/arm/hostdep.h
+index 5c1ae60120..9276fe6ceb 100644
+--- a/linux-user/host/arm/hostdep.h
++++ b/linux-user/host/arm/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long *pcreg = &uc->uc_mcontext.arm_pc;
+ 
+     if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/i386/hostdep.h b/linux-user/host/i386/hostdep.h
+index d834bd80ea..073be74d87 100644
+--- a/linux-user/host/i386/hostdep.h
++++ b/linux-user/host/i386/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     greg_t *pcreg = &uc->uc_mcontext.gregs[REG_EIP];
+ 
+     if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/ppc64/hostdep.h b/linux-user/host/ppc64/hostdep.h
+index 0b0f5f7821..98979ad917 100644
+--- a/linux-user/host/ppc64/hostdep.h
++++ b/linux-user/host/ppc64/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long *pcreg = &uc->uc_mcontext.gp_regs[PT_NIP];
+ 
+     if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/s390x/hostdep.h b/linux-user/host/s390x/hostdep.h
+index 6f9da9c608..4f0171f36f 100644
+--- a/linux-user/host/s390x/hostdep.h
++++ b/linux-user/host/s390x/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long *pcreg = &uc->uc_mcontext.psw.addr;
+ 
+     if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/x86_64/hostdep.h b/linux-user/host/x86_64/hostdep.h
+index 3b4259633e..a4fefb5114 100644
+--- a/linux-user/host/x86_64/hostdep.h
++++ b/linux-user/host/x86_64/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     greg_t *pcreg = &uc->uc_mcontext.gregs[REG_RIP];
+ 
+     if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/signal.c b/linux-user/signal.c
+index c750053edd..4638123dd8 100644
+--- a/linux-user/signal.c
++++ b/linux-user/signal.c
+@@ -3170,7 +3170,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
+     *
+     *   a0 = signal number
+     *   a1 = pointer to siginfo_t
+-    *   a2 = pointer to struct ucontext
++    *   a2 = pointer to ucontext_t
+     *
+     * $25 and PC point to the signal handler, $29 points to the
+     * struct sigframe.
+@@ -3557,7 +3557,7 @@ struct target_signal_frame {
+ 
+ struct rt_signal_frame {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+     uint32_t tramp[2];
+ };
+ 
+@@ -3773,7 +3773,7 @@ struct rt_signal_frame {
+     siginfo_t *pinfo;
+     void *puc;
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+     uint16_t retcode[4];      /* Trampoline code. */
+ };
+ 
+@@ -4074,7 +4074,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
+         tswap_siginfo(&frame->info, info);
+     }
+ 
+-    /*err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));*/
++    /*err |= __clear_user(&frame->uc, offsetof(ucontext_t, uc_mcontext));*/
+     __put_user(0, &frame->uc.tuc_flags);
+     __put_user(0, &frame->uc.tuc_link);
+     __put_user(target_sigaltstack_used.ss_sp,
+@@ -4565,7 +4565,7 @@ enum {
+ 
+ struct target_ucontext {
+     target_ulong tuc_flags;
+-    target_ulong tuc_link;    /* struct ucontext __user * */
++    target_ulong tuc_link;    /* ucontext_t __user * */
+     struct target_sigaltstack tuc_stack;
+ #if !defined(TARGET_PPC64)
+     int32_t tuc_pad[7];
+diff --git a/tests/tcg/test-i386.c b/tests/tcg/test-i386.c
+index 0f7b943b0c..9599204895 100644
+--- a/tests/tcg/test-i386.c
++++ b/tests/tcg/test-i386.c
+@@ -1720,7 +1720,7 @@ int tab[2];
+ 
+ void sig_handler(int sig, siginfo_t *info, void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ 
+     printf("si_signo=%d si_errno=%d si_code=%d",
+            info->si_signo, info->si_errno, info->si_code);
+@@ -1912,7 +1912,7 @@ void test_exceptions(void)
+ /* specific precise single step test */
+ void sig_trap_handler(int sig, siginfo_t *info, void *puc)
+ {
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     printf("EIP=" FMTLX "\n", (long)uc->uc_mcontext.gregs[REG_EIP]);
+ }
+ 
+diff --git a/user-exec.c b/user-exec.c
+index 6db075884d..3f1b899e3d 100644
+--- a/user-exec.c
++++ b/user-exec.c
+@@ -155,7 +155,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #elif defined(__OpenBSD__)
+     struct sigcontext *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+     unsigned long pc;
+     int trapno;
+@@ -210,7 +210,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #elif defined(__OpenBSD__)
+     struct sigcontext *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+ 
+     pc = PC_sig(uc);
+@@ -277,7 +277,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+     ucontext_t *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+     unsigned long pc;
+     int is_write;
+@@ -304,7 +304,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                            void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     uint32_t *pc = uc->uc_mcontext.sc_pc;
+     uint32_t insn = *pc;
+     int is_write = 0;
+@@ -402,7 +402,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #if defined(__NetBSD__)
+     ucontext_t *uc = puc;
+ #else
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+ #endif
+     unsigned long pc;
+     int is_write;
+@@ -429,7 +429,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     uintptr_t pc = uc->uc_mcontext.pc;
+     uint32_t insn = *(uint32_t *)pc;
+     bool is_write;
+@@ -462,7 +462,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long ip;
+     int is_write = 0;
+ 
+@@ -493,7 +493,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                        void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     unsigned long pc;
+     uint16_t *pinsn;
+     int is_write = 0;
+@@ -546,7 +546,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+                        void *puc)
+ {
+     siginfo_t *info = pinfo;
+-    struct ucontext *uc = puc;
++    ucontext_t *uc = puc;
+     greg_t pc = uc->uc_mcontext.pc;
+     int is_write;
+ 
+-- 
+2.13.2
+
meta/recipes-devtools/qemu/qemu_2.8.1.1.bb +21 -25

58 lines not on this page · raw message

Signature · 1 line
2.13.2
author
#4 lore raw

PATCH 4/4 epiphany: Fix build errors when compiling with security flags

In reply to Khem Raj

We need to have some level of optimization level for FORTIFY_SOURCE to work therefore set --enable-debug=no

Add a patch to fix build error due to unused result of fread

---
 meta/recipes-gnome/epiphany/epiphany_3.24.2.bb     |  6 ++--
 ...bookmarks-Check-for-return-value-of-fread.patch | 32 ++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-gnome/epiphany/files/0001-bookmarks-Check-for-return-value-of-fread.patch
meta/recipes-gnome/epiphany/epiphany_3.24.2.bb +4 -2
index 77c19331cb..dafad8a793 100644
@@ -9,11 +9,13 @@ DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes avahi libnotify gcr \
 inherit gnomebase gsettings distro_features_check upstream-version-is-even gettext
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch"
+SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch \
+            file://0001-bookmarks-Check-for-return-value-of-fread.patch \
+           "
 SRC_URI[archive.md5sum] = "e035dc6f64f0c1909de823e03f16b2f3"
 SRC_URI[archive.sha256sum] = "5abc0d0c60591df5236ac9b8979dc9f7d9acbb8ad0902b4772d2b7beea81c58d"
 
-EXTRA_OECONF += " --with-distributor-name=${DISTRO}"
+EXTRA_OECONF += " --with-distributor-name=${DISTRO} --enable-debug=no"
 
 do_configure_prepend() {
     sed -i -e s:help::g ${S}/Makefile.am
meta/recipes-gnome/epiphany/files/0001-bookmarks-Check-for-return-value-of-fread.patch new file +32 -0
new file mode 100644
index 0000000000..ddcd39400c
@@ -0,0 +1,32 @@
+From aa2176be32eed2578da82f34d31148f934c11c34 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 28 Jun 2017 17:03:45 -0700
+Subject: [PATCH] bookmarks: Check for return value of fread()
+
+Fixes below compiler error
+ignoring return value of 'fread', declared with attribute warn_unused_result
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/bookmarks/ephy-bookmark.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/bookmarks/ephy-bookmark.c b/src/bookmarks/ephy-bookmark.c
+index ff0239b..8633ce4 100644
+--- a/src/bookmarks/ephy-bookmark.c
++++ b/src/bookmarks/ephy-bookmark.c
+@@ -217,7 +217,8 @@ ephy_bookmark_init (EphyBookmark *self)
+   bytes = g_malloc (num_bytes);
+ 
+   fp = fopen ("/dev/urandom", "r");
+-  fread (bytes, sizeof (guint8), num_bytes, fp);
++  if (fread (bytes, sizeof (guint8), num_bytes, fp) != num_bytes)
++    g_warning("Unable to read data from /dev/urandom\n");
+ 
+   self->id = g_malloc0 (ID_LEN + 1);
+   for (gsize i = 0; i < num_bytes; i++) {
+-- 
+2.13.2
+
Signature · 1 line
2.13.2