All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] bind: rename ptrsize to ptr_size in the code
@ 2016-01-22 11:41 Gustavo Zacarias
  2016-01-26 21:48 ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo Zacarias @ 2016-01-22 11:41 UTC (permalink / raw)
  To: buildroot

uClibc in commit 70a04a28 #defined ptrsize globally in bits/setjmp.h for
mips. However this is a common variable name and causes build failure
for at least bind.
So rename ptrsize to ptr_size in bind to avoid this. Fixes:
http://autobuild.buildroot.net/results/a92/a92fa5dc5d9d6742d61d4d293f7eac97c5355dfe/

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/bind/0003-Rename-ptrsize-to-ptr_size.patch | 74 ++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 package/bind/0003-Rename-ptrsize-to-ptr_size.patch

diff --git a/package/bind/0003-Rename-ptrsize-to-ptr_size.patch b/package/bind/0003-Rename-ptrsize-to-ptr_size.patch
new file mode 100644
index 0000000..e3b58e2
--- /dev/null
+++ b/package/bind/0003-Rename-ptrsize-to-ptr_size.patch
@@ -0,0 +1,74 @@
+From 254dc19788ba2a03504fc6d1036fef477a60035f Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Fri, 22 Jan 2016 08:31:02 -0300
+Subject: [PATCH] Rename ptrsize to ptr_size
+
+This is to compensate for a uClibc mess caused by commit
+70a04a287a2875c82e6822c36e071afba5b63a62 where ptrsize is defined for
+mips, hence causing build breakage under certain conditions for programs
+that use this variable name.
+
+Status: definitely not upstreamable.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+---
+ lib/dns/rbt.c   | 6 +++---
+ lib/dns/rbtdb.c | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c
+index 86b5183..5fd55de 100644
+--- a/lib/dns/rbt.c
++++ b/lib/dns/rbt.c
+@@ -113,7 +113,7 @@ struct file_header {
+ 	 * information about the system on which the map file was generated
+ 	 * will be used to tell if we can load the map file or not
+ 	 */
+-	isc_uint32_t ptrsize;
++	isc_uint32_t ptr_size;
+ 	unsigned int bigendian:1;	/* big or little endian system */
+ 	unsigned int rdataset_fixed:1;	/* compiled with --enable-rrset-fixed */
+ 	unsigned int nodecount;		/* shadow from rbt structure */
+@@ -517,7 +517,7 @@ write_header(FILE *file, dns_rbt_t *rbt, isc_uint64_t first_node_offset,
+ 	memmove(header.version1, FILE_VERSION, sizeof(header.version1));
+ 	memmove(header.version2, FILE_VERSION, sizeof(header.version2));
+ 	header.first_node_offset = first_node_offset;
+-	header.ptrsize = (isc_uint32_t) sizeof(void *);
++	header.ptr_size = (isc_uint32_t) sizeof(void *);
+ 	header.bigendian = (1 == htonl(1)) ? 1 : 0;
+ 
+ #ifdef DNS_RDATASET_FIXED
+@@ -902,7 +902,7 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize,
+ 	}
+ #endif
+ 
+-	if (header->ptrsize != (isc_uint32_t) sizeof(void *)) {
++	if (header->ptr_size != (isc_uint32_t) sizeof(void *)) {
+ 		result = ISC_R_INVALIDFILE;
+ 		goto cleanup;
+ 	}
+diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c
+index c7168cb..dbcf944 100644
+--- a/lib/dns/rbtdb.c
++++ b/lib/dns/rbtdb.c
+@@ -114,7 +114,7 @@ typedef struct rbtdb_file_header rbtdb_file_header_t;
+ 
+ struct rbtdb_file_header {
+ 	char version1[32];
+-	isc_uint32_t ptrsize;
++	isc_uint32_t ptr_size;
+ 	unsigned int bigendian:1;
+ 	isc_uint64_t tree;
+ 	isc_uint64_t nsec;
+@@ -7593,7 +7593,7 @@ rbtdb_write_header(FILE *rbtfile, off_t tree_location, off_t nsec_location,
+ 	memset(&header, 0, sizeof(rbtdb_file_header_t));
+ 	memmove(header.version1, FILE_VERSION, sizeof(header.version1));
+ 	memmove(header.version2, FILE_VERSION, sizeof(header.version2));
+-	header.ptrsize = (isc_uint32_t) sizeof(void *);
++	header.ptr_size = (isc_uint32_t) sizeof(void *);
+ 	header.bigendian = (1 == htonl(1)) ? 1 : 0;
+ 	header.tree = (isc_uint64_t) tree_location;
+ 	header.nsec = (isc_uint64_t) nsec_location;
+-- 
+2.4.10
+
-- 
2.4.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] bind: rename ptrsize to ptr_size in the code
  2016-01-22 11:41 [Buildroot] [PATCH] bind: rename ptrsize to ptr_size in the code Gustavo Zacarias
@ 2016-01-26 21:48 ` Peter Korsgaard
  2016-01-26 22:44   ` Gustavo Zacarias
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2016-01-26 21:48 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 > uClibc in commit 70a04a28 #defined ptrsize globally in bits/setjmp.h for
 > mips. However this is a common variable name and causes build failure
 > for at least bind.
 > So rename ptrsize to ptr_size in bind to avoid this. Fixes:
 > http://autobuild.buildroot.net/results/a92/a92fa5dc5d9d6742d61d4d293f7eac97c5355dfe/

:/

Committed, thanks.

What bind version is this patch against? It applies both before and
after the security bump, both with an offset:

Applying 0003-Rename-ptrsize-to-ptr_size.patch using patch: 
patching file lib/dns/rbt.c
Hunk #2 succeeded at 480 (offset -37 lines).
Hunk #3 succeeded at 865 (offset -37 lines).
patching file lib/dns/rbtdb.c
Hunk #2 succeeded at 7536 (offset -57 lines).

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] bind: rename ptrsize to ptr_size in the code
  2016-01-26 21:48 ` Peter Korsgaard
@ 2016-01-26 22:44   ` Gustavo Zacarias
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2016-01-26 22:44 UTC (permalink / raw)
  To: buildroot

On 26/01/16 18:48, Peter Korsgaard wrote:

> What bind version is this patch against? It applies both before and
> after the security bump, both with an offset:
>
> Applying 0003-Rename-ptrsize-to-ptr_size.patch using patch:
> patching file lib/dns/rbt.c
> Hunk #2 succeeded at 480 (offset -37 lines).
> Hunk #3 succeeded at 865 (offset -37 lines).
> patching file lib/dns/rbtdb.c
> Hunk #2 succeeded at 7536 (offset -57 lines).

Hi.
It's against git master.
Regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-26 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-22 11:41 [Buildroot] [PATCH] bind: rename ptrsize to ptr_size in the code Gustavo Zacarias
2016-01-26 21:48 ` Peter Korsgaard
2016-01-26 22:44   ` Gustavo Zacarias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.