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

minor compilation problem on sparc



Hello,

  I just tried to build the latest boot-floppies for sparc (cvs tree from
2000/01/04), but I'm running in troubles with the following:

cc -Wall -O2 -fomit-frame-pointer   -c -o fdisk.o fdisk.c
In file included from /usr/include/asm/unaligned.h:6,
                 from /usr/include/linux/genhd.h:14,
                 from fdisk.c:17:
/usr/include/linux/string.h:12: parse error before `__extension__'
/usr/include/linux/string.h:13: parse error before `__extension__'
...

I'm using latest gcc 2.95.2-4 and libc6 2.1.2-11.

In fact, linux/genhd.h indirectly includes linux/string.h which redefines all
strxxx() prototypes.  However, string.h from libc6 already defines them as
macros (see bits/string2.h) ;((

The workaround is either to #define __NO_STRING_INLINES at the topmost of
fdisk.c or to compile with optimization in size (-Os ?).

I propose the patch below, no objections ?  What about other arches ?

It seems there is also bug in utilities Makefile: replace BB_INIT_RC_EXIT_CMD
by BB_INIT_CMD_IF_RC_SCRIPT_EXITS if you want init to relaunch dbootstrap at
its exit.

And at last, 3200KB for rootdisk is not enough for sparc.  I need 30KB more at
least.

I will apply all these patches to the CVS tree if you agree with.

Regards.


diff -ur boot-floppies-20000104.orig/Makefile boot-floppies-20000104/Makefile
--- boot-floppies-20000104.orig/Makefile	Tue Jan  4 21:53:03 2000
+++ boot-floppies-20000104/Makefile	Sun Dec  5 18:43:19 1999
@@ -977,7 +977,7 @@
 		$(arch_rootdisk_deps) \
 		rootdisk.sh common.sh Makefile keymaps.tgz \
 		utilities/dbootstrap/dbootstrap
-		./rootdisk.sh "" $(archive) 3200 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
+		./rootdisk.sh "" $(archive) 3300 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
 
 root-graphical.bin:	$(shell find scripts/rootdisk -type f ) \
 		$(shell find utilities -type f ) \
diff -ur boot-floppies-20000104.orig/utilities/Makefile boot-floppies-20000104/utilities/Makefile
--- boot-floppies-20000104.orig/utilities/Makefile	Sun Dec  5 18:45:22 1999
+++ boot-floppies-20000104/utilities/Makefile	Mon Jan  3 19:20:51 2000
@@ -18,7 +18,7 @@
 
 .PHONY:		$(SUBDIRS)
 $(SUBDIRS):
-	$(MAKE) -C $@ BB_INIT_RC_EXIT_CMD=\"dbootstrap\"
+	$(MAKE) -C $@ BB_INIT_CMD_IF_RC_SCRIPT_EXITS=\"dbootstrap\"
 
 clean:
 	rm -f *.o *.bak
diff -ur boot-floppies-20000104.orig/utilities/libfdisk/fdisk.c boot-floppies-20000104/utilities/libfdisk/fdisk.c
--- boot-floppies-20000104.orig/utilities/libfdisk/fdisk.c	Mon Jan  3 19:06:43 2000
+++ boot-floppies-20000104/utilities/libfdisk/fdisk.c	Tue Jan  4 21:30:23 2000
@@ -1,3 +1,9 @@
+
+/* to avoid parse error before `__extension__' in /usr/include/linux/string.h
+ * [sparc at least]
+ */
+#define __NO_STRING_INLINES
+
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
diff -ur boot-floppies-20000104.orig/utilities/lowmemrd/fdisk.c boot-floppies-20000104/utilities/lowmemrd/fdisk.c
--- boot-floppies-20000104.orig/utilities/lowmemrd/fdisk.c	Sun Dec  5 18:46:14 1999
+++ boot-floppies-20000104/utilities/lowmemrd/fdisk.c	Tue Jan  4 21:47:17 2000
@@ -52,6 +52,11 @@
  *
  */
 
+/* to avoid parse error before `__extension__' in /usr/include/linux/string.h
+ * [sparc at least]
+ */
+#define __NO_STRING_INLINES
+
 
 #include <unistd.h>
 #include <stdio.h>

-- 
 Eric Delaunay                 | S'il n'y a pas de solution, c'est qu'il n'y
 delaunay@lix.polytechnique.fr | a pas de problème.   Devise Shadok.


Reply to: