ptr_to_globals with inconsistent types break the build

Bernhard Fischer rep.dot.nop at gmail.com
Wed Mar 14 13:02:11 UTC 2007


On Wed, Mar 14, 2007 at 01:51:43PM +0100, Bernhard Fischer wrote:
>On Tue, Mar 13, 2007 at 05:06:51PM -0700, vda at busybox.net wrote:
>>Author: vda
>>Date: 2007-03-13 17:06:51 -0700 (Tue, 13 Mar 2007)
>>New Revision: 18092
>>
>>Log:
>>gzip: reduce global data footprint, part 3
>>
>>
>>Modified:
>>   trunk/busybox/archival/gzip.c
>>   trunk/busybox/archival/libunarchive/decompress_unzip.c
>>   trunk/busybox/libbb/messages.c
>>
>>
>>Changeset:
>>Modified: trunk/busybox/archival/gzip.c
>>===================================================================
>>--- trunk/busybox/archival/gzip.c	2007-03-14 00:06:29 UTC (rev 18091)
>>+++ trunk/busybox/archival/gzip.c	2007-03-14 00:06:51 UTC (rev 18092)
>>@@ -355,8 +355,8 @@
>> 	uint32_t crc;	/* shift register contents */
>> };
>> 
>>-extern struct global1 *global_ptr;
>>-#define G1 (*(global_ptr - 1))
>>+extern struct global1 *ptr_to_globals;
>>+#define G1 (*(ptr_to_globals - 1))
>> 
>> 
>> /* ===========================================================================
>>Modified: trunk/busybox/libbb/messages.c
>>===================================================================
>>--- trunk/busybox/libbb/messages.c	2007-03-14 00:06:29 UTC (rev 18091)
>>+++ trunk/busybox/libbb/messages.c	2007-03-14 00:06:51 UTC (rev 18092)
>>@@ -56,4 +56,4 @@
>> 
>> char bb_common_bufsiz1[BUFSIZ+1];
>> 
>>-void *global_ptr;
>>+void *ptr_to_globals;
>
>This breaks --combine:
>                -Wl,--start-group -lcrypt -lm -Wl,--end-group
>libbb/messages.c:59: error: conflicting types for 'ptr_to_globals'
>archival/gzip.c:346: error: previous declaration of 'ptr_to_globals' was
>here
>make[1]: *** [busybox] Error 1
>
>Should use consistent types! Please fix..
>TIA and cheers,

BTW..
I have 3 patches here. Mind if i apply them (see respective changelogs
for the rationals):
http://www.busybox.net/cgi-bin/viewcvs.cgi/trunk/buildroot/package/busybox/
$ ls -1 busybox.*.patch
busybox.fix-ptr_to_globals.patch
busybox.mdev-just-read-9-bytes.patch
busybox.network-odd-dependencies.patch

thanks,



More information about the busybox mailing list