Package: src:mozjs60 Followup-For: Bug #905834 User: debian-...@lists.debian.org Usertags: m68k
Hello! I wasn't put in the loop of this bug report, so I was about to file a new bug report. Luckily, reportbug listed this bug before I filed a new one. Please always CC debian-$a...@lists.debian.org in the future. Anyway, attaching an updated patch for m68k. Adrian -- .''`. 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 m68k support to mozjs60 Author: John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de> Last-Update: 2018-09-26 --- mozjs60-60.2.1.orig/build/moz.configure/init.configure +++ mozjs60-60.2.1/build/moz.configure/init.configure @@ -655,6 +655,9 @@ def split_triplet(triplet, allow_unknown elif cpu.startswith('arm'): canonical_cpu = 'arm' endianness = 'big' if cpu.startswith(('armeb', 'armbe')) else 'little' + elif cpu == 'm68k': + canonical_cpu = 'm68k' + endianness = 'big' elif cpu in ('mips', 'mipsel'): canonical_cpu = 'mips32' endianness = 'little' if 'el' in cpu else 'big' --- mozjs60-60.2.1.orig/js/src/gc/Cell.h +++ mozjs60-60.2.1/js/src/gc/Cell.h @@ -103,7 +103,7 @@ struct Cell protected: uintptr_t address() const; inline Chunk* chunk() const; -} JS_HAZ_GC_THING; +} JS_HAZ_GC_THING __attribute__ ((aligned(4))); // A GC TenuredCell gets behaviors that are valid for things in the Tenured // heap, such as access to the arena and mark bits. --- mozjs60-60.2.1.orig/js/src/jit/AtomicOperations.h +++ mozjs60-60.2.1/js/src/jit/AtomicOperations.h @@ -383,6 +383,8 @@ AtomicOperations::isLockfreeJS(int32_t s # include "jit/none/AtomicOperations-feeling-lucky.h" #elif defined(__hppa__) # include "jit/none/AtomicOperations-feeling-lucky.h" +#elif defined(__m68k__) +# include "jit/none/AtomicOperations-feeling-lucky.h" #elif defined(__sh__) # include "jit/none/AtomicOperations-feeling-lucky.h" #elif defined(__s390__) || defined(__s390x__) --- mozjs60-60.2.1.orig/js/src/jit/none/AtomicOperations-feeling-lucky.h +++ mozjs60-60.2.1/js/src/jit/none/AtomicOperations-feeling-lucky.h @@ -65,6 +65,10 @@ # define GNUC_COMPATIBLE #endif +#ifdef __m68k__ +# define GNUC_COMPATIBLE +#endif + #ifdef __sh__ # define GNUC_COMPATIBLE #endif --- mozjs60-60.2.1.orig/js/src/jsapi.h +++ mozjs60-60.2.1/js/src/jsapi.h @@ -5415,7 +5415,7 @@ class JSErrorBase private: void freeMessage(); -}; +} __attribute__((aligned(4))); /** * Notes associated with JSErrorReport. --- mozjs60-60.2.1.orig/js/src/jsfriendapi.h +++ mozjs60-60.2.1/js/src/jsfriendapi.h @@ -594,7 +594,7 @@ public: uint32_t slotInfo; static const uint32_t FIXED_SLOTS_SHIFT = 27; -}; +} __attribute__ ((aligned(4))); /** * This layout is shared by all native objects. For non-native objects, the --- mozjs60-60.2.1.orig/mfbt/tests/TestPair.cpp +++ mozjs60-60.2.1/mfbt/tests/TestPair.cpp @@ -29,14 +29,19 @@ using mozilla::Pair; static_assert(sizeof(name##_2) == (size), \ "Pair<" #T2 ", " #T1 "> has an unexpected size"); +static constexpr size_t sizemax(size_t a, size_t b) +{ + return (a > b) ? a : b; +} + INSTANTIATE(int, int, prim1, 2 * sizeof(int)); -INSTANTIATE(int, long, prim2, 2 * sizeof(long)); +INSTANTIATE(int, long, prim2, sizeof(long) + sizemax(sizeof(int), alignof(long))); struct EmptyClass { explicit EmptyClass(int) {} }; struct NonEmpty { char mC; explicit NonEmpty(int) {} }; INSTANTIATE(int, EmptyClass, both1, sizeof(int)); -INSTANTIATE(int, NonEmpty, both2, 2 * sizeof(int)); +INSTANTIATE(int, NonEmpty, both2, sizeof(int) + alignof(int)); INSTANTIATE(EmptyClass, NonEmpty, both3, 1); struct A { char dummy; explicit A(int) {} }; --- mozjs60-60.2.1.orig/mfbt/tests/TestPoisonArea.cpp +++ mozjs60-60.2.1/mfbt/tests/TestPoisonArea.cpp @@ -133,6 +133,9 @@ #elif defined _ARCH_PPC || defined _ARCH_PWR || defined _ARCH_PWR2 #define RETURN_INSTR 0x4E800020 /* blr */ +#elif defined __m68k__ +#define RETURN_INSTR 0x4E754E75 /* rts; rts */ + #elif defined __sparc || defined __sparcv9 #define RETURN_INSTR 0x81c3e008 /* retl */ --- mozjs60-60.2.1.orig/python/mozbuild/mozbuild/configure/constants.py +++ mozjs60-60.2.1/python/mozbuild/mozbuild/configure/constants.py @@ -46,6 +46,7 @@ CPU_bitness = { 'arm': 32, 'hppa': 32, 'ia64': 64, + 'm68k': 32, 'mips32': 32, 'mips64': 64, 'ppc': 32, @@ -86,6 +87,7 @@ CPU_preprocessor_checks = OrderedDict(( ('hppa', '__hppa__'), ('sparc64', '__sparc__ && __arch64__'), ('sparc', '__sparc__'), + ('m68k', '__m68k__'), ('mips64', '__mips64'), ('mips32', '__mips__'), ('sh4', '__sh__'), --- mozjs60-60.2.1.orig/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +++ mozjs60-60.2.1/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py @@ -1155,6 +1155,9 @@ class LinuxCrossCompileToolchainTest(Bas '__arch64__': 1, }, }, + 'm68k-unknown-linux-gnu': big_endian + { + '__m68k__': 1, + }, 'mips64-unknown-linux-gnuabi64': big_endian + { '__mips64': 1, '__mips__': 1,