firefox-kde: add gentoo and Arch patch

This commit is contained in:
Chaoting Liu 2018-05-12 13:35:39 +01:00
parent 318d9cc367
commit cd3df2c96d
8 changed files with 14450 additions and 19 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
From: Jory A. Pratt <anarchy@gentoo.org>
CFLAGS must contain -fPIC when checking the linker
diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -205,23 +205,26 @@ MOZ_PIE=
MOZ_ARG_ENABLE_BOOL(pie,
[ --enable-pie Enable Position Independent Executables],
MOZ_PIE=1,
MOZ_PIE= )
if test "$GNU_CC$CLANG_CC" -a -n "$MOZ_PIE"; then
AC_MSG_CHECKING([for PIE support])
+ _SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -fPIC"
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS -pie"
AC_TRY_LINK(,,AC_MSG_RESULT([yes])
[MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -pie"],
AC_MSG_RESULT([no])
AC_MSG_ERROR([--enable-pie requires PIE support from the linker.]))
LDFLAGS=$_SAVE_LDFLAGS
+ CFLAGS=$_SAVE_CFLAGS
fi
AC_SUBST(MOZ_PROGRAM_LDFLAGS)
dnl ASan assumes no symbols are being interposed, and when that happens,
dnl it's not happy with it. Unconveniently, since Firefox is exporting
dnl libffi symbols and Gtk+3 pulls system libffi via libwayland-client,
dnl system libffi interposes libffi symbols that ASan assumes are in

View File

@ -0,0 +1,42 @@
From: Jory A. Pratt <anarchy@gentoo.org>
Ensure we fortify properly, features.h is pulled in via fortification.
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -224,17 +224,16 @@ system_headers = [
'Events.h',
'exception',
'exdisp.h',
'ExDisp.h',
'exe386.h',
'execinfo.h',
'extras.h',
'fcntl.h',
- 'features.h',
'fenv.h',
'ffi.h',
'fibdef.h',
'File.h',
'filehdr.h',
'files.h',
'Files.h',
'FindDirectory.h',
diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h b/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h
@@ -15,13 +15,10 @@
/* Use operating system malloc */
#define SDP_MALLOC(x) calloc(1, (x))
#define SDP_FREE free
typedef uint8_t tinybool;
typedef unsigned short ushort;
typedef unsigned long ulong;
-#ifndef __GNUC_STDC_INLINE__
-#define inline
-#endif
#endif /* _SDP_OS_DEFS_H_ */

View File

@ -0,0 +1,258 @@
From: Jan Beich <jbeich@FreeBSD.org>
Add ability to use system-harfbuzz instead of bundled.
https://bugzilla.mozilla.org/show_bug.cgi?id=847568
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1227,16 +1227,23 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
'utils/TypeHelpers.h',
'utils/Unicode.h',
'utils/Vector.h',
'utils/VectorImpl.h',
'vr/gvr/capi/include/gvr_controller.h',
'vr/gvr/capi/include/gvr.h',
]
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ system_headers += [
+ 'harfbuzz/hb-glib.h',
+ 'harfbuzz/hb-ot.h',
+ 'harfbuzz/hb.h',
+ ]
+
if CONFIG['MOZ_JACK']:
system_headers += [
'jack/jack.h',
'jack/statistics.h',
]
if CONFIG['MOZ_SYSTEM_JPEG']:
system_headers += [
diff --git a/dom/base/moz.build b/dom/base/moz.build
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -472,16 +472,19 @@ include('/ipc/chromium/chromium-config.m
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
DEFINES['HAVE_SIDEBAR'] = True
if CONFIG['MOZ_X11']:
CXXFLAGS += CONFIG['TK_CFLAGS']
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
GENERATED_FILES += [
'PropertyUseCounterMap.inc',
'UseCounterList.h',
]
countermap = GENERATED_FILES['PropertyUseCounterMap.inc']
countermap.script = 'gen-usecounters.py:property_map'
countermap.inputs = ['UseCounters.conf']
diff --git a/gfx/harfbuzz/README-mozilla b/gfx/harfbuzz/README-mozilla
--- a/gfx/harfbuzz/README-mozilla
+++ b/gfx/harfbuzz/README-mozilla
@@ -14,8 +14,13 @@ this file when updating HarfBuzz, and ch
The normal approach to updating HarfBuzz, therefore, is to pull the latest HB
source into a scratch directory and do a local build; then copy the original
sources AND the generated header mentioned above from the build directory into
the mozilla tree.
If the collection of source files changes, manual updates to moz.build may be
needed, as we don't use the upstream makefiles.
+
+The in-tree copy may be omitted during build by --with-system-harfbuzz.
+Make sure to keep pkg-config version check within toolkit/moz.configure in sync
+with checkout version or increment latest tag by one if it's not based
+on upstream release.
diff --git a/gfx/moz.build b/gfx/moz.build
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -5,26 +5,28 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('**'):
BUG_COMPONENT = ('Core', 'Graphics')
if CONFIG['MOZ_TREE_CAIRO']:
DIRS += ['cairo']
+if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ DIRS += ['harfbuzz/src']
+
DIRS += [
'2d',
'ycbcr',
'angle',
'src',
'qcms',
'gl',
'layers',
'graphite2/src',
- 'harfbuzz/src',
'ots/src',
'thebes',
'ipc',
'vr',
'config',
'webrender_bindings',
]
diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -132,16 +132,19 @@ if CONFIG['CC_TYPE'] == 'gcc':
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
CXXFLAGS += [
'-Wno-implicit-fallthrough',
'-Wno-inconsistent-missing-override',
'-Wno-macro-redefined',
'-Wno-unused-private-field',
]
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
if CONFIG['MOZ_ENABLE_SKIA_PDF_SFNTLY']:
diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -777,16 +777,19 @@ if CONFIG['CC_TYPE'] == 'gcc':
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
CXXFLAGS += [
'-Wno-implicit-fallthrough',
'-Wno-inconsistent-missing-override',
'-Wno-macro-redefined',
'-Wno-unused-private-field',
]
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
if CONFIG['MOZ_ENABLE_SKIA_PDF_SFNTLY']:
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -270,11 +270,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('and
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
DEFINES['GRAPHITE2_STATIC'] = True
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
if CONFIG['CC_TYPE'] == 'clang':
# Suppress warnings from Skia header files.
SOURCES['gfxPlatform.cpp'].flags += ['-Wno-implicit-fallthrough']
diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -20,9 +20,12 @@ UNIFIED_SOURCES += [
'ICUUtils.cpp',
'IrishCasing.cpp',
'nsBidiUtils.cpp',
'nsSpecialCasingData.cpp',
'nsUnicharUtils.cpp',
'nsUnicodeProperties.cpp',
]
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
FINAL_LIBRARY = 'xul'
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
@@ -64,12 +64,15 @@ etld_data = GENERATED_FILES['etld_data.i
etld_data.script = 'prepare_tlds.py'
etld_data.inputs = ['effective_tld_names.dat']
# need to include etld_data.inc
LOCAL_INCLUDES += [
'/netwerk/base',
]
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
USE_LIBS += ['icu']
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -223,16 +223,19 @@ if CONFIG['SERVO_TARGET_DIR']:
OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo']
if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
if CONFIG['MOZ_SYSTEM_PNG']:
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
+
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
if CONFIG['MOZ_SYSTEM_LIBVPX']:
OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -308,16 +308,26 @@ def freetype2_combined_info(fontconfig_i
return namespace(
cflags=freetype2_info.cflags + fontconfig_info.cflags,
libs=freetype2_info.libs + fontconfig_info.libs,
)
add_old_configure_assignment('_HAVE_FREETYPE2',
depends_if(freetype2_info)(lambda _: True))
+# HarfBuzz
+# ==============================================================
+option('--with-system-harfbuzz',
+ help="Use system harfbuzz (located with pkgconfig)")
+
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.4.2',
+ when='--with-system-harfbuzz')
+
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
+
# Apple platform decoder support
# ==============================================================
@depends(toolkit)
def applemedia(toolkit):
if toolkit in ('cocoa', 'uikit'):
return True
set_config('MOZ_APPLEMEDIA', applemedia)

View File

@ -0,0 +1,233 @@
From: Jan Beich <jbeich@FreeBSD.org>
Allow building against system-wide graphite2.
https://bugzilla.mozilla.org/show_bug.cgi?id=847568
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1234,16 +1234,22 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
system_headers += [
'harfbuzz/hb-glib.h',
'harfbuzz/hb-ot.h',
'harfbuzz/hb.h',
]
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ system_headers += [
+ 'graphite2/Font.h',
+ 'graphite2/Segment.h',
+ ]
+
if CONFIG['MOZ_JACK']:
system_headers += [
'jack/jack.h',
'jack/statistics.h',
]
if CONFIG['MOZ_SYSTEM_JPEG']:
system_headers += [
diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
--- a/gfx/graphite2/moz-gr-update.sh
+++ b/gfx/graphite2/moz-gr-update.sh
@@ -1,11 +1,12 @@
#!/bin/bash
# Script used to update the Graphite2 library in the mozilla source tree
+# and bump version for --with-system-graphite2
# This script lives in gfx/graphite2, along with the library source,
# but must be run from the top level of the mozilla-central tree.
# Run as
#
# ./gfx/graphite2/moz-gr-update.sh RELEASE
#
@@ -32,22 +33,26 @@ echo "This directory contains the Graphi
echo "$TARBALL" >> gfx/graphite2/README.mozilla
echo ""
echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla
# fix up includes because of bug 721839 (cstdio) and bug 803066 (Windows.h)
#find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
#find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+# chase version for --with-system-graphite2
+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
+ if /GR2_VERSION_REQUIRE/" old-configure.in
+
# summarize what's been touched
echo Updated to $RELEASE.
echo Here is what changed in the gfx/graphite2 directory:
echo
-hg stat gfx/graphite2
+hg stat old-configure.in gfx/graphite2
echo
echo If gfx/graphite2/src/files.mk has changed, please make corresponding
echo changes to gfx/graphite2/src/moz.build
echo
echo
echo Now use hg commands to create a patch for the mozilla tree.
diff --git a/gfx/moz.build b/gfx/moz.build
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -5,28 +5,30 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('**'):
BUG_COMPONENT = ('Core', 'Graphics')
if CONFIG['MOZ_TREE_CAIRO']:
DIRS += ['cairo']
+if not CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ DIRS += ['graphite2/src' ]
+
if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
DIRS += ['harfbuzz/src']
DIRS += [
'2d',
'ycbcr',
'angle',
'src',
'qcms',
'gl',
'layers',
- 'graphite2/src',
'ots/src',
'thebes',
'ipc',
'vr',
'config',
'webrender_bindings',
]
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -268,16 +268,19 @@ CFLAGS += CONFIG['TK_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android'):
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
-DEFINES['GRAPHITE2_STATIC'] = True
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
+else:
+ DEFINES['GRAPHITE2_STATIC'] = True
if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
if CONFIG['CC_TYPE'] == 'clang':
# Suppress warnings from Skia header files.
SOURCES['gfxPlatform.cpp'].flags += ['-Wno-implicit-fallthrough']
diff --git a/old-configure.in b/old-configure.in
--- a/old-configure.in
+++ b/old-configure.in
@@ -4091,16 +4091,37 @@ if test "$USE_FC_FREETYPE"; then
CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
[AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
CPPFLAGS="$_SAVE_CPPFLAGS"
fi
fi
dnl ========================================================
+dnl Check for graphite2
+dnl ========================================================
+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
+ dnl graphite2.pc has bogus version, check manually
+ _SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
+ AC_TRY_COMPILE([ #include <graphite2/Font.h>
+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
+ * 100 + GR2_VERSION_BUGFIX >= \
+ (major) * 10000 + (minor) * 100 + (bugfix) )
+ ], [
+ #if !GR2_VERSION_REQUIRE(1,3,8)
+ #error "Insufficient graphite2 version."
+ #endif
+ ], [],
+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+ CFLAGS=$_SAVE_CFLAGS
+fi
+
+dnl ========================================================
dnl Check if we need the 32-bit Linux SSE2 error dialog
dnl ========================================================
AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
dnl ========================================================
dnl Check for pixman and cairo
dnl ========================================================
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -223,16 +223,19 @@ if CONFIG['SERVO_TARGET_DIR']:
OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo']
if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
if CONFIG['MOZ_SYSTEM_PNG']:
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
+
if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -308,16 +308,30 @@ def freetype2_combined_info(fontconfig_i
return namespace(
cflags=freetype2_info.cflags + fontconfig_info.cflags,
libs=freetype2_info.libs + fontconfig_info.libs,
)
add_old_configure_assignment('_HAVE_FREETYPE2',
depends_if(freetype2_info)(lambda _: True))
+# Graphite2
+# ==============================================================
+option('--with-system-graphite2',
+ help="Use system graphite2 (located with pkgconfig)")
+
+@depends('--with-system-graphite2')
+def check_for_graphite2(value):
+ return bool(value)
+
+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
+ when=check_for_graphite2)
+
+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True))
+
# HarfBuzz
# ==============================================================
option('--with-system-harfbuzz',
help="Use system harfbuzz (located with pkgconfig)")
system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.4.2',
when='--with-system-harfbuzz')

View File

@ -0,0 +1,93 @@
From:
This commit fixes some implicit declarations in the nICEr thirt-party
component.The fixes apply to mozilla's modifications of nICEr rather than nICEr
upstream. Also of note, Mozilla bug 1374699 contains fixes and changes that deal
with these in addition to many other isues in a future firefox version, and
so this patch will not be upstreamed but rather dropped when it becomes obsolete
in firefox-58 or 59.
diff --git a/media/mtransport/third_party/nICEr/src/ice/ice_component.c b/media/mtransport/third_party/nICEr/src/ice/ice_component.c
--- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c
@@ -49,17 +49,16 @@ static char *RCSSTRING __UNUSED__="$Id:
#include "nr_socket_multi_tcp.h"
#include "ice_reg.h"
#include "nr_crypto.h"
#include "r_time.h"
static int nr_ice_component_stun_server_default_cb(void *cb_arg,nr_stun_server_ctx *stun_ctx,nr_socket *sock, nr_stun_server_request *req, int *dont_free, int *error);
static int nr_ice_pre_answer_request_destroy(nr_ice_pre_answer_request **parp);
void nr_ice_component_consent_schedule_consent_timer(nr_ice_component *comp);
-void nr_ice_component_consent_destroy(nr_ice_component *comp);
/* This function takes ownership of the contents of req (but not req itself) */
static int nr_ice_pre_answer_request_create(nr_transport_addr *dst, nr_stun_server_request *req, nr_ice_pre_answer_request **parp)
{
int r, _status;
nr_ice_pre_answer_request *par = 0;
nr_stun_message_attribute *attr;
diff --git a/media/mtransport/third_party/nICEr/src/ice/ice_component.h b/media/mtransport/third_party/nICEr/src/ice/ice_component.h
--- a/media/mtransport/third_party/nICEr/src/ice/ice_component.h
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.h
@@ -80,16 +80,17 @@ struct nr_ice_component_ {
STAILQ_ENTRY(nr_ice_component_)entry;
};
typedef STAILQ_HEAD(nr_ice_component_head_,nr_ice_component_) nr_ice_component_head;
int nr_ice_component_create(struct nr_ice_media_stream_ *stream, int component_id, nr_ice_component **componentp);
int nr_ice_component_destroy(nr_ice_component **componentp);
+void nr_ice_component_consent_destroy(nr_ice_component *comp);
int nr_ice_component_initialize(struct nr_ice_ctx_ *ctx,nr_ice_component *component);
int nr_ice_component_maybe_prune_candidate(nr_ice_ctx *ctx, nr_ice_component *comp, nr_ice_candidate *c1, int *was_pruned);
int nr_ice_component_pair_candidate(nr_ice_peer_ctx *pctx, nr_ice_component *pcomp, nr_ice_candidate *lcand, int pair_all_remote);
int nr_ice_component_pair_candidates(nr_ice_peer_ctx *pctx, nr_ice_component *lcomp, nr_ice_component *pcomp);
int nr_ice_component_service_pre_answer_requests(nr_ice_peer_ctx *pctx, nr_ice_component *pcomp, char *username, int *serviced);
int nr_ice_component_nominated_pair(nr_ice_component *comp, nr_ice_cand_pair *pair);
int nr_ice_component_failed_pair(nr_ice_component *comp, nr_ice_cand_pair *pair);
int nr_ice_component_check_if_failed(nr_ice_component *comp);
diff --git a/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c b/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
--- a/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
@@ -39,16 +39,17 @@ static char *RCSSTRING __UNUSED__="$Id:
#include <nr_api.h>
#include "stun.h"
#include "async_timer.h"
#include "registry.h"
#include "stun_reg.h"
#include "nr_crypto.h"
#include "r_time.h"
+#include "ice_ctx.h"
static int nr_stun_client_send_request(nr_stun_client_ctx *ctx);
static void nr_stun_client_timer_expired_cb(NR_SOCKET s, int b, void *cb_arg);
static int nr_stun_client_get_password(void *arg, nr_stun_message *msg, Data **password);
#define NR_STUN_TRANSPORT_ADDR_CHECK_WILDCARD 1
#define NR_STUN_TRANSPORT_ADDR_CHECK_LOOPBACK 2
diff --git a/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c b/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c
--- a/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c
@@ -43,16 +43,17 @@ static char *RCSSTRING __UNUSED__="$Id:
#include <string.h>
#include "nr_api.h"
#include "r_time.h"
#include "async_timer.h"
#include "nr_socket_buffered_stun.h"
#include "stun.h"
#include "turn_client_ctx.h"
+#include "ice_ctx.h"
int NR_LOG_TURN = 0;
#define TURN_MAX_PENDING_BYTES 32000
#define TURN_RTO 100 /* Hardcoded RTO estimate */
#define TURN_LIFETIME_REQUEST_SECONDS 3600 /* One hour */
#define TURN_USECS_PER_S 1000000

View File

@ -0,0 +1,26 @@
From: Jory A. Pratt <anarchy@gentoo.org>
Enable to build with LTO support
diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -98,17 +98,17 @@
SOURCES['../chromium/sandbox/linux/services/syscall_wrappers.cc'].flags += [
'-Wno-empty-body',
]
# gcc lto likes to put the top level asm in syscall.cc in a different partition
# from the function using it which breaks the build. Work around that by
# forcing there to be only one partition.
if '-flto' in CONFIG['OS_CXXFLAGS'] and CONFIG['CC_TYPE'] != 'clang':
- LDFLAGS += ['--param lto-partitions=1']
+ LDFLAGS += ['--lto-partition=one']
if CONFIG['MOZ_ALSA']:
DEFINES['MOZ_ALSA'] = True
DEFINES['NS_NO_XPCOM'] = True
DisableStlWrapping()
LOCAL_INCLUDES += ['/security/sandbox/linux']

View File

@ -6,7 +6,7 @@ arch=('x86_64')
license=('MPL' 'GPL' 'LGPL')
url="https://www.mozilla.org/firefox/"
depends=(gtk3 mozilla-common libxt startup-notification mime-types dbus-glib alsa-lib ffmpeg
libvpx libevent hunspell libproxy nss nspr pixman
libvpx libevent hunspell libproxy nspr pixman
kio knotifications kwindowsystem ki18n)
makedepends=(unzip zip diffutils python2 yasm mesa imake libpulse inetutils xorg-server-xvfb
autoconf2.13 gtk2 gobject-introspection jack rust
@ -15,11 +15,8 @@ optdepends=('networkmanager: Location detection via available WiFi networks'
'libnotify: Notification integration'
'upower: Battery API'
'firefox-i18n: for multilanguage support')
options=(!emptydirs !makeflags)
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
provides=("firefox=${pkgver}" "kmozillahelper")
conflicts=('kmozillahelper')
replaces=('kmozillahelper')
options=(!emptydirs strip)
provides=("firefox-kde=${pkgver}")
validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases <release@mozilla.com>
#
# For whom want to update this package
@ -49,8 +46,15 @@ source=("https://releases.mozilla.org/pub/firefox/releases/${pkgver}/source/${pk
# Gecko/toolkit patchset
"$_patchurl/mozilla-nongnome-proxies.patch"
"$_patchurl/mozilla-kde.patch"
"$_patchurl/mozilla-openaes-decl.patch"
"$_patchurl/mozilla-enable-csd.patch"
# Gentoo patch
1004_fix_pie_detection.patch
1005_fix_fortify_sources.patch
2000_system_harfbuzz.patch
2001_system_graphite2.patch
2003_nICER_implicit_decls.patch
2004_fix_lto_builds.patch
# Useless patchset
#"$_patchurl/gecko-lockdown.patch"
@ -74,8 +78,13 @@ sha256sums=('4bc4fd997e6239f53e16a70b04f197791e5c5d09367e2916bcfe4a427999f842'
'67ae8fc341a465c1e0961014bed5ad89a66a211362c82451c6e068b0e4ad2eb8'
'ef0f90c9134ef05b950f06a3ffbd699c2e5a5f99a4cdf9868e799534d68c204f'
'2471b962a512addebf37778c80c9445354e702b63be3636a9e124aa2fd6b743b'
'be7aa94f682dcb0feec3dd7c277d5d19e3c56fe3d4940203c942bbbefad6ed70'
'ca1602c69f22ee1bd1000cebb883895eeb19b0e1647dfe4ca00422f39ed215aa')
'ca1602c69f22ee1bd1000cebb883895eeb19b0e1647dfe4ca00422f39ed215aa'
'2b813ba66a3904b3e745d199479967dafc9b23e69db2238a932e013cdc21b91d'
'e5d8f0410ecd05119119e2d44a88fb5f1eb67a5b1035fd0a66b8cf167fb81c5d'
'a850e98166d89f6541f04ac188c4bbdf075f2be601d3d6e88b17d20048ae5243'
'6d9a7d3059d9017c1d3c28b38f257fe99b48ebcb1d829d427db59f80826fdc89'
'c39d22c4223c99181e1e828c1d6ba3bde035f497744ad423c60da91425ac4942'
'aee8725b94b19a6a08c3496c3844d174760d608e9c97f2daae05c7af28f290a4')
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
@ -111,7 +120,6 @@ pref("browser.backspace_action", 0);
END
msg 'Generating mozconfig'
cat >.mozconfig <<END
# There multiple default mozconfigs in the soruce tree with references across directories
# $topsrcdir/build/unix/mozconfig.gtk
# $topsrcdir/build/unix/mozconfig.linux
@ -123,6 +131,7 @@ END
# But we intend to mantain our own mozconfig without reference to any of the mozilla upstream configuration to keep it simple
# This mozconfig would inlcude most of the configurations listed above into one file
cat >.mozconfig <<END
ac_add_options --prefix=/usr
ac_add_options --enable-release
ac_add_options --enable-pie
@ -153,7 +162,6 @@ ac_add_options --with-system-bz2
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-icu
ac_add_options --with-system-png
ac_add_options --enable-system-pixman
@ -164,9 +172,10 @@ ac_add_options --enable-libproxy
# Features
ac_add_options --enable-startup-notification
ac_add_options --enable-jack
ac_add_options --disable-gconf
ac_add_options --enable-alsa
ac_add_options --enable-gconf
ac_add_options --disable-updater
ac_add_options --disable-crashreporter
ac_add_options --enable-crashreporter
# PGO
mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 \$(MAKE) -C \$(MOZ_OBJDIR) pgo-profile-run'
@ -185,6 +194,25 @@ END
patch -Np1 -i "$srcdir/firefox-kde.patch"
patch -Np1 -i "$srcdir/firefox-branded-icons.patch"
patch -Np0 -i "$srcdir/pgo-fix-missing-kdejs.patch"
msg "Gentoo Patchset"
patch -Np1 -i $srcdir/1004_fix_pie_detection.patch
patch -Np1 -i $srcdir/1005_fix_fortify_sources.patch
patch -Np1 -i $srcdir/2000_system_harfbuzz.patch
patch -Np1 -i $srcdir/2001_system_graphite2.patch
patch -Np1 -i $srcdir/2003_nICER_implicit_decls.patch
patch -Np1 -i $srcdir/2004_fix_lto_builds.patch
msg "Arch Patchset"
patch -Np1 -i "$srcdir/0001-Bug-1435212-Add-support-for-FFmpeg-4.0.-r-bryce.patch"
sed -i \
-e '/^OS_LIBS += no_as_needed/d' \
-e '/^OS_LIBS += as_needed/d' \
./widget/gtk/mozgtk/gtk2/moz.build \
./widget/gtk/mozgtk/gtk3/moz.build
SHELL=/bin/bash MOZ_NOSPAM=1 ./mach configure
}
build() {
@ -205,22 +233,18 @@ build_kmozillahelper() {
}
build_firefox() {
# cd "$srcdir/mozilla-release-${_changeset}"
cd $srcdir/${pkgname%%-kde}-${pkgver}
# _FORTIFY_SOURCE causes configure failures
CPPFLAGS+=" -O2"
# Hardening
LDFLAGS+=" -Wl,-z,now"
export PATH="$srcdir/path:$PATH"
export SHELL=/bin/bash
export MOZ_SOURCE_REPO="$_repo"
# Do PGO
xvfb-run -a -n 95 -s "-extension GLX -screen 0 1280x1024x24" \
./mach build
./mach build --verbose
./mach buildsymbols
#make -f client.mk build
}
@ -235,6 +259,7 @@ package() {
export SHELL=/bin/bash
DESTDIR="$pkgdir" ./mach install
find . -name '*crashreporter-symbols-full.zip' -exec cp -fvt "$startdir" {} +
_vendorjs="$pkgdir/usr/lib/firefox/browser/defaults/preferences/vendor.js"
install -Dm644 /dev/stdin "$_vendorjs" <<END