pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/netsurf Apply upstream fix for a build issue on 64...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/483407ff4416
branches:  trunk
changeset: 355524:483407ff4416
user:      martin <martin%pkgsrc.org@localhost>
date:      Sun Dec 04 12:41:47 2016 +0000

description:
Apply upstream fix for a build issue on 64bit big endian machines

diffstat:

 www/netsurf/distinfo                                       |    8 +-
 www/netsurf/patches/patch-nsgenbind_src_nsgenbind-ast.c    |   48 +
 www/netsurf/patches/patch-nsgenbind_src_nsgenbind-ast.h    |   47 +
 www/netsurf/patches/patch-nsgenbind_src_nsgenbind-parser.y |   93 +++
 www/netsurf/patches/patch-nsgenbind_src_webidl-ast.c       |   59 ++
 www/netsurf/patches/patch-nsgenbind_src_webidl-ast.h       |   46 +
 www/netsurf/patches/patch-nsgenbind_src_webidl-parser.y    |  352 +++++++++++++
 7 files changed, 652 insertions(+), 1 deletions(-)

diffs (truncated from 688 to 300 lines):

diff -r cd20a952fdfb -r 483407ff4416 www/netsurf/distinfo
--- a/www/netsurf/distinfo      Sun Dec 04 10:03:24 2016 +0000
+++ b/www/netsurf/distinfo      Sun Dec 04 12:41:47 2016 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2016/11/20 13:02:14 leot Exp $
+$NetBSD: distinfo,v 1.8 2016/12/04 12:41:47 martin Exp $
 
 SHA1 (netsurf-all-3.6.tar.gz) = d25345415b9b26343c22929280c48066302da916
 RMD160 (netsurf-all-3.6.tar.gz) = 73b7768434b5365c912761837f7d6003c28fb84c
@@ -6,3 +6,9 @@
 Size (netsurf-all-3.6.tar.gz) = 8403623 bytes
 SHA1 (patch-netsurf_utils_config.h) = de48304e3484a883509ea3ad92658788f7869041
 SHA1 (patch-nsgenbind_src_Makefile) = 1798b84c28fbb9bbdaafe3f182fbd301f5438df1
+SHA1 (patch-nsgenbind_src_nsgenbind-ast.c) = 5931ab321f15dc9754b71545d40bac01274938f6
+SHA1 (patch-nsgenbind_src_nsgenbind-ast.h) = acae94b6386be7dbde190eb7218a25a622b4763b
+SHA1 (patch-nsgenbind_src_nsgenbind-parser.y) = d16777ad3dde63ff4e00553103998326a1ad2903
+SHA1 (patch-nsgenbind_src_webidl-ast.c) = 09d8007e7e5a7b9799a721f180ee16b2cfbda0a9
+SHA1 (patch-nsgenbind_src_webidl-ast.h) = e01bf956b170ad53c60c993ec728d03d1b208e5b
+SHA1 (patch-nsgenbind_src_webidl-parser.y) = 930e39c1efa0fb4c4d4d9737584f83250cbb4a8f
diff -r cd20a952fdfb -r 483407ff4416 www/netsurf/patches/patch-nsgenbind_src_nsgenbind-ast.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/netsurf/patches/patch-nsgenbind_src_nsgenbind-ast.c   Sun Dec 04 12:41:47 2016 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-nsgenbind_src_nsgenbind-ast.c,v 1.1 2016/12/04 12:41:47 martin Exp $
+
+Backport of upstream:
+
+commit 3b3b926d7fb92361b1e8eed2efb351c32cb7bfaa
+Author: Vincent Sanders <vince%kyllikki.org@localhost>
+Date:   Sun Nov 27 14:17:11 2016 +0000
+
+    restructure AST node creation to avoid casts
+    
+    This changes Abstract Syntax Tree node creation for both webidl and
+    genbind syntax tress. If a node is to be created with a numeric value
+    instead of a pointer a separate API is now used instead of casting
+    through void.
+    
+    This fixes parsing and AST building on big endian 64bit platforms
+    where casting through void, which is completely undefined behaviour,
+    generates different and non-functioning code. The solution in this
+    patch is properly portable and correct without relying on casting at
+    all.
+    
+    Thanks to James Clarke <jrtc27%jrtc27.com@localhost> for the original debugging
+    and patch demonstrating how to work round the bug.
+
+diff --git a/src/nsgenbind-ast.c b/src/nsgenbind-ast.c
+index 49732a0..f78fe26 100644
+--- nsgenbind/src/nsgenbind-ast.c.orig
++++ nsgenbind/src/nsgenbind-ast.c
+@@ -132,6 +132,19 @@ genbind_new_node(enum genbind_node_type type, struct genbind_node *l, void *r)
+         return nn;
+ }
+ 
++struct genbind_node *
++genbind_new_number_node(enum genbind_node_type type,
++                        struct genbind_node *l,
++                        int number)
++{
++        struct genbind_node *nn;
++        nn = calloc(1, sizeof(struct genbind_node));
++        nn->type = type;
++        nn->l = l;
++        nn->r.number = number;
++        return nn;
++}
++
+ 
+ /* exported interface defined in nsgenbind-ast.h */
+ int
diff -r cd20a952fdfb -r 483407ff4416 www/netsurf/patches/patch-nsgenbind_src_nsgenbind-ast.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/netsurf/patches/patch-nsgenbind_src_nsgenbind-ast.h   Sun Dec 04 12:41:47 2016 +0000
@@ -0,0 +1,47 @@
+$NetBSD: patch-nsgenbind_src_nsgenbind-ast.h,v 1.1 2016/12/04 12:41:47 martin Exp $
+
+Backport of upstream:
+
+commit 3b3b926d7fb92361b1e8eed2efb351c32cb7bfaa
+Author: Vincent Sanders <vince%kyllikki.org@localhost>
+Date:   Sun Nov 27 14:17:11 2016 +0000
+
+    restructure AST node creation to avoid casts
+    
+    This changes Abstract Syntax Tree node creation for both webidl and
+    genbind syntax tress. If a node is to be created with a numeric value
+    instead of a pointer a separate API is now used instead of casting
+    through void.
+    
+    This fixes parsing and AST building on big endian 64bit platforms
+    where casting through void, which is completely undefined behaviour,
+    generates different and non-functioning code. The solution in this
+    patch is properly portable and correct without relying on casting at
+    all.
+    
+    Thanks to James Clarke <jrtc27%jrtc27.com@localhost> for the original debugging
+    and patch demonstrating how to work round the bug.
+
+diff --git a/src/nsgenbind-ast.h b/src/nsgenbind-ast.h
+index 49db23b..6fb7221 100644
+--- nsgenbind/src/nsgenbind-ast.h.orig
++++ nsgenbind/src/nsgenbind-ast.h
+@@ -71,7 +71,18 @@ int genbind_parsefile(char *infilename, struct genbind_node **ast);
+ 
+ char *genbind_strapp(char *a, char *b);
+ 
++/**
++ * create a new node with value from pointer
++ */
+ struct genbind_node *genbind_new_node(enum genbind_node_type type, struct genbind_node *l, void *r);
++
++/**
++ * create a new number node
++ *
++ * Create a node with of number type
++ */
++struct genbind_node *genbind_new_number_node(enum genbind_node_type type, struct genbind_node *l, int number);
++
+ struct genbind_node *genbind_node_link(struct genbind_node *tgt, struct genbind_node *src);
+ 
+ struct genbind_node *genbind_node_prepend(struct genbind_node *list, struct genbind_node *inst);
diff -r cd20a952fdfb -r 483407ff4416 www/netsurf/patches/patch-nsgenbind_src_nsgenbind-parser.y
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/netsurf/patches/patch-nsgenbind_src_nsgenbind-parser.y        Sun Dec 04 12:41:47 2016 +0000
@@ -0,0 +1,93 @@
+$NetBSD: patch-nsgenbind_src_nsgenbind-parser.y,v 1.1 2016/12/04 12:41:47 martin Exp $
+
+Backport of upstream:
+
+commit 3b3b926d7fb92361b1e8eed2efb351c32cb7bfaa
+Author: Vincent Sanders <vince%kyllikki.org@localhost>
+Date:   Sun Nov 27 14:17:11 2016 +0000
+
+    restructure AST node creation to avoid casts
+    
+    This changes Abstract Syntax Tree node creation for both webidl and
+    genbind syntax tress. If a node is to be created with a numeric value
+    instead of a pointer a separate API is now used instead of casting
+    through void.
+    
+    This fixes parsing and AST building on big endian 64bit platforms
+    where casting through void, which is completely undefined behaviour,
+    generates different and non-functioning code. The solution in this
+    patch is properly portable and correct without relying on casting at
+    all.
+    
+    Thanks to James Clarke <jrtc27%jrtc27.com@localhost> for the original debugging
+    and patch demonstrating how to work round the bug.
+
+diff --git a/src/nsgenbind-parser.y b/src/nsgenbind-parser.y
+index c6b9a74..fd41c37 100644
+--- nsgenbind/src/nsgenbind-parser.y.orig
++++ nsgenbind/src/nsgenbind-parser.y
+@@ -138,17 +138,17 @@ add_method(struct genbind_node **genbind_ast,
+         }
+ 
+         location_node = genbind_new_node(GENBIND_NODE_TYPE_FILE,
+-                                genbind_new_node(GENBIND_NODE_TYPE_LINE,
+-                                                 cdata_node,
+-                                                 (void *)lineno),
++                                genbind_new_number_node(GENBIND_NODE_TYPE_LINE,
++                                                        cdata_node,
++                                                        lineno),
+                                          strdup(filename));
+ 
+         /* generate method node */
+         method_node = genbind_new_node(GENBIND_NODE_TYPE_METHOD,
+                                  NULL,
+-                                 genbind_new_node(GENBIND_NODE_TYPE_METHOD_TYPE,
++                                 genbind_new_number_node(GENBIND_NODE_TYPE_METHOD_TYPE,
+                                                   location_node,
+-                                                  (void *)methodtype));
++                                                  methodtype));
+ 
+         class_node = genbind_node_find_type_ident(*genbind_ast,
+                                                   NULL,
+@@ -304,11 +304,11 @@ BindingArg:
+         {
+                 $$ = genbind_new_node(GENBIND_NODE_TYPE_METHOD,
+                         NULL,
+-                        genbind_new_node(GENBIND_NODE_TYPE_METHOD_TYPE,
++                        genbind_new_number_node(GENBIND_NODE_TYPE_METHOD_TYPE,
+                                 genbind_new_node(GENBIND_NODE_TYPE_CDATA,
+                                                  NULL,
+                                                  $2),
+-                                (void *)$1));
++                                $1));
+         }
+         ;
+ 
+@@ -568,11 +568,11 @@ ClassArg:
+         TOK_PROPERTY Modifiers TOK_IDENTIFIER ';'
+         {
+                 $$ = genbind_new_node(GENBIND_NODE_TYPE_PROPERTY, NULL,
+-                        genbind_new_node(GENBIND_NODE_TYPE_MODIFIER,
++                        genbind_new_number_node(GENBIND_NODE_TYPE_MODIFIER,
+                                 genbind_new_node(GENBIND_NODE_TYPE_IDENT,
+                                                  NULL,
+                                                  $3),
+-                                         (void *)$2));
++                                         $2));
+         }
+         |
+         TOK_FLAGS ClassFlags ';'
+@@ -584,11 +584,11 @@ ClassArg:
+         {
+                 $$ = genbind_new_node(GENBIND_NODE_TYPE_METHOD,
+                         NULL,
+-                        genbind_new_node(GENBIND_NODE_TYPE_METHOD_TYPE,
++                        genbind_new_number_node(GENBIND_NODE_TYPE_METHOD_TYPE,
+                                 genbind_new_node(GENBIND_NODE_TYPE_CDATA,
+                                                  NULL,
+                                                  $2),
+-                                (void *)$1));
++                                $1));
+         }
+         ;
+ 
diff -r cd20a952fdfb -r 483407ff4416 www/netsurf/patches/patch-nsgenbind_src_webidl-ast.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/netsurf/patches/patch-nsgenbind_src_webidl-ast.c      Sun Dec 04 12:41:47 2016 +0000
@@ -0,0 +1,59 @@
+$NetBSD: patch-nsgenbind_src_webidl-ast.c,v 1.1 2016/12/04 12:41:47 martin Exp $
+
+Backport of upstream:
+
+commit 3b3b926d7fb92361b1e8eed2efb351c32cb7bfaa
+Author: Vincent Sanders <vince%kyllikki.org@localhost>
+Date:   Sun Nov 27 14:17:11 2016 +0000
+
+    restructure AST node creation to avoid casts
+    
+    This changes Abstract Syntax Tree node creation for both webidl and
+    genbind syntax tress. If a node is to be created with a numeric value
+    instead of a pointer a separate API is now used instead of casting
+    through void.
+    
+    This fixes parsing and AST building on big endian 64bit platforms
+    where casting through void, which is completely undefined behaviour,
+    generates different and non-functioning code. The solution in this
+    patch is properly portable and correct without relying on casting at
+    all.
+    
+    Thanks to James Clarke <jrtc27%jrtc27.com@localhost> for the original debugging
+    and patch demonstrating how to work round the bug.
+
+diff --git a/src/webidl-ast.c b/src/webidl-ast.c
+index 0d908ce..a1133e3 100644
+--- nsgenbind/src/webidl-ast.c.orig
++++ nsgenbind/src/webidl-ast.c
+@@ -120,6 +120,7 @@ webidl_node_add(struct webidl_node *node, struct webidl_node *list)
+ 
+ 
+ struct webidl_node *
++/* exported interface documented in webidl-ast.h */
+ webidl_node_new(enum webidl_node_type type,
+               struct webidl_node *l,
+               void *r)
+@@ -128,7 +129,21 @@ webidl_node_new(enum webidl_node_type type,
+       nn = calloc(1, sizeof(struct webidl_node));
+       nn->type = type;
+       nn->l = l;
+-      nn->r.text = r;
++      nn->r.value = r;
++      return nn;
++}
++
++/* exported interface documented in webidl-ast.h */
++struct webidl_node *
++webidl_new_number_node(enum webidl_node_type type,
++                       struct webidl_node *l,
++                       int number)
++{
++      struct webidl_node *nn;
++      nn = calloc(1, sizeof(struct webidl_node));
++      nn->type = type;
++      nn->l = l;
++      nn->r.number = number;
+       return nn;
+ }
+ 
diff -r cd20a952fdfb -r 483407ff4416 www/netsurf/patches/patch-nsgenbind_src_webidl-ast.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/netsurf/patches/patch-nsgenbind_src_webidl-ast.h      Sun Dec 04 12:41:47 2016 +0000
@@ -0,0 +1,46 @@
+$NetBSD: patch-nsgenbind_src_webidl-ast.h,v 1.1 2016/12/04 12:41:47 martin Exp $
+
+Backport of upstream:
+
+commit 3b3b926d7fb92361b1e8eed2efb351c32cb7bfaa
+Author: Vincent Sanders <vince%kyllikki.org@localhost>
+Date:   Sun Nov 27 14:17:11 2016 +0000
+
+    restructure AST node creation to avoid casts
+    
+    This changes Abstract Syntax Tree node creation for both webidl and
+    genbind syntax tress. If a node is to be created with a numeric value
+    instead of a pointer a separate API is now used instead of casting
+    through void.



Home | Main Index | Thread Index | Old Index