diff --git a/caps/nsScriptSecurityManager.cpp b/caps/nsScriptSecurityManager.cpp index 44ab87758..8beb23e44 100644 --- a/caps/nsScriptSecurityManager.cpp +++ b/caps/nsScriptSecurityManager.cpp @@ -688,6 +688,34 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, return NS_ERROR_DOM_BAD_URI; } + // See TenFourFox issue 607 + // determine if this is a script we want to block + // Scripts that somehow hit hard limits should go in here + if (!mIsTenFourFoxTroublesomeJsAllowed && + (targetScheme.EqualsLiteral("http") || targetScheme.EqualsLiteral("https"))) { + nsAutoCString hostname; + if (MOZ_LIKELY(NS_SUCCEEDED(targetBaseURI->GetHost(hostname)))) { + ToLowerCase(hostname); +#define BLOC(q) hostname.EqualsLiteral(q) + if (0 || + +#ifdef __ppc__ + BLOC("static.twitchcdn.net") || +#endif // __ppc__ + + 0) { +#undef BLOC + +#ifndef DEBUG + if (mIsTenFourFoxTroublesomeJsLoggingEnabled) +#endif + fprintf(stderr, "Warning: TenFourFox blocking problematic script from %s.\n", + hostname.get()); + return NS_ERROR_DOM_BAD_URI; + } + } + } + // TenFourFox issue 469 // determine if this is a script we want to block if (mIsTenFourFoxAdBlockEnabled && @@ -1790,6 +1818,7 @@ static const char* kObservedPrefs[] = { sFileOriginPolicyPrefName, "capability.policy.", "tenfourfox.adblock.", + "tenfourfox.troublesome-js.", nullptr }; @@ -1810,6 +1839,8 @@ nsScriptSecurityManager::nsScriptSecurityManager(void) , mIsJavaScriptEnabled(false) , mIsTenFourFoxAdBlockEnabled(false) , mIsTenFourFoxAdBlockLoggingEnabled(false) + , mIsTenFourFoxTroublesomeJsAllowed(false) + , mIsTenFourFoxTroublesomeJsLoggingEnabled(false) { static_assert(sizeof(intptr_t) == sizeof(void*), "intptr_t and void* have different lengths on this platform. " @@ -1950,6 +1981,12 @@ nsScriptSecurityManager::ScriptSecurityPrefChanged() Preferences::GetBool("tenfourfox.adblock.enabled", mIsTenFourFoxAdBlockEnabled); mIsTenFourFoxAdBlockLoggingEnabled = Preferences::GetBool("tenfourfox.adblock.logging.enabled", mIsTenFourFoxAdBlockLoggingEnabled); + mIsTenFourFoxTroublesomeJsAllowed = + Preferences::GetBool("tenfourfox.troublesome-js.allow", + mIsTenFourFoxTroublesomeJsAllowed); + mIsTenFourFoxTroublesomeJsLoggingEnabled = + Preferences::GetBool("tenfourfox.troublesome-js.logging.enabled", + mIsTenFourFoxTroublesomeJsLoggingEnabled); // // Rebuild the set of principals for which we allow file:// URI loads. This diff --git a/caps/nsScriptSecurityManager.h b/caps/nsScriptSecurityManager.h index 41b68e137..7b0960a14 100644 --- a/caps/nsScriptSecurityManager.h +++ b/caps/nsScriptSecurityManager.h @@ -125,6 +125,8 @@ private: bool mIsJavaScriptEnabled; bool mIsTenFourFoxAdBlockEnabled; bool mIsTenFourFoxAdBlockLoggingEnabled; + bool mIsTenFourFoxTroublesomeJsAllowed; + bool mIsTenFourFoxTroublesomeJsLoggingEnabled; nsTArray> mFileURIWhitelist; // This machinery controls new-style domain policies. The old-style diff --git a/client.mk b/client.mk index e24a553f8..925af4bd3 100644 --- a/client.mk +++ b/client.mk @@ -57,7 +57,7 @@ endif # try to find autoconf 2.13 - discard errors from 'which' # MacOS X 10.4 sends "no autoconf*" errors to stdout, discard those via grep -AUTOCONF ?= $(shell which autoconf-2.13 autoconf2.13 autoconf213 2>/dev/null | grep -v '^no autoconf' | head -1) +AUTOCONF ?= $(shell /usr/bin/which autoconf-2.13 autoconf2.13 autoconf213 2>/dev/null | grep -v '^no autoconf' | head -1) # See if the autoconf package was installed through fink ifeq (,$(strip $(AUTOCONF))) diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in index 1e960672e..ddf6398ca 100644 --- a/config/external/nss/Makefile.in +++ b/config/external/nss/Makefile.in @@ -10,6 +10,17 @@ CXX_WRAPPER = default:: +ifeq (86,$(findstring 86,$(OS_TEST))) +# TenFourFox Intel fix +# TO DO - pass the compiler in as an environment variable +CC=clang-mp-3.4 +CC += -arch i386 +CC += -O3 +CCC=clang++-mp-3.4 +CCC += -arch i386 +CCC += -O3 +endif + include $(topsrcdir)/config/makefiles/functions.mk NSS_LIBS = \ diff --git a/gfx/ycbcr/yuv_row_posix.cpp b/gfx/ycbcr/yuv_row_posix.cpp index 818ec5d11..a3494cf31 100644 --- a/gfx/ycbcr/yuv_row_posix.cpp +++ b/gfx/ycbcr/yuv_row_posix.cpp @@ -272,8 +272,7 @@ void FastConvertYUVToRGB32Row_SSE(const uint8* y_buf, int width); asm( ".text\n" - ".global FastConvertYUVToRGB32Row_SSE\n" - ".type FastConvertYUVToRGB32Row_SSE, @function\n" + ".globl FastConvertYUVToRGB32Row_SSE\n" "FastConvertYUVToRGB32Row_SSE:\n" "pusha\n" "mov 0x24(%esp),%edx\n" @@ -350,8 +349,7 @@ void ScaleYUVToRGB32Row_SSE(const uint8* y_buf, int source_dx); asm( ".text\n" - ".global ScaleYUVToRGB32Row_SSE\n" - ".type ScaleYUVToRGB32Row_SSE, @function\n" + ".globl ScaleYUVToRGB32Row_SSE\n" "ScaleYUVToRGB32Row_SSE:\n" "pusha\n" "mov 0x24(%esp),%edx\n" @@ -444,8 +442,7 @@ void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf, int source_dx); asm( ".text\n" - ".global LinearScaleYUVToRGB32Row_SSE\n" - ".type LinearScaleYUVToRGB32Row_SSE, @function\n" + ".globl LinearScaleYUVToRGB32Row_SSE\n" "LinearScaleYUVToRGB32Row_SSE:\n" "pusha\n" "mov 0x24(%esp),%edx\n" diff --git a/intel-Yonah.mozcfg b/intel-Yonah.mozcfg index 3da0fbf07..f457b4b2b 100644 --- a/intel-Yonah.mozcfg +++ b/intel-Yonah.mozcfg @@ -1,6 +1,12 @@ . $topsrcdir/browser/config/mozconfig -export CC="/opt/local/bin/gcc-mp-4.8 -flax-vector-conversions -O3 -m32 -march=pentium-m -read_only_relocs suppress -mdynamic-no-pic" -export CXX="/opt/local/bin/g++-mp-4.8 -flax-vector-conversions -fpermissive -O3 -m32 -march=pentium-m -read_only_relocs suppress -mdynamic-no-pic" + +# we need to use -Wa,-Q to force the behaviour of the traditional assembler on MacPorts +# as that is the only one that can accept all the output from gcc-4.8 without errors +# recent changes in MacPorts will force clang as assembler if certain clangs are found otherwise +export CC="/opt/local/bin/gcc-mp-4.8 -Wa,-Q -flax-vector-conversions -O3 -m32 -march=pentium-m -read_only_relocs suppress" +export CXX="/opt/local/bin/g++-mp-4.8 -Wa,-Q -flax-vector-conversions -fpermissive -O3 -m32 -march=pentium-m -read_only_relocs suppress" + + mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg mk_add_options MOZ_MAKE_FLAGS="-s -j2" mk_add_options AUTOCONF=autoconf213 diff --git a/media/libvpx/Makefile.in b/media/libvpx/Makefile.in index 3b9102857..25f681599 100644 --- a/media/libvpx/Makefile.in +++ b/media/libvpx/Makefile.in @@ -9,6 +9,15 @@ VPX_AS=gcc VPX_ASM_SUFFIX=s endif +ifdef VPX_X86_ASM +# TO DO - pass these in as an environment variable +CC=clang-mp-3.4 +CC += -arch i386 +CC += -O3 +VPX_AS=yasm +VPX_ASM_SUFFIX=asm +endif + # Set up the libvpx assembler config. AS=$(VPX_AS) diff --git a/media/libvpx/moz.build b/media/libvpx/moz.build index 5bcbca565..843b4575d 100644 --- a/media/libvpx/moz.build +++ b/media/libvpx/moz.build @@ -102,6 +102,7 @@ if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']: if CONFIG['GNU_CC']: CFLAGS += ['-Wno-sign-compare'] + ASFLAGS += CONFIG['VPX_ASFLAGS'] ASFLAGS += [ '-I.', @@ -109,7 +110,10 @@ ASFLAGS += [ '-I%s/media/libvpx/vpx_ports/' % TOPSRCDIR, ] # moved from Makefile.in for TenFourFox -ASFLAGS += ['-force_cpusubtype_ALL'] + +# this only works on gcc-as (ie PPC) +if not '86' in CONFIG['OS_TEST']: + ASFLAGS += ['-force_cpusubtype_ALL'] if CONFIG['OS_TARGET'] == 'Android': # For LIBVPX_RAND