From 3f33f8a6e59a039af0b3de3aac8b346c000599f4 Mon Sep 17 00:00:00 2001 From: Ken <21211439+kencu@users.noreply.github.com> Date: Thu, 11 Jun 2020 15:31:09 -0700 Subject: [PATCH] Intel fixes (#608) * ycbcr: intel assembly fixes for old gcc-as in Tiger minor changes in assembly that are friendly to the older gcc-as in Tiger * libvpx/moz.build: only use force_cpusubtype_all on PPC this flag is not accepted by the intel assembler * libvpx: compiler/assembler fixes for intel use clang-3.4 as the primary compiler use yasm for the assembly * nss: use clang-3.4 as compiler on Intel nss contains assembly that the old gas assembler can't manage using clang-3.4 is the easiest fix for this, as it is already needed elsewhere for libvpx * Intel mozconfig: update we need to force the old gas assembler to be used for the majority of the build as the newer clang one will fail * client.mk: use original which MacPorts has a newer version of the which command that is supposed to be more like current 'which' versions, but there is an error in it at present and the construct used in TFF doesn't work correctly. Until this is fixed, use the original /usr/bin/which (and that one can in fact be used forever, of course). --- client.mk | 2 +- config/external/nss/Makefile.in | 11 +++++++++++ gfx/ycbcr/yuv_row_posix.cpp | 9 +++------ intel-Yonah.mozcfg | 10 ++++++++-- media/libvpx/Makefile.in | 9 +++++++++ media/libvpx/moz.build | 6 +++++- 6 files changed, 37 insertions(+), 10 deletions(-) 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