[gtranslator/gnome-41] Add libgda patch to fix the build on aarch64



commit 74380955b3b59edfe69a9f4c5ba1f96e2a10db74
Author: Daniel GarcĂ­a Moreno <dani danigm net>
Date:   Tue Sep 28 09:12:05 2021 +0200

    Add libgda patch to fix the build on aarch64
    
    https://gitlab.gnome.org/GNOME/libgda/-/issues/253

 build-aux/flatpak/org.gnome.Gtranslator.json       |   4 +
 ...ed-behavior-due-to-signed-integer-overflo.patch | 150 +++++++++++++++++++++
 2 files changed, 154 insertions(+)
---
diff --git a/build-aux/flatpak/org.gnome.Gtranslator.json b/build-aux/flatpak/org.gnome.Gtranslator.json
index ad685ea2..13d36ce3 100644
--- a/build-aux/flatpak/org.gnome.Gtranslator.json
+++ b/build-aux/flatpak/org.gnome.Gtranslator.json
@@ -92,6 +92,10 @@
                     "url" : "http://ftp.gnome.org/pub/GNOME/sources/libgda/6.0/libgda-6.0.0.tar.xz";,
                     "sha256" : "995f4b420e666da5c8bac9faf55e7aedbe3789c525d634720a53be3ccf27a670"
                 },
+                {
+                    "type" : "patch",
+                    "path" : "patches/0001-Fix-undefined-behavior-due-to-signed-integer-overflo.patch"
+                },
                 {
                     "type" : "patch",
                     "path" : "patches/libgda-no-gtkdoc-markers.patch"
diff --git a/build-aux/flatpak/patches/0001-Fix-undefined-behavior-due-to-signed-integer-overflo.patch 
b/build-aux/flatpak/patches/0001-Fix-undefined-behavior-due-to-signed-integer-overflo.patch
new file mode 100644
index 00000000..003c296d
--- /dev/null
+++ b/build-aux/flatpak/patches/0001-Fix-undefined-behavior-due-to-signed-integer-overflo.patch
@@ -0,0 +1,150 @@
+From 657b2f8497da907559a6769c5b1d2d7b5bd40688 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab suse de>
+Date: Sun, 25 Jul 2021 10:48:48 +0200
+Subject: [PATCH] Fix undefined behavior due to signed integer overflow
+
+---
+ libgda/sql-parser/lemon.c | 40 +++++++++++++++++++--------------------
+ 1 file changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/libgda/sql-parser/lemon.c b/libgda/sql-parser/lemon.c
+index cf0f3b3eb..a6fe75bb9 100644
+--- a/libgda/sql-parser/lemon.c
++++ b/libgda/sql-parser/lemon.c
+@@ -3505,7 +3505,7 @@ void print_stack_union(
+   int maxdtlength;          /* Maximum length of any ".datatype" field. */
+   char *stddt;              /* Standardized name for a datatype */
+   int i,j;                  /* Loop counters */
+-  int hash;                 /* For hashing the name of a type */
++  unsigned int hash;        /* For hashing the name of a type */
+   const char *name;         /* Name of the parser */
+ 
+   /* Allocate and initialize types[] and allocate stddt[] */
+@@ -3568,7 +3568,7 @@ void print_stack_union(
+         break;
+       }
+       hash++;
+-      if( hash>=arraysize ) hash = 0;
++      if( (int)hash>=arraysize ) hash = 0;
+     }
+     if( types[hash]==0 ){
+       sp->dtnum = hash + 1;
+@@ -4342,9 +4342,9 @@ int SetUnion(char *s1, char *s2)
+ ** Code for processing tables in the LEMON parser generator.
+ */
+ 
+-PRIVATE int strhash(const char *x)
++PRIVATE unsigned int strhash(const char *x)
+ {
+-  int h = 0;
++  unsigned int h = 0;
+   while( *x) h = h*13 + *(x++);
+   return h;
+ }
+@@ -4417,8 +4417,8 @@ void Strsafe_init(){
+ int Strsafe_insert(const char *data)
+ {
+   x1node *np;
+-  int h;
+-  int ph;
++  unsigned int h;
++  unsigned int ph;
+ 
+   if( x1a==0 ) return 0;
+   ph = strhash(data);
+@@ -4472,7 +4472,7 @@ int Strsafe_insert(const char *data)
+ ** if no such key. */
+ const char *Strsafe_find(const char *key)
+ {
+-  int h;
++  unsigned int h;
+   x1node *np;
+ 
+   if( x1a==0 ) return 0;
+@@ -4583,8 +4583,8 @@ void Symbol_init(){
+ int Symbol_insert(struct symbol *data, const char *key)
+ {
+   x2node *np;
+-  int h;
+-  int ph;
++  unsigned int h;
++  unsigned int ph;
+ 
+   if( x2a==0 ) return 0;
+   ph = strhash(key);
+@@ -4640,7 +4640,7 @@ int Symbol_insert(struct symbol *data, const char *key)
+ ** if no such key. */
+ struct symbol *Symbol_find(const char *key)
+ {
+-  int h;
++  unsigned int h;
+   x2node *np;
+ 
+   if( x2a==0 ) return 0;
+@@ -4714,9 +4714,9 @@ PRIVATE int statecmp(struct config *a, struct config *b)
+ }
+ 
+ /* Hash a state */
+-PRIVATE int statehash(struct config *a)
++PRIVATE unsigned int statehash(struct config *a)
+ {
+-  int h=0;
++  unsigned int h=0;
+   while( a ){
+     h = h*571 + a->rp->index*37 + a->dot;
+     a = a->bp;
+@@ -4782,8 +4782,8 @@ void State_init(){
+ int State_insert(struct state *data, struct config *key)
+ {
+   x3node *np;
+-  int h;
+-  int ph;
++  unsigned int h;
++  unsigned int ph;
+ 
+   if( x3a==0 ) return 0;
+   ph = statehash(key);
+@@ -4839,7 +4839,7 @@ int State_insert(struct state *data, struct config *key)
+ ** if no such key. */
+ struct state *State_find(struct config *key)
+ {
+-  int h;
++  unsigned int h;
+   x3node *np;
+ 
+   if( x3a==0 ) return 0;
+@@ -4869,9 +4869,9 @@ struct state **State_arrayof()
+ }
+ 
+ /* Hash a configuration */
+-PRIVATE int confighash(struct config *a)
++PRIVATE unsigned int confighash(struct config *a)
+ {
+-  int h=0;
++  unsigned int h=0;
+   h = h*571 + a->rp->index*37 + a->dot;
+   return h;
+ }
+@@ -4924,8 +4924,8 @@ void Configtable_init(){
+ int Configtable_insert(struct config *data)
+ {
+   x4node *np;
+-  int h;
+-  int ph;
++  unsigned int h;
++  unsigned int ph;
+ 
+   if( x4a==0 ) return 0;
+   ph = confighash(data);
+@@ -4979,7 +4979,7 @@ int Configtable_insert(struct config *data)
+ ** if no such key. */
+ struct config *Configtable_find(struct config *key)
+ {
+-  int h;
++  unsigned int h;
+   x4node *np;
+ 
+   if( x4a==0 ) return 0;
+-- 
+2.30.2
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]