Bug#294474: busybox: FTBFS (amd64/gcc-4.0): conflicting types for 'build_bl_tree'

2005-06-15 Thread Andreas Jochens
The attached updated patch makes the latest version of 'busybox' compile
with gcc-4.0 on amd64.

Regards
Andreas Jochens

diff -urN ../tmp-orig/busybox-1.00/archival/gzip.c ./archival/gzip.c
--- ../tmp-orig/busybox-1.00/archival/gzip.c2004-04-15 22:52:48.0 
+0200
+++ ./archival/gzip.c   2005-06-15 10:52:24.0 +0200
@@ -2162,7 +2162,7 @@
  * Construct the Huffman tree for the bit lengths and return the index in
  * bl_order of the last bit length code to send.
  */
-static const int build_bl_tree()
+static int build_bl_tree()
 {
int max_blindex;/* index of last bit length code of non zero 
freq */
 
diff -urN ../tmp-orig/busybox-1.00/modutils/obj/depmod.c ./modutils/obj/depmod.c
--- ../tmp-orig/busybox-1.00/modutils/obj/depmod.c  2005-06-15 
11:54:49.0 +0200
+++ ./modutils/obj/depmod.c 2005-06-15 11:51:56.0 +0200
@@ -642,7 +642,7 @@
 
for (ksym = ksyms; so_far  nksyms; ++so_far, ksym++) {
if (strncmp((char *)ksym-name, GPLONLY_, 8) == 0)
-   ((char *)ksym-name) += 8;
+   ksym-name = ((char *)ksym-name) + 8;
assert(n_syms  MAX_MAP_SYM);
symtab[n_syms++] = addsym((char *)ksym-name, mod, 
SYM_DEFINED, 0);
}
diff -urN ../tmp-orig/busybox-1.00/modutils/obj/insmod.c ./modutils/obj/insmod.c
--- ../tmp-orig/busybox-1.00/modutils/obj/insmod.c  2005-06-15 
11:54:49.0 +0200
+++ ./modutils/obj/insmod.c 2005-06-15 11:52:20.0 +0200
@@ -119,7 +119,7 @@
if (strncmp((char *)s-name, GPLONLY_, 8) == 0) {
gplonly_seen = 1;
if (gpl)
-   ((char *)s-name) += 8;
+   s-name = ((char *)s-name) + 8;
else
continue;
}
diff -urN ../tmp-orig/busybox-1.00/modutils/obj/obj_kallsyms.c 
./modutils/obj/obj_kallsyms.c
--- ../tmp-orig/busybox-1.00/modutils/obj/obj_kallsyms.c2005-06-15 
11:54:49.0 +0200
+++ ./modutils/obj/obj_kallsyms.c   2005-06-15 11:53:30.0 +0200
@@ -200,8 +200,8 @@
 
 /* Initial contents, header + one entry per input section.  No strings. */
 osec-header.sh_size = sizeof(*a_hdr) + loaded*sizeof(*a_sec);
-a_hdr = (struct kallsyms_header *) osec-contents =
-   xmalloc(osec-header.sh_size);
+osec-contents = xmalloc(osec-header.sh_size);
+a_hdr = (struct kallsyms_header *) osec-contents;
 memset(osec-contents, 0, osec-header.sh_size);
 a_hdr-size = sizeof(*a_hdr);
 a_hdr-sections = loaded;
@@ -275,8 +275,8 @@
a_hdr-symbol_off +
a_hdr-symbols*a_hdr-symbol_size +
strings_size - strings_left;
-a_hdr = (struct kallsyms_header *) osec-contents =
-   xrealloc(a_hdr, a_hdr-total_size);
+osec-contents = xrealloc(a_hdr, a_hdr-total_size);
+a_hdr = (struct kallsyms_header *) osec-contents;
 p = (char *)a_hdr + a_hdr-symbol_off;
 memcpy(p, symbols, a_hdr-symbols*a_hdr-symbol_size);
 free(symbols);
diff -urN ../tmp-orig/busybox-1.00/networking/ifupdown.c ./networking/ifupdown.c
--- ../tmp-orig/busybox-1.00/networking/ifupdown.c  2005-06-09 
16:10:17.0 +0200
+++ ./networking/ifupdown.c 2005-06-15 11:50:13.0 +0200
@@ -150,6 +150,7 @@
 
 static char no_act = 0;
 static char verbose = 0;
+#define environ environ_local
 static char **environ = NULL;
 
 #ifdef CONFIG_FEATURE_IFUPDOWN_IP
diff -urN ../tmp-orig/busybox-1.00/debian/control ./debian/control
--- ../tmp-orig/busybox-1.00/debian/control 2005-06-15 11:54:49.0 
+0200
+++ ./debian/control2005-06-15 11:54:43.0 +0200
@@ -69,7 +69,7 @@
 
 Package: busybox-floppy-udeb
 XC-Package-Type: udeb
-Architecture: i386
+Architecture: amd64 i386
 Depends: ${shlibs:Depends}
 Section: debian-installer
 Priority: extra


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#294474: busybox: FTBFS (amd64/gcc-4.0): conflicting types for 'build_bl_tree'

2005-02-09 Thread Andreas Jochens
Package: busybox
Severity: normal
Tags: patch

When building 'busybox' on amd64 with gcc-4.0,
I get the following error:

gcc -Wall -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE  -DBB_VER='0.60.5' 
-DBB_BT='2005.02.09-21:18+'  -I- -I. -I../../ -c ../../gzip.c -o gzip.o
cc1: note: obsolete option -I- used, please use -iquote instead
../../gzip.c:2177: warning: type qualifiers ignored on function return type
../../gzip.c:2177: error: conflicting types for 'build_bl_tree'
../../gzip.c:1651: error: previous declaration of 'build_bl_tree' was here
make[1]: *** [gzip.o] Error 1
make[1]: Leaving directory `/busybox-0.60.5/debian/busybox_builddir'
make: *** [debian/build-stamp-busybox] Error 2

With the attached patch 'busybox' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/busybox-0.60.5/gzip.c ./gzip.c
--- ../tmp-orig/busybox-0.60.5/gzip.c   2002-02-28 03:54:37.0 +
+++ ./gzip.c2005-02-09 20:51:48.240258773 +
@@ -2173,7 +2173,7 @@
  * Construct the Huffman tree for the bit lengths and return the index in
  * bl_order of the last bit length code to send.
  */
-static const int build_bl_tree()
+static int build_bl_tree()
 {
int max_blindex;/* index of last bit length 
code of non zero freq */
 
diff -urN ../tmp-orig/busybox-0.60.5/mkfs_minix.c ./mkfs_minix.c
--- ../tmp-orig/busybox-0.60.5/mkfs_minix.c 2001-08-29 19:02:26.0 
+
+++ ./mkfs_minix.c  2005-02-09 21:09:45.602797493 +
@@ -541,9 +541,8 @@
memset(super_block_buffer, 0, BLOCK_SIZE);
memset(boot_block_buffer, 0, 512);
MAGIC = magic;
-   ZONESIZE = 0;
-   MAXSIZE = version2 ? 0x7fff : (7 + 512 + 512 * 512) * 1024;
-   ZONES = BLOCKS;
+   Super.s_log_zone_size = 0;
+   Super.s_max_size = version2 ? 0x7fff : (7 + 512 + 512 * 512) * 1024;
 /* some magic nrs: 1 inode / 3 blocks */
if (req_nr_inodes == 0)
inodes = BLOCKS / 3;
@@ -551,23 +550,27 @@
inodes = req_nr_inodes;
/* Round up inode count to fill block size */
 #ifdef BB_FEATURE_MINIX2
-   if (version2)
+   if (version2) {
+   Super.s_zones = BLOCKS;
inodes = ((inodes + MINIX2_INODES_PER_BLOCK - 1) 
  ~(MINIX2_INODES_PER_BLOCK - 1));
-   else
+   } else
 #endif
+   {
+   Super.s_nzones = BLOCKS;
inodes = ((inodes + MINIX_INODES_PER_BLOCK - 1) 
  ~(MINIX_INODES_PER_BLOCK - 1));
+   }
if (inodes  65535)
inodes = 65535;
-   INODES = inodes;
-   IMAPS = UPPER(INODES + 1, BITS_PER_BLOCK);
-   ZMAPS = 0;
+   Super.s_ninodes = inodes;
+   Super.s_imap_blocks = UPPER(INODES + 1, BITS_PER_BLOCK);
+   Super.s_zmap_blocks = 0;
i = 0;
while (ZMAPS !=
   UPPER(BLOCKS - (2 + IMAPS + ZMAPS + INODE_BLOCKS) + 1,
 BITS_PER_BLOCK)  i  1000) {
-   ZMAPS =
+   Super.s_zmap_blocks =
UPPER(BLOCKS - (2 + IMAPS + ZMAPS + INODE_BLOCKS) + 1,
  BITS_PER_BLOCK);
i++;
@@ -581,7 +584,7 @@
if (i = 999) {
error_msg_and_die(unable to allocate buffers for maps);
}
-   FIRSTZONE = NORM_FIRSTZONE;
+   Super.s_firstdatazone = NORM_FIRSTZONE;
inode_map = xmalloc(IMAPS * BLOCK_SIZE);
zone_map = xmalloc(ZMAPS * BLOCK_SIZE);
memset(inode_map, 0xff, IMAPS * BLOCK_SIZE);


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]