Source: mozjs52 Version: 52.3.1-7 Severity: normal User: debian-sup...@lists.debian.org Usertags: sh4
Hi! The attached patch adds support for the sh4 architecture. The patch is based on my upstream patches which were merged in Firefox 53 [1]. On top of that, it is necessary to build mozjs52 on sh4 with PIE disabled as we have currently PIE disabled in gcc on sh4 due to some applications crashing with it enabled: --- debian/rules.orig 2017-10-20 19:12:58.000000000 +0200 +++ debian/rules 2017-11-03 22:32:18.630130502 +0100 @@ -29,6 +29,12 @@ CONFIGURE_FLAGS += --disable-ion endif +ifeq ($(DEB_HOST_ARCH),sh4) +CONFIGURE_FLAGS += --disable-pie +else +CONFIGURE_FLAGS += --enable-pie +endif + ifeq ($(DEB_HOST_ARCH_ENDIAN),little) ICU_DATA_FILE = icudt58l.dat else @@ -75,7 +81,6 @@ --enable-shared-js \ --enable-gcgenerational \ --disable-optimize \ - --enable-pie \ $(CONFIGURE_FLAGS) override_dh_install: Thanks for consdideration! Adrian > [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1329194 -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Description: Add support for sh4 Based on upstreamed patches in Firefox. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1329194 . Author: John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de> Last-Update: 2017-11-03 --- mozjs52-52.3.1.orig/build/moz.configure/init.configure +++ mozjs52-52.3.1/build/moz.configure/init.configure @@ -380,6 +380,9 @@ def split_triplet(triplet): elif cpu.startswith('aarch64'): canonical_cpu = 'aarch64' endianness = 'little' + elif cpu == 'sh4': + canonical_cpu = 'sh4' + endianness = 'little' else: die('Unknown CPU type: %s' % cpu) --- mozjs52-52.3.1.orig/js/src/jit/AtomicOperations.h +++ mozjs52-52.3.1/js/src/jit/AtomicOperations.h @@ -328,6 +328,8 @@ AtomicOperations::isLockfree(int32_t siz # include "jit/mips-shared/AtomicOperations-mips-shared.h" #elif defined(__ppc__) || defined(__PPC__) # include "jit/none/AtomicOperations-ppc.h" +#elif defined(__sh__) +# include "jit/none/AtomicOperations-ppc.h" #elif defined(__sparc__) # include "jit/none/AtomicOperations-sparc.h" #elif defined(JS_CODEGEN_NONE) --- mozjs52-52.3.1.orig/mfbt/tests/TestPoisonArea.cpp +++ mozjs52-52.3.1/mfbt/tests/TestPoisonArea.cpp @@ -154,6 +154,9 @@ #elif defined __s390__ #define RETURN_INSTR 0x07fe0000 /* br %r14 */ +#elif defined __sh__ +#define RETURN_INSTR 0x0b000b00 /* rts; rts */ + #elif defined __aarch64__ #define RETURN_INSTR 0xd65f03c0 /* ret */ --- mozjs52-52.3.1.orig/python/mozbuild/mozbuild/configure/constants.py +++ mozjs52-52.3.1/python/mozbuild/mozbuild/configure/constants.py @@ -50,6 +50,7 @@ CPU_bitness = { 'ppc64': 64, 's390': 32, 's390x': 64, + 'sh4': 32, 'sparc': 32, 'sparc64': 64, 'x86': 32, @@ -85,6 +86,7 @@ CPU_preprocessor_checks = OrderedDict(( ('sparc', '__sparc__'), ('mips64', '__mips64'), ('mips32', '__mips__'), + ('sh4', '__sh__'), )) assert sorted(CPU_preprocessor_checks.keys()) == sorted(CPU.POSSIBLE_VALUES) --- mozjs52-52.3.1.orig/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +++ mozjs52-52.3.1/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py @@ -1037,6 +1037,9 @@ class LinuxCrossCompileToolchainTest(Bas 'mips-unknown-linux-gnu': big_endian + { '__mips__': 1, }, + 'sh4-unknown-linux-gnu': little_endian + { + '__sh__': 1, + }, } PLATFORMS['powerpc64le-unknown-linux-gnu'] = \