• Bug#859508: closed by Carsten Schoenert (Bug#

    From John Paul Adrian Glaubitz@21:1/5 to John Paul Adrian Glaubitz on Tue Jun 6 23:10:02 2017
    XPost: linux.debian.bugs.dist

    This is a multi-part message in MIME format.
    On 06/06/2017 09:39 PM, John Paul Adrian Glaubitz wrote:
    Same as in #859271, the sh4 support patch is incomplete for T52, the
    missing additional patch has already been merged upstream in Firefox
    upstream [1].

    I will send an updated patch shortly.

    Attaching the updated patch, untested. Should be fine though.

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Date: Tue, 06 Jun 2017 21:52:22 +0200
    Subject: Add sh4 support to Thunderbird

    Cherry-picked and adapted patches from Firefox upstream:
    - 5a74d13630a969473f72a143f37728f5bb87f552
    Bug 1329194 - mozbuild: Add SH4 as target architecture.
    - b179235c38eb631286f9e2fd4a7b23361dbab6d2
    Bug 1329194 - js:jit: Use PowerPC atomic operations on SH.
    - ba58645c87ed7e08b16adc3b40f0c6e3b6a2e140
    Bug 1329194 - mfbt:tests: Define RETURN_INSTR for SH in TestPoisonArea.
    - 942df3d3a4a1db3d182e97c54fb1705c50128470
    Bug 1329194 - ipc:chromium: Add platform defines for SH.
    - 85ae466ed90b3a0cac396aed24722ce4d0febb31
    Bug 1329194 - media:webrtc: Add platform defines for SH.
    - 5a74d13630a969473f72a143f37728f5bb87f552
    Bug 1329194 - mozbuild: Add SH4 as target architecture.
    - (not committed upstream yet)
    Bug 382214 - xpcom: Add xptcall support for Linux/SH
    - (not committed upstream yet)
    Bug 382214 - xpcom: Make SH xpctcall inline assembly position-independent

    Closes: #859508
    ---
    mozilla/ipc/chromium/src/build/build_config.h | 3 +
    mozilla/js/src/jit/AtomicOperations.h | 2 +
    mozilla/media/webrtc/trunk/build/build_config.h | 3 +
    mozilla/mfbt/tests/TestPoisonArea.cpp | 3 +
    mozilla/xpcom/reflect/xptcall/md/unix/moz.build | 5 +
    .../xptcall/md/unix/xptcinvoke_linux_sh.cpp | 210 +++++++++++++++++
    .../reflect/xptcall/md/unix/xptcstubs_linux_sh.cpp | 262 +++++++++++++++++++++
    mozilla/build/moz.configure/init.configure | 3 +++
    mozilla/python/mozbuild/mozbuild/configure/constants.py | 2 ++
    mozilla/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | 3 +++
    10 files changed, 496 insertions(+)
    create mode 100644 mozilla/xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_sh.cpp
    create mode 100644 mozilla/xpcom/reflect/xptcall/md/unix/xptcstubs_linux_sh.cpp

    Index: icedove-52.1.1/mozilla/ipc/chromium/src/build/build_config.h =========================
  • From John Paul Adrian Glaubitz@21:1/5 to John Paul Adrian Glaubitz on Tue Jun 6 23:40:02 2017
    XPost: linux.debian.bugs.dist

    This is a multi-part message in MIME format.
    On 06/06/2017 09:56 PM, John Paul Adrian Glaubitz wrote:
    Attaching the updated patch, untested. Should be fine though.

    It isn't. I messed up a tiny part because I'm too stupid to use quilt.

    Updated patch attached.

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Date: Tue, 06 Jun 2017 22:31:22 +0200
    Subject: Add sh4 support to Thunderbird

    Cherry-picked and adapted patches from Firefox upstream:
    - 5a74d13630a969473f72a143f37728f5bb87f552
    Bug 1329194 - mozbuild: Add SH4 as target architecture.
    - b179235c38eb631286f9e2fd4a7b23361dbab6d2
    Bug 1329194 - js:jit: Use PowerPC atomic operations on SH.
    - ba58645c87ed7e08b16adc3b40f0c6e3b6a2e140
    Bug 1329194 - mfbt:tests: Define RETURN_INSTR for SH in TestPoisonArea.
    - 942df3d3a4a1db3d182e97c54fb1705c50128470
    Bug 1329194 - ipc:chromium: Add platform defines for SH.
    - 85ae466ed90b3a0cac396aed24722ce4d0febb31
    Bug 1329194 - media:webrtc: Add platform defines for SH.
    - 5a74d13630a969473f72a143f37728f5bb87f552
    Bug 1329194 - mozbuild: Add SH4 as target architecture.
    - (not committed upstream yet)
    Bug 382214 - xpcom: Add xptcall support for Linux/SH
    - (not committed upstream yet)
    Bug 382214 - xpcom: Make SH xpctcall inline assembly position-independent

    Index: icedove-52.1.1/mozilla/build/moz.configure/init.configure ===================================================================
    --- icedove-52.1.1.orig/mozilla/build/moz.configure/init.configure
    +++ icedove-52.1.1/mozilla/build/moz.configure/init.configure
    @@ -383,6 +383,9 @@ def split_triplet(triplet):
    elif cpu in ('m68k'):
    canonical_cpu = 'm68k'
    endianness = 'big'
    + elif cpu == 'sh4':
    + canonical_cpu = 'sh4'
    + endianness = 'little'
    else:
    die('Unknown CPU type: %s' % cpu)

    Index: icedove-52.1.1/mozilla/python/mozbuild/mozbuild/configure/constants.py ===================================================================
    --- icedove-52.1.1.orig/mozilla/python/mozbuild/mozbuild/configure/constants.py +++ icedove-52.1.1/mozilla/python/mozbuild/mozbuild/configure/constants.py
    @@ -51,6 +51,7 @@ CPU_bitness = {
    'ppc64': 64,
    's390': 32,
    's390x': 64,
    + 'sh4': 32,
    'sparc': 32,
    'sparc64': 64,
    'x86': 32,
    @@ -87,6 +88,7 @@ CPU_preprocessor_checks = OrderedDict((
    ('mips64', '__mips64'),
    ('mips32', '__mips__'),
    ('m68k', '__m
  • From John Paul Adrian Glaubitz@21:1/5 to John Paul Adrian Glaubitz on Thu Jun 8 12:40:02 2017
    XPost: linux.debian.bugs.dist

    On Tue, Jun 06, 2017 at 10:34:11PM +0200, John Paul Adrian Glaubitz wrote:
    Updated patch attached.

    Ok, the patch is fine now as-is.

    Please note, Thunderbird will currently still FTBFS on sh4 with:

    LDDIR>>/obj-thunderbird/dist/include/nspr -I/<<PKGBUILDDIR>>/obj-thunderbird/dist/include/nspr -I/<<PKGBUILDDIR>>/obj-thunderbird/dist/include/nss -I/<<PKGBUILDDIR>>/obj-thunderbird/dist/private/nss -I/<<PKGBUILDDIR>>/obj-thunderbird/dist/include/nspr -
    DNSS_ENABLE_TLS13_SHORT_HEADERS object.c
    In file included from /<<PKGBUILDDIR>>/obj-thunderbird/dist/system_wrappers/sys/ucontext.h:3:0,
    from /usr/include/signal.h:326,
    from /<<PKGBUILDDIR>>/obj-thunderbird/dist/system_wrappers/signal.h:3,
    from /<<PKGBUILDDIR>>/obj-thunderbird/dist/include/mozilla/Assertions.h:67,
    from /<<PKGBUILDDIR>>/obj-thunderbird/dist/include/mozilla/Array.h:12,
    from /<<PKGBUILDDIR>>/mozilla/js/src/jit/BacktrackingAllocator.h:10,
    from /<<PKGBUILDDIR>>/mozilla/js/src/jit/BacktrackingAllocator.cpp:7,
    from /<<PKGBUILDDIR>>/obj-thunderbird/js/src/Unified_cpp_js_src8.cpp:2:
    /<<PKGBUILDDIR>>/mozilla/js/src/jit/BaselineCacheIR.cpp: In member function 'bool BaselineCacheIRCompiler::emitLoadFixedSlotResult()':
    /<<PKGBUILDDIR>>/mozilla/js/src/jit/BaselineCacheIR.cpp:857:55: error: reference to 'R0' is ambiguous
    masm.loadValue(BaseIndex(obj, scratch, TimesOne), R0);
    ^ /usr/include/sh4-linux-gnu/sys/ucontext.h:43:3: note: candidates are: <anonymous enum> R0
    R0 = 0,
    ^~
    /<<PKGBUILDDIR>>/mozilla/js/src/jit/none/SharedICRegisters-none.h:18:31: note: constexpr const js::jit::ValueOperand js::jit::R0
    static constexpr ValueOperand R0 = JSReturnOperand;
    ^ /<<PKGBUILDDIR>>/mozilla/js/src/jit/BaselineCacheIR.cpp: In member function 'bool BaselineCacheIRCompiler::emitLoadDynamicSlotResult()':
    /<<PKGBUILDDIR>>/mozilla/js/src/jit/BaselineCacheIR.cpp:871:55: error: reference to 'R0' is ambiguous
    masm.loadValue(BaseIndex(obj, scratch, TimesOne), R0);
    ^ /usr/include/sh4-linux-gnu/sys/ucontext.h:43:3: note: candidates are: <anonymous enum> R0
    R0 = 0,
    ^~
    /<<PKGBUILDDIR>>/mozilla/js/src/jit/none/SharedICRegisters-none.h:18:31: note: constexpr const js::jit::ValueOperand js::jit::R0
    static constexpr ValueOperand R0 = JSReturnOperand;
    ^ /<<PKGBUILDDIR>>/mozilla/js/src/jit/BaselineCacheIR.cpp: In member function 'bool BaselineCacheIRCompiler::emitLoadUnboxedPropertyResult()':
    /<<PKGBUILDDIR>>/mozilla/js/src/jit/BaselineCacheIR.cpp:886:76: error: reference to 'R0' is ambiguous
    masm.loadUnboxedProperty(BaseIndex(obj, scratch, TimesOne), fieldType, R0);
    ^ (...)

    However, this is a known bug in glibc which has been fixed in glibc_2.25 which won't unfortunately find its way into Debian before Stretch is released.

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)