[uClibc] iproute2 doesn't build

Chris Wilson chris at netservers.co.uk
Fri Apr 23 16:47:13 UTC 2004


Hi all,

Thanks to everyone who offered advice about Perl. I will get back to you 
all shortly :-).

The build of iproute2 seems to be broken in current CVS. The iproute2
developers helpfully decided to replace netinet/in.h with their own stub.  
Obviously they consider that glibc's version of that file is completely
useless.

Unfortunately, one thing in that file is the definition of htonl, which 
iproute2 needs:

/home/chris/firerack/uclibc/build_i386/staging_dir/bin/i386-linux-uclibc-gcc 
-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -Werror -g -I../include-glibc 
-include ../include-glibc/glibc-bugs.h 
-I/home/chris/firerack/uclibc/toolchain_build_i386/linux/include 
-I../include -DRESOLVE_HOSTNAMES   -c -o utils.o utils.c
In file included from ../include/utils.h:6,
                 from utils.c:30:
/home/chris/firerack/uclibc/toolchain_build_i386/linux/include/linux/inetdevice.h: 
In function `inet_make_mask':
/home/chris/firerack/uclibc/toolchain_build_i386/linux/include/linux/inetdevice.h:168: 
warning: implicit declaration of function `htonl'
/home/chris/firerack/uclibc/toolchain_build_i386/linux/include/linux/inetdevice.h: 
In function `inet_mask_len':
/home/chris/firerack/uclibc/toolchain_build_i386/linux/include/linux/inetdevice.h:174: 
warning: implicit declaration of function `ntohl'
make[2]: *** [utils.o] Error 1

The attached patch (to uclibc) makes it compile cleanly on my machine
(fedora FC1), by avoiding their stubs in the include-glibc directory.  
Since this is my first patch to uclibc, please let me know if I've made
any errors in style or substance of the patch.

By the way, uclibc downloads a patch called [iproute_20010824-8.diff.gz], 
but doesn't apply it. Debian has "accepted" that patch
[http://lists.debian.org/debian-devel-changes/2002/debian-devel-changes-200204/msg00124.html],
so is there some reason why we're not applying it?

Cheers, Chris.
-- 
_  __ __     _
 / __/ / ,__(_)_  | Chris Wilson -- UNIX Firewall Lead Developer |
/ (_  ,\/ _/ /_ \ | NetServers.co.uk http://www.netservers.co.uk |
\__/_/_/_//_/___/ | 21 Signet Court, Cambridge, UK. 01223 576516 |
-------------- next part --------------
Index: make/iproute2.mk
===================================================================
--- make/iproute2.mk	(revision 4128)
+++ make/iproute2.mk	(working copy)
@@ -10,10 +10,10 @@
 
 #Use the debian source for now, as the .ru site has availability problems
 IPROUTE2_SOURCE_URL=http://ftp.debian.org/debian/pool/main/i/iproute/
-IPROUTE2_SOURCE=iproute_20010824.orig.tar.gz
-IPROUTE2_PATCH:=iproute_20010824-8.diff.gz
+IPROUTE2_SOURCE := iproute_20010824.orig.tar.gz
+IPROUTE2_PATCH  := iproute_20010824-8.diff.gz
+IPROUTE2_PATCH2 := $(SOURCE_DIR)/iproute2.no-include-glibc.patch
 
-
 $(DL_DIR)/$(IPROUTE2_SOURCE):
 	 $(WGET) -P $(DL_DIR) $(IPROUTE2_SOURCE_URL)$(IPROUTE2_SOURCE)
 
@@ -26,6 +26,7 @@
 	rm -rf $(IPROUTE2_DIR).orig $(IPROUTE2_DIR)
 	zcat $(DL_DIR)/$(IPROUTE2_SOURCE) | tar -C $(BUILD_DIR) -xvf -
 	#zcat $(DL_DIR)/$(IPROUTE2_PATCH) | patch -p1 -d $(IPROUTE2_DIR)
+	patch -p1 -d $(IPROUTE2_DIR) < $(IPROUTE2_PATCH2)
 	touch $(IPROUTE2_DIR)/.unpacked
 
 $(IPROUTE2_DIR)/.configured: $(IPROUTE2_DIR)/.unpacked
Index: sources/iproute2.no-include-glibc.patch
===================================================================
--- sources/iproute2.no-include-glibc.patch	(revision 0)
+++ sources/iproute2.no-include-glibc.patch	(revision 0)
@@ -0,0 +1,17 @@
+diff -ru iproute2/Makefile iproute2.fixed/Makefile
+--- iproute2/Makefile	2001-08-02 07:37:03.000000000 +0100
++++ iproute2.fixed/Makefile	2004-04-23 17:31:04.000000000 +0100
+@@ -20,11 +20,11 @@
+ 
+ ifeq ($(LIBC_INCLUDE)/socketbits.h,$(wildcard $(LIBC_INCLUDE)/socketbits.h))
+   ifeq ($(LIBC_INCLUDE)/net/if_packet.h,$(wildcard $(LIBC_INCLUDE)/net/if_packet.h))
+-    GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
++    GLIBCFIX=-include ../include-glibc/glibc-bugs.h
+   endif
+ endif
+ ifeq ($(LIBC_INCLUDE)/bits/socket.h,$(wildcard $(LIBC_INCLUDE)/bits/socket.h))
+-  GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
++  GLIBCFIX=-include ../include-glibc/glibc-bugs.h
+ endif
+ 
+ CC = gcc


More information about the uClibc mailing list