All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-browser][PATCH 1/3] firefox: Fix build with x86_64/musl
@ 2017-07-10 21:09 Khem Raj
  2017-07-10 21:09 ` [meta-browser][PATCH 2/3] chromium: Fix build on musl/x86_64 Khem Raj
  2017-07-10 21:09 ` [meta-browser][PATCH 3/3] firefox: Fix host library contamination on x86_64 Khem Raj
  0 siblings, 2 replies; 3+ messages in thread
From: Khem Raj @ 2017-07-10 21:09 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0005-original-patch-fix_off64_t.patch.patch    | 63 +++++++++++++++
 .../0006-original-patch-getcontext.patch.patch     | 30 ++++++++
 .../0007-original-patch-basename.patch.patch       | 51 ++++++++++++
 ...original-patch-musl-missing-headers.patch.patch | 32 ++++++++
 .../firefox/0009-original-patch-stab.h.patch.patch | 90 ++++++++++++++++++++++
 .../firefox/firefox/0010-Define-N_UNDF.patch       | 31 ++++++++
 ...-libav-with-sysctl-on-Unix-it-s-not-used-.patch | 30 ++++++++
 ...alls-siginfo_t-member-__si_fields-instead.patch | 30 ++++++++
 recipes-mozilla/firefox/firefox_45.9.0esr.bb       |  8 ++
 9 files changed, 365 insertions(+)
 create mode 100644 recipes-mozilla/firefox/firefox/0005-original-patch-fix_off64_t.patch.patch
 create mode 100644 recipes-mozilla/firefox/firefox/0006-original-patch-getcontext.patch.patch
 create mode 100644 recipes-mozilla/firefox/firefox/0007-original-patch-basename.patch.patch
 create mode 100644 recipes-mozilla/firefox/firefox/0008-original-patch-musl-missing-headers.patch.patch
 create mode 100644 recipes-mozilla/firefox/firefox/0009-original-patch-stab.h.patch.patch
 create mode 100644 recipes-mozilla/firefox/firefox/0010-Define-N_UNDF.patch
 create mode 100644 recipes-mozilla/firefox/firefox/0011-Don-t-build-libav-with-sysctl-on-Unix-it-s-not-used-.patch
 create mode 100644 recipes-mozilla/firefox/firefox/0012-musl-libc-calls-siginfo_t-member-__si_fields-instead.patch

diff --git a/recipes-mozilla/firefox/firefox/0005-original-patch-fix_off64_t.patch.patch b/recipes-mozilla/firefox/firefox/0005-original-patch-fix_off64_t.patch.patch
new file mode 100644
index 0000000..ea6ff87
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0005-original-patch-fix_off64_t.patch.patch
@@ -0,0 +1,63 @@
+From b1a3d3332e74b5a1bcf2a4fb7e08f3dece08318c Mon Sep 17 00:00:00 2001
+From: OpenEmbedded <oe.patch@oe>
+Date: Sat, 8 Jul 2017 15:57:20 -0700
+Subject: [PATCH 05/12] %% original patch: fix_off64_t.patch
+
+---
+ toolkit/crashreporter/google-breakpad/src/common/moz.build           | 5 +++--
+ .../google-breakpad/src/third_party/lss/linux_syscall_support.h      | 2 +-
+ tools/profiler/core/platform.h                                       | 2 +-
+ 3 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/toolkit/crashreporter/google-breakpad/src/common/moz.build b/toolkit/crashreporter/google-breakpad/src/common/moz.build
+index 6456e2864..9aec5afd3 100644
+--- a/toolkit/crashreporter/google-breakpad/src/common/moz.build
++++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build
+@@ -35,8 +35,8 @@ if CONFIG['OS_ARCH'] == 'Linux':
+         'linux/dump_symbols.cc',
+         'linux/elf_symbols_to_module.cc',
+     ]
+-    HOST_DEFINES['HAVE_A_OUT_H'] = True
+-    DEFINES['HAVE_A_OUT_H'] = True
++    HOST_DEFINES['HAVE_A_OUT_H'] = False
++    DEFINES['HAVE_A_OUT_H'] = False
+ 
+ if CONFIG['OS_ARCH'] == 'Darwin' and CONFIG['HOST_OS_ARCH'] != 'Darwin':
+     HOST_CXXFLAGS += [
+@@ -98,6 +98,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+ 
+ if CONFIG['OS_TARGET'] == 'Android':
+     DEFINES['NO_STABS_SUPPORT'] = True
++DEFINES['NO_STABS_SUPPORT'] = True
+ 
+ DEFINES['BP_LOGGING_INCLUDE'] = '"BreakpadLogging.h"'
+ 
+diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+index 18277490f..b67d3a92d 100644
+--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
++++ b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+@@ -2814,7 +2814,7 @@ struct kernel_statfs {
+     LSS_INLINE _syscall6(void*, mmap,              void*, s,
+                          size_t,                   l, int,               p,
+                          int,                      f, int,               d,
+-                         __off64_t,                o)
++                         off64_t,                o)
+ 
+     LSS_INLINE _syscall4(int, newfstatat,         int,   d,
+                          const char *,            p,
+diff --git a/tools/profiler/core/platform.h b/tools/profiler/core/platform.h
+index 5d2e25c8e..4917e5b8e 100644
+--- a/tools/profiler/core/platform.h
++++ b/tools/profiler/core/platform.h
+@@ -61,7 +61,7 @@
+ 
+ // We need a definition of gettid(), but glibc doesn't provide a
+ // wrapper for it.
+-#if defined(__GLIBC__)
++#if defined(__linux__)
+ #include <unistd.h>
+ #include <sys/syscall.h>
+ static inline pid_t gettid()
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox/0006-original-patch-getcontext.patch.patch b/recipes-mozilla/firefox/firefox/0006-original-patch-getcontext.patch.patch
new file mode 100644
index 0000000..c8b101e
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0006-original-patch-getcontext.patch.patch
@@ -0,0 +1,30 @@
+From ba081ed6eb612d72e0d9deb5cf40aa6f8ff5380a Mon Sep 17 00:00:00 2001
+From: OpenEmbedded <oe.patch@oe>
+Date: Sat, 8 Jul 2017 15:57:22 -0700
+Subject: [PATCH 06/12] %% original patch: getcontext.patch
+
+---
+ tools/profiler/core/platform-linux.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tools/profiler/core/platform-linux.cc b/tools/profiler/core/platform-linux.cc
+index 0df1e8f08..d8688959d 100644
+--- a/tools/profiler/core/platform-linux.cc
++++ b/tools/profiler/core/platform-linux.cc
+@@ -711,11 +711,13 @@ void OS::Startup() {
+ void TickSample::PopulateContext(void* aContext)
+ {
+   MOZ_ASSERT(aContext);
++#if defined(__GLIBC__)
+   ucontext_t* pContext = reinterpret_cast<ucontext_t*>(aContext);
+   if (!getcontext(pContext)) {
+     context = pContext;
+     SetSampleContext(this, aContext);
+   }
++#endif
+ }
+ 
+ void OS::SleepMicro(int microseconds)
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox/0007-original-patch-basename.patch.patch b/recipes-mozilla/firefox/firefox/0007-original-patch-basename.patch.patch
new file mode 100644
index 0000000..7b50fa3
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0007-original-patch-basename.patch.patch
@@ -0,0 +1,51 @@
+From 66661ee35dabc01ee712c2ad23f93f999c61787d Mon Sep 17 00:00:00 2001
+From: OpenEmbedded <oe.patch@oe>
+Date: Sat, 8 Jul 2017 15:57:25 -0700
+Subject: [PATCH 07/12] %% original patch: basename.patch
+
+---
+ .../google-breakpad/src/common/linux/dump_symbols.cc              | 8 ++++----
+ tools/profiler/lul/LulElf.cpp                                     | 8 ++++----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
+index 8e379a7ec..3eecc78cf 100644
+--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
++++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
+@@ -828,10 +828,10 @@ string FormatIdentifier(unsigned char identifier[16]) {
+ // Return the non-directory portion of FILENAME: the portion after the
+ // last slash, or the whole filename if there are no slashes.
+ string BaseFileName(const string &filename) {
+-  // Lots of copies!  basename's behavior is less than ideal.
+-  char *c_filename = strdup(filename.c_str());
+-  string base = basename(c_filename);
+-  free(c_filename);
++  // basename's behavior is less than ideal so avoid it
++  const char *c_filename = filename.c_str();
++  const char *p = strrchr(c_filename, '/');
++  string base = p ? p+1 : c_filename;
+   return base;
+ }
+ 
+diff --git a/tools/profiler/lul/LulElf.cpp b/tools/profiler/lul/LulElf.cpp
+index a9221370d..d01dde10e 100644
+--- a/tools/profiler/lul/LulElf.cpp
++++ b/tools/profiler/lul/LulElf.cpp
+@@ -483,10 +483,10 @@ string FormatIdentifier(unsigned char identifier[16]) {
+ // Return the non-directory portion of FILENAME: the portion after the
+ // last slash, or the whole filename if there are no slashes.
+ string BaseFileName(const string &filename) {
+-  // Lots of copies!  basename's behavior is less than ideal.
+-  char *c_filename = strdup(filename.c_str());
+-  string base = basename(c_filename);
+-  free(c_filename);
++  // basename's behavior is less than ideal so avoid it
++  const char *c_filename = filename.c_str();
++  const char *p = strrchr(c_filename, '/');
++  string base = p ? p+1 : c_filename;
+   return base;
+ }
+ 
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox/0008-original-patch-musl-missing-headers.patch.patch b/recipes-mozilla/firefox/firefox/0008-original-patch-musl-missing-headers.patch.patch
new file mode 100644
index 0000000..8198863
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0008-original-patch-musl-missing-headers.patch.patch
@@ -0,0 +1,32 @@
+From 68aa10845658bd4493e35e37d636002f87b57486 Mon Sep 17 00:00:00 2001
+From: OpenEmbedded <oe.patch@oe>
+Date: Sat, 8 Jul 2017 15:57:27 -0700
+Subject: [PATCH 08/12] %% original patch: musl-missing-headers.patch
+
+---
+ config/system-headers | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/config/system-headers b/config/system-headers
+index 403fa8d95..0fc063530 100644
+--- a/config/system-headers
++++ b/config/system-headers
+@@ -420,7 +420,6 @@ execinfo.h
+ extras.h
+ fabdef.h
+ fcntl.h
+-features.h
+ fibdef.h
+ File.h
+ filehdr.h
+@@ -1065,7 +1064,6 @@ sys/statfs.h
+ sys/stat.h
+ sys/statvfs.h
+ sys/syscall.h
+-sys/sysctl.h
+ sys/sysinfo.h
+ sys/sysmp.h
+ sys/syssgi.h
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox/0009-original-patch-stab.h.patch.patch b/recipes-mozilla/firefox/firefox/0009-original-patch-stab.h.patch.patch
new file mode 100644
index 0000000..b21cedc
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0009-original-patch-stab.h.patch.patch
@@ -0,0 +1,90 @@
+From ce9582578067a34d419e4e3bb615c7485f98ca8e Mon Sep 17 00:00:00 2001
+From: OpenEmbedded <oe.patch@oe>
+Date: Sat, 8 Jul 2017 15:57:30 -0700
+Subject: [PATCH 09/12] %% original patch: stab.h.patch
+
+---
+ toolkit/crashreporter/google-breakpad/src/stab.h | 71 ++++++++++++++++++++++++
+ 1 file changed, 71 insertions(+)
+ create mode 100644 toolkit/crashreporter/google-breakpad/src/stab.h
+
+diff --git a/toolkit/crashreporter/google-breakpad/src/stab.h b/toolkit/crashreporter/google-breakpad/src/stab.h
+new file mode 100644
+index 000000000..6f70af398
+--- /dev/null
++++ b/toolkit/crashreporter/google-breakpad/src/stab.h
+@@ -0,0 +1,71 @@
++/*	$OpenBSD: stab.h,v 1.3 2003/06/02 19:34:12 millert Exp $	*/
++/*	$NetBSD: stab.h,v 1.4 1994/10/26 00:56:25 cgd Exp $	*/
++
++/*-
++ * Copyright (c) 1991 The Regents of the University of California.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ *	@(#)stab.h	5.2 (Berkeley) 4/4/91
++ */
++
++#ifndef _STAB_H_
++#define _STAB_H_
++
++/*
++ * The following are symbols used by various debuggers and by the Pascal
++ * compiler.  Each of them must have one (or more) of the bits defined by
++ * the N_STAB mask set.
++ */
++
++#define	N_GSYM		0x20	/* global symbol */
++#define	N_FNAME		0x22	/* F77 function name */
++#define	N_FUN		0x24	/* procedure name */
++#define	N_STSYM		0x26	/* data segment variable */
++#define	N_LCSYM		0x28	/* bss segment variable */
++#define	N_MAIN		0x2a	/* main function name */
++#define	N_PC		0x30	/* global Pascal symbol */
++#define	N_RSYM		0x40	/* register variable */
++#define	N_SLINE		0x44	/* text segment line number */
++#define	N_DSLINE	0x46	/* data segment line number */
++#define	N_BSLINE	0x48	/* bss segment line number */
++#define	N_SSYM		0x60	/* structure/union element */
++#define	N_SO		0x64	/* main source file name */
++#define	N_LSYM		0x80	/* stack variable */
++#define	N_BINCL		0x82	/* include file beginning */
++#define	N_SOL		0x84	/* included source file name */
++#define	N_PSYM		0xa0	/* parameter variable */
++#define	N_EINCL		0xa2	/* include file end */
++#define	N_ENTRY		0xa4	/* alternate entry point */
++#define	N_LBRAC		0xc0	/* left bracket */
++#define	N_EXCL		0xc2	/* deleted include file */
++#define	N_RBRAC		0xe0	/* right bracket */
++#define	N_BCOMM		0xe2	/* begin common */
++#define	N_ECOMM		0xe4	/* end common */
++#define	N_ECOML		0xe8	/* end common (local name) */
++#define	N_LENG		0xfe	/* length of preceding entry */
++
++#endif /* !_STAB_H_ */
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox/0010-Define-N_UNDF.patch b/recipes-mozilla/firefox/firefox/0010-Define-N_UNDF.patch
new file mode 100644
index 0000000..7baae8f
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0010-Define-N_UNDF.patch
@@ -0,0 +1,31 @@
+From 86544a22d8f241b3ba2545f470831edc019c6638 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Jul 2017 16:08:43 -0700
+Subject: [PATCH 10/12] Define N_UNDF
+
+Fixes
+error: 'N_UNDF' was not declared in this scope
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ toolkit/crashreporter/google-breakpad/src/stab.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/toolkit/crashreporter/google-breakpad/src/stab.h b/toolkit/crashreporter/google-breakpad/src/stab.h
+index 6f70af398..8fb2ffc97 100644
+--- a/toolkit/crashreporter/google-breakpad/src/stab.h
++++ b/toolkit/crashreporter/google-breakpad/src/stab.h
+@@ -41,6 +41,10 @@
+  * the N_STAB mask set.
+  */
+ 
++#if !defined (N_UNDF)
++#define N_UNDF 0
++#endif
++
+ #define	N_GSYM		0x20	/* global symbol */
+ #define	N_FNAME		0x22	/* F77 function name */
+ #define	N_FUN		0x24	/* procedure name */
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox/0011-Don-t-build-libav-with-sysctl-on-Unix-it-s-not-used-.patch b/recipes-mozilla/firefox/firefox/0011-Don-t-build-libav-with-sysctl-on-Unix-it-s-not-used-.patch
new file mode 100644
index 0000000..4afb804
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0011-Don-t-build-libav-with-sysctl-on-Unix-it-s-not-used-.patch
@@ -0,0 +1,30 @@
+From b31468e975212556f1d8c7d5d2cf8f3313496803 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Jul 2017 16:27:06 -0700
+Subject: [PATCH 11/12] Don't build libav with sysctl on Unix (it's not used
+ anyway)
+
+backported from
+https://hg.mozilla.org/integration/mozilla-inbound/rev/081c52bae5e7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ media/libav/config_unix.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/media/libav/config_unix.h b/media/libav/config_unix.h
+index 3921293a0..b3c44d62b 100644
+--- a/media/libav/config_unix.h
++++ b/media/libav/config_unix.h
+@@ -219,7 +219,7 @@
+ #define HAVE_STRERROR_R 1
+ #define HAVE_STRPTIME 1
+ #define HAVE_SYSCONF 1
+-#define HAVE_SYSCTL 1
++#define HAVE_SYSCTL 0
+ #define HAVE_USLEEP 1
+ #define HAVE_VIRTUALALLOC 0
+ #define HAVE_PTHREADS 0
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox/0012-musl-libc-calls-siginfo_t-member-__si_fields-instead.patch b/recipes-mozilla/firefox/firefox/0012-musl-libc-calls-siginfo_t-member-__si_fields-instead.patch
new file mode 100644
index 0000000..9b9af86
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/0012-musl-libc-calls-siginfo_t-member-__si_fields-instead.patch
@@ -0,0 +1,30 @@
+From 92e6fdcc84c69ae25e9d4ed9e1e9c3203afeeaea Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Jul 2017 16:37:03 -0700
+Subject: [PATCH 12/12] musl libc calls siginfo_t member __si_fields instead of
+ _sifields
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
+index dce6b7b85..5b2e2cc02 100644
+--- a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
++++ b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
+@@ -23,6 +23,11 @@
+ #include "sandbox/linux/services/android_ucontext.h"
+ #endif
+ 
++// musl libc defines siginfo_t __si_fields instead of _sifields
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ namespace {
+ 
+ struct arch_sigsys {
+-- 
+2.13.2
+
diff --git a/recipes-mozilla/firefox/firefox_45.9.0esr.bb b/recipes-mozilla/firefox/firefox_45.9.0esr.bb
index 5087df0..55b2f3c 100644
--- a/recipes-mozilla/firefox/firefox_45.9.0esr.bb
+++ b/recipes-mozilla/firefox/firefox_45.9.0esr.bb
@@ -50,6 +50,14 @@ SRC_URI_append_libc-musl = "\
            file://0002-disable-hunspell-hooks.patch \
            file://0003-define-TEMP_FAILURE_RETRY.patch \
            file://0004-Fix-mozilla-arm-builds.patch \
+           file://0005-original-patch-fix_off64_t.patch.patch \
+           file://0006-original-patch-getcontext.patch.patch \
+           file://0007-original-patch-basename.patch.patch \
+           file://0008-original-patch-musl-missing-headers.patch.patch \
+           file://0009-original-patch-stab.h.patch.patch \
+           file://0010-Define-N_UNDF.patch \
+           file://0011-Don-t-build-libav-with-sysctl-on-Unix-it-s-not-used-.patch \
+           file://0012-musl-libc-calls-siginfo_t-member-__si_fields-instead.patch \
 "
 
 SRC_URI[archive.md5sum] = "f4d83c5150fc5085db20d71862497eb8"
-- 
2.13.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [meta-browser][PATCH 2/3] chromium: Fix build on musl/x86_64
  2017-07-10 21:09 [meta-browser][PATCH 1/3] firefox: Fix build with x86_64/musl Khem Raj
@ 2017-07-10 21:09 ` Khem Raj
  2017-07-10 21:09 ` [meta-browser][PATCH 3/3] firefox: Fix host library contamination on x86_64 Khem Raj
  1 sibling, 0 replies; 3+ messages in thread
From: Khem Raj @ 2017-07-10 21:09 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 recipes-browser/chromium/chromium-browser.inc      |  2 +
 ...017-Use-_fpstate-instead-of-_libc_fpstate.patch | 65 ++++++++++++++++++++++
 ...tcmalloc-Use-off64_t-insread-of-__off64_t.patch | 26 +++++++++
 3 files changed, 93 insertions(+)
 create mode 100644 recipes-browser/chromium/chromium/0017-Use-_fpstate-instead-of-_libc_fpstate.patch
 create mode 100644 recipes-browser/chromium/chromium/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch

diff --git a/recipes-browser/chromium/chromium-browser.inc b/recipes-browser/chromium/chromium-browser.inc
index a1e22d6..094a3d3 100644
--- a/recipes-browser/chromium/chromium-browser.inc
+++ b/recipes-browser/chromium/chromium-browser.inc
@@ -49,6 +49,8 @@ SRC_URI_append_libc-musl = "\
            file://0014-link-with-libexecinfo-on-musl.patch \
            file://0015-metrics-Keep-GNU-extentions-effective-only-when-usin.patch \
            file://0016-getcontext-API-is-unimplemented-in-musl.patch \
+           file://0017-Use-_fpstate-instead-of-_libc_fpstate.patch \
+           file://0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch \
 "
 
 S = "${WORKDIR}/chromium-${PV}"
diff --git a/recipes-browser/chromium/chromium/0017-Use-_fpstate-instead-of-_libc_fpstate.patch b/recipes-browser/chromium/chromium/0017-Use-_fpstate-instead-of-_libc_fpstate.patch
new file mode 100644
index 0000000..d4f3f49
--- /dev/null
+++ b/recipes-browser/chromium/chromium/0017-Use-_fpstate-instead-of-_libc_fpstate.patch
@@ -0,0 +1,65 @@
+From ccfd39487d142eafd882a5f35664a1b6cf589f13 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Jul 2017 09:07:02 -0700
+Subject: [PATCH 1/2] Use _fpstate instead of _libc_fpstate
+
+_libc_fpstate is not available on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc | 4 ++--
+ breakpad/src/client/linux/dump_writer_common/ucontext_reader.h  | 2 +-
+ breakpad/src/client/linux/minidump_writer/minidump_writer.h     | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 93b4d9f85..57d5b377d 100644
+--- a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fp) {
++                                    const struct _fpstate* fp) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fpregs) {
++                                    const struct _fpstate* fpregs) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index 2369a9ad3..658fddbde 100644
+--- a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+   //   info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                             const struct _libc_fpstate* fp);
++                             const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
+diff --git a/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d13fb120b..7945ac5b2 100644
+--- a/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+ 
+ // These entries store a list of memory regions that the client wants included
+-- 
+2.13.2
+
diff --git a/recipes-browser/chromium/chromium/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch b/recipes-browser/chromium/chromium/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch
new file mode 100644
index 0000000..2ef5433
--- /dev/null
+++ b/recipes-browser/chromium/chromium/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch
@@ -0,0 +1,26 @@
+From 1a468dd5239ebdf013d9ffb3a2d181d0434b4c6c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Jul 2017 09:08:23 -0700
+Subject: [PATCH 2/2] tcmalloc: Use off64_t insread of __off64_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ third_party/tcmalloc/chromium/src/base/linux_syscall_support.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h b/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
+index b53dd46c5..58da4d19d 100644
+--- a/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
++++ b/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
+@@ -1930,7 +1930,7 @@ typedef unsigned long int ulong;
+   #if defined(__x86_64__)
+     /* Need to make sure __off64_t isn't truncated to 32-bits under x32.  */
+     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
+-                                    __off64_t o) {
++                                    off64_t o) {
+       LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l),
+                                LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f),
+                                LSS_SYSCALL_ARG(d), (uint64_t)(o));
+-- 
+2.13.2
+
-- 
2.13.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [meta-browser][PATCH 3/3] firefox: Fix host library contamination on x86_64
  2017-07-10 21:09 [meta-browser][PATCH 1/3] firefox: Fix build with x86_64/musl Khem Raj
  2017-07-10 21:09 ` [meta-browser][PATCH 2/3] chromium: Fix build on musl/x86_64 Khem Raj
@ 2017-07-10 21:09 ` Khem Raj
  1 sibling, 0 replies; 3+ messages in thread
From: Khem Raj @ 2017-07-10 21:09 UTC (permalink / raw)
  To: openembedded-devel

On x86_64 build system starts to poke into build system libraries
and its especially seen with glibc 2.26 since it has deprecated
certain symbols which are not available in libc

e.g.

/usr/lib/libresolv.so.2: undefined reference to `__res_maybe_init@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status

So its linking to libresolv.so from host system is clear due to this error
because its then using libc.so from cross build which is glibc 2.26
and doesnt have that symbol.

Explicilty specify -lresolv on linker cmdline for components where its
needed.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../firefox/firefox/add-libresolv.patch            | 40 ++++++++++++++++++++++
 recipes-mozilla/firefox/firefox_45.9.0esr.bb       |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 recipes-mozilla/firefox/firefox/add-libresolv.patch

diff --git a/recipes-mozilla/firefox/firefox/add-libresolv.patch b/recipes-mozilla/firefox/firefox/add-libresolv.patch
new file mode 100644
index 0000000..4bd0131
--- /dev/null
+++ b/recipes-mozilla/firefox/firefox/add-libresolv.patch
@@ -0,0 +1,40 @@
+Index: firefox-45.9.0esr/webapprt/gtk/moz.build
+===================================================================
+--- firefox-45.9.0esr.orig/webapprt/gtk/moz.build
++++ firefox-45.9.0esr/webapprt/gtk/moz.build
+@@ -24,3 +24,7 @@ DISABLE_STL_WRAPPING = True
+ CXXFLAGS += CONFIG['TK_CFLAGS']
+ 
+ OS_LIBS += CONFIG['TK_LIBS']
++OS_LIBS += [
++    'resolv',
++]
++
+Index: firefox-45.9.0esr/ipc/app/moz.build
+===================================================================
+--- firefox-45.9.0esr.orig/ipc/app/moz.build
++++ firefox-45.9.0esr/ipc/app/moz.build
+@@ -129,6 +129,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
+         'binder',
+         'utils',
+     ]
++OS_LIBS += [
++    'resolv',
++]
+ 
+ if CONFIG['GNU_CXX']:
+     CXXFLAGS += ['-Wshadow']
+Index: firefox-45.9.0esr/js/xpconnect/shell/moz.build
+===================================================================
+--- firefox-45.9.0esr.orig/js/xpconnect/shell/moz.build
++++ firefox-45.9.0esr/js/xpconnect/shell/moz.build
+@@ -35,6 +35,9 @@ if CONFIG['OS_ARCH'] == 'WINNT':
+ CFLAGS += CONFIG['TK_CFLAGS']
+ CXXFLAGS += CONFIG['TK_CFLAGS']
+ OS_LIBS += CONFIG['TK_LIBS']
++OS_LIBS += [
++    'resolv',
++]
+ 
+ if CONFIG['GNU_CXX']:
+     CXXFLAGS += ['-Wshadow']
diff --git a/recipes-mozilla/firefox/firefox_45.9.0esr.bb b/recipes-mozilla/firefox/firefox_45.9.0esr.bb
index 55b2f3c..3f2fbe0 100644
--- a/recipes-mozilla/firefox/firefox_45.9.0esr.bb
+++ b/recipes-mozilla/firefox/firefox_45.9.0esr.bb
@@ -44,6 +44,7 @@ SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}/source/firefox
            file://0003-do-not-link-against-crmf-library-it-is-not-there.patch \
            file://gcc7.patch \
            file://remove_AC_PATH_XTRA.patch \
+           file://add-libresolv.patch \
 "
 SRC_URI_append_libc-musl = "\
            file://0001-mallinfo-is-glibc-specific-API.patch \
-- 
2.13.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-10 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10 21:09 [meta-browser][PATCH 1/3] firefox: Fix build with x86_64/musl Khem Raj
2017-07-10 21:09 ` [meta-browser][PATCH 2/3] chromium: Fix build on musl/x86_64 Khem Raj
2017-07-10 21:09 ` [meta-browser][PATCH 3/3] firefox: Fix host library contamination on x86_64 Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.