[Git][debian-gis-team/hdf4][master] Add patch by Dandan Zhang adding support for loongarch64. (closes: #1025745)

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Thu Dec 8 14:09:20 GMT 2022



Bas Couwenberg pushed to branch master at Debian GIS Project / hdf4


Commits:
f65af9cb by Bas Couwenberg at 2022-12-08T14:55:46+01:00
Add patch by Dandan Zhang adding support for loongarch64. (closes: #1025745)

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/loongarch.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libhdf4 (4.2.15-6) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Add patch by Dandan Zhang adding support for loongarch64.
+    (closes: #1025745)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 08 Dec 2022 14:55:11 +0100
+
 libhdf4 (4.2.15-5) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/loongarch.patch
=====================================
@@ -0,0 +1,118 @@
+Description: Add support for loongarch64.
+Author: Dandan Zhang <zhangdandan at loongson.cn>
+Bug-Debian: https://bugs.debian.org/1025745
+Forwarded: https://jira.hdfgroup.org/servicedesk/customer/portal/2/SUPPORT-1876
+
+--- a/hdf/src/hconv.h
++++ b/hdf/src/hconv.h
+@@ -59,7 +59,7 @@
+ /* CONSTANT DEFINITIONS                                                      */
+ /*****************************************************************************/
+ /* Generally Big-Endian machines */
+-#if !defined(INTEL86) && !defined(MIPSEL) && !defined(DEC_ALPHA) && !defined(I860) && !defined(SUN386) && !(defined(__ia64) && !(defined(hpux) || defined(__hpux))) && !defined(__x86_64__) && !(defined(__powerpc__) && defined(__LITTLE_ENDIAN__)) && !defined(__aarch64__) && !defined(__ARM_EABI__) && !defined(__riscv)
++#if !defined(INTEL86) && !defined(MIPSEL) && !defined(DEC_ALPHA) && !defined(I860) && !defined(SUN386) && !(defined(__ia64) && !(defined(hpux) || defined(__hpux))) && !defined(__x86_64__) && !(defined(__powerpc__) && defined(__LITTLE_ENDIAN__)) && !defined(__aarch64__) && !defined(__ARM_EABI__) && !defined(__riscv) && !defined(__loongarch64)
+ #       define UI8_IN     DFKnb1b   /* Unsigned Integer, 8 bits */
+ #       define UI8_OUT    DFKnb1b
+ #       define SI16_IN    DFKnb2b   /* S = Signed */
+--- a/hdf/src/hdfi.h
++++ b/hdf/src/hdfi.h
+@@ -84,6 +84,7 @@
+ #define     DFMT_SH             0x4441
+ #define     DFMT_SHEB           0x1111
+ #define     DFMT_RISCV64        0x4441
++#define     DFMT_LOONGARCH64    0x4441
+ 
+ /* I/O library constants */
+ #define UNIXUNBUFIO 1
+@@ -1087,6 +1088,58 @@ typedef long              hdf_pint_t;
+ 
+ #endif /* Linux/aarch64 */
+ 
++#if defined (__linux__) && defined (__loongarch64)
++
++#ifdef GOT_MACHINE
++If you get an error on this line more than one machine type has been defined.
++Please check your Makefile.
++#endif
++#define GOT_MACHINE 1
++
++#include <fcntl.h>
++#include <sys/types.h>      /* for unbuffered file I/O */
++#include <sys/stat.h>
++#include <unistd.h>
++#include <ctype.h>          /* for character macros */
++
++#define DF_MT             DFMT_LOONGARCH64
++
++typedef void              VOID;
++typedef void *            VOIDP;
++typedef char *            _fcd;
++typedef char              char8;
++typedef unsigned char     uchar8;
++typedef signed char       int8;
++typedef unsigned char     uint8;
++typedef short int         int16;
++typedef unsigned short int uint16;
++typedef int               int32;
++typedef unsigned int      uint32;
++typedef int               intn;
++typedef unsigned int      uintn;
++typedef float             float32;
++typedef double            float64;
++typedef int               intf;     /* size of INTEGERs in Fortran compiler */
++typedef long              hdf_pint_t;   /* an integer the same size as a pointer */
++#define FNAME_POST_UNDERSCORE
++#define _fcdtocp(desc) (desc)
++#define FILELIB UNIXBUFIO
++
++#ifndef BIG_LONGS
++#define BIG_LONGS
++#endif
++
++/* JPEG #define's - Look in the JPEG docs before changing - (Q) */
++
++/* Determine the memory manager we are going to use. Valid values are: */
++/*  MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS.  See the JPEG docs for details on */
++/*  what each does */
++#define JMEMSYS         MEM_ANSI
++#define HAVE_STDC
++#define INCLUDES_ARE_ANSI
++
++#endif /* Linux/loongarch64 */
++
+ #if defined (__linux__) && defined (__riscv) && (__riscv_xlen == 64)
+ 
+ #ifdef GOT_MACHINE
+--- a/mfhdf/libsrc/netcdf.h.in
++++ b/mfhdf/libsrc/netcdf.h.in
+@@ -293,7 +293,7 @@ typedef double        ncdouble;
+ /*
+  * Variables/attributes of type NC_LONG should use the C type 'nclong'
+  */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__ || (defined __sparc__ && defined __arch64__) || defined __s390x__ || defined __aarch64__ || (defined __riscv && __riscv_xlen == 64)
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__ || (defined __sparc__ && defined __arch64__) || defined __s390x__ || defined __aarch64__ || (defined __riscv && __riscv_xlen == 64) || defined __loongarch64
+ /*
+  * LP64 (also known as 4/8/8) denotes long and pointer as 64 bit types.
+  * http://www.unix.org/version2/whatsnew/lp64_wp.html
+--- a/mfhdf/ncgen/ncgen.l
++++ b/mfhdf/ncgen/ncgen.l
+@@ -113,7 +113,7 @@ FloatInf|Infinity|Inf    {    /* float m
+             yyerror(errstr);
+         }
+ 
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || __powerpc64__ || defined __s390x__ || defined __aarch64__ || (defined __riscv && __riscv_xlen == 64)
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || __powerpc64__ || defined __s390x__ || defined __aarch64__ || (defined __riscv && __riscv_xlen == 64) || defined __loongarch64
+         if (dd < INT_MIN  ||  dd > INT_MAX)
+ #else
+         if (dd < LONG_MIN  ||  dd > LONG_MAX)
+--- a/mfhdf/ncgen/ncgenyy.c
++++ b/mfhdf/ncgen/ncgenyy.c
+@@ -991,7 +991,7 @@ YY_RULE_SETUP
+             yyerror(errstr);
+         }
+ 
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__ || defined __aarch64__ || (defined __riscv && __riscv_xlen == 64)
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__ || defined __aarch64__ || (defined __riscv && __riscv_xlen == 64) || defined __loongarch64
+         if (dd < INT_MIN  ||  dd > INT_MAX)
+ #else
+         if (dd < LONG_MIN  ||  dd > LONG_MAX)


=====================================
debian/patches/series
=====================================
@@ -16,3 +16,4 @@ spelling-errors.patch
 manpage-has-errors-from-man.patch
 reproducible-builds.patch
 riscv64.diff
+loongarch.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/hdf4/-/commit/f65af9cbf3d709a7774212c3cabf690df70a0f5e

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/hdf4/-/commit/f65af9cbf3d709a7774212c3cabf690df70a0f5e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20221208/8e2d7065/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list