From a147b682697db1ce8e11010c72a19edb7eb7c213 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Mon, 28 May 2018 05:42:07 +0000 Subject: Revert "Always build with SSE2 support & display an error if not available" --- browser/app/Makefile.in | 8 -------- browser/app/moz.build | 4 ---- browser/app/nsBrowserApp.cpp | 45 -------------------------------------------- 3 files changed, 57 deletions(-) (limited to 'browser/app') diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index ca87f0995..d807b4337 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -23,14 +23,6 @@ NSDISTMODE = copy include $(topsrcdir)/config/config.mk -# If we are trying to show an error dialog about the lack of SSE2 support, -# make sure that code itself doesn't use SSE2. -ifdef MOZ_LINUX_SSE2_STARTUP_ERROR -CXXFLAGS := $(filter-out -march=% -msse2 -mfpmath=sse,$(CXXFLAGS)) -CXX := $(filter-out -march=% -msse2 -mfpmath=sse,$(CXX)) -CXXFLAGS += -msse -mno-sse2 -mfpmath=387 -endif - ifeq ($(OS_ARCH),WINNT) # Rebuild firefox.exe if the manifest changes - it's included by splash.rc. # (this dependency should really be just for firefox.exe, not other targets) diff --git a/browser/app/moz.build b/browser/app/moz.build index 9650761ee..1004e280c 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -70,10 +70,6 @@ if CONFIG['HAVE_CLOCK_MONOTONIC']: if CONFIG['MOZ_GPSD']: DEFINES['MOZ_GPSD'] = True - -if CONFIG['MOZ_LINUX_SSE2_STARTUP_ERROR']: - DEFINES['MOZ_LINUX_SSE2_STARTUP_ERROR'] = True - for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'): DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % ( TOPOBJDIR, icon) diff --git a/browser/app/nsBrowserApp.cpp b/browser/app/nsBrowserApp.cpp index fc5ea8785..66ea8aed5 100644 --- a/browser/app/nsBrowserApp.cpp +++ b/browser/app/nsBrowserApp.cpp @@ -35,51 +35,6 @@ #include "mozilla/Telemetry.h" #include "mozilla/WindowsDllBlocklist.h" -#ifdef MOZ_LINUX_SSE2_STARTUP_ERROR -#include -#include "mozilla/Unused.h" - -static bool -IsSSE2Available() -{ - // The rest of the app has been compiled to assume that SSE2 is present - // unconditionally, so we can't use the normal copy of SSE.cpp here. - // Since SSE.cpp caches the results and we need them only transiently, - // instead of #including SSE.cpp here, let's just inline the specific check - // that's needed. - unsigned int level = 1u; - unsigned int eax, ebx, ecx, edx; - unsigned int bits = (1u<<26); - unsigned int max = __get_cpuid_max(0, nullptr); - if (level > max) { - return false; - } - __cpuid_count(level, 0, eax, ebx, ecx, edx); - return (edx & bits) == bits; -} - -static const char sSSE2Message[] = - "This browser version requires a processor with the SSE2 instruction " - "set extension.\n"; - -__attribute__((constructor)) -static void -SSE2Check() -{ - if (IsSSE2Available()) { - return; - } - // Using write() in order to avoid jemalloc-based buffering. Ignoring return - // values, since there isn't much we could do on failure and there is no - // point in trying to recover from errors. - MOZ_UNUSED(write(STDERR_FILENO, - sSSE2Message, - MOZ_ARRAY_LENGTH(sSSE2Message) - 1)); - // _exit() instead of exit() to avoid running the usual "at exit" code. - _exit(255); -} -#endif - #if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_ANDROID) #define MOZ_BROWSER_CAN_BE_CONTENTPROC #include "../../ipc/contentproc/plugin-container.cpp" -- cgit v1.2.3