• Bug#1068614: gmt: please add support for loong64

    From wuruilong@21:1/5 to All on Mon Apr 8 05:00:01 2024
    This is a multi-part MIME message sent by reportbug.


    Source: gmt
    Severity: normal
    Tags: patch
    User: debian-loongarch@lists.debian.org
    Usertags: loong64
    X-Debbugs-Cc: wuruilong@loongson.cn

    Dear Maintainer,

    gmt compiles incorrectly on loong64 architectures, the attached patch solves the problem and is verified.

    wuruilong

    -- System Information:
    Debian Release: trixie/sid
    APT prefers unreleased
    APT policy: (500, 'unreleased'), (500, 'unstable')
    Architecture: loong64 (loongarch64)

    Kernel: Linux 5.10.0-60.96.0.126.oe2203.loongarch64 (SMP w/32 CPU threads) Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: unable to detect

    Description: <short summary of the patch>
    TODO: Put a short summary on the line above and replace this paragraph
    with a longer explanation of this change. Complete the meta-information
    with other relevant fields (see below for details). To make it easier, the
    information below has been extracted from the changelog. Adjust it or drop
    it.
    .
    gmt (6.5.0+dfsg-3) unstable; urgency=medium
    .
    * Add dpkg-dev (>= 1.22.5) to build dependencies for t64 changes.
    Author: Bas Couwenberg <sebastic@debian.org>

    ---
    The information above should follow the Patch Tagging Guidelines, please checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
    are templates for supplementary fields that you might want to add:

    Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
    Bug: <upstream-bugtracker-url>
    Bug-Debian: https://bugs.debian.org/<bugnumber>
    Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
    Forwarded: (no|not-needed|<patch-forwarded-url>)
    Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
    Reviewed-By: <name and email of someone who approved/reviewed the patch> Last-Update: 2024-04-08

    --- gmt-6.5.0+dfsg.orig/src/gmt_common_sighandler.c
    +++ gmt-6.5.0+dfsg/src/gmt_common_sighandler.c
    @@ -109,6 +109,8 @@ GMT_LOCAL void backtrace_symbols_fd(void
    # define UC_IP(uc) ((void *) (uc)->uc_mcontext.sc_pc)
    # elif defined( __arm__)
    # define UC_IP(uc) ((void *) (uc)->uc_mcontext.arm_pc)
    +# elif defined( __loongarch__)
    +# define UC_IP(uc) ((void *) (uc)->