Current-Users archive

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

Re: dhcpcd breaks build w/o IPv6



On 01/08/2012 20:28, Scott Ellis wrote:
> Building -current on amd64 with build.sh and MKINET6=no yields:
> 
> [snip]
> ipv6.o: In function `make_prefix':
> ipv6.c:(.text+0x2ca): undefined reference to `in6addr_any'
> ipv6.c:(.text+0x2d5): undefined reference to `in6addr_any'
> ipv6.o: In function `desc_route':
> ipv6.c:(.text+0x41f): undefined reference to `in6addr_any'
> ipv6.o: In function `ipv6_build_routes':
> ipv6.c:(.text+0x636): undefined reference to `in6addr_any'
> ipv6.c:(.text+0x63d): undefined reference to `in6addr_any'
> ipv6.o:ipv6.c:(.text+0x972): more undefined references to `in6addr_any'
> follow
> collect2: ld returned 1 exit status
> [snip]
> 
> I don't see anything even attempting an #ifdef.
> 
> Can somebody please take a look?

The easiest fix for the time being would be to add the libc ipv6
variables into the dhcpcd sources.
The attached patch should do this correctly and solve the compile problem.

Would you be able to test it - and also test dhcpcd itself?
It should spit an error about IPv6 not working and then continue as normal.

Let me know and I'll commit it.

Thanks

Roy

Index: Makefile
===================================================================
RCS file: /cvsroot/src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- Makefile    12 Jul 2012 16:54:14 -0000      1.12
+++ Makefile    3 Aug 2012 11:22:58 -0000
@@ -11,10 +11,17 @@ SRCS+=              bpf.c if-bsd.c platform-bsd.c
 .include <bsd.own.mk>
 
 DIST=          ${NETBSDSRCDIR}/external/bsd/dhcpcd/dist
-.PATH: ${DIST}
-
 CPPFLAGS+=     -I${DIST}
 
+# Workaround libc not exporting in6addr_any when MKINET6=no
+.if defined(MKINET6) && empty(MKINET6:M[yY][eE][sS])
+LIBC_NET=      ${NETBSDSRCDIR}/lib/libc/net
+SRCS+=         vars6.c
+CPPFLAGS+=     -I${NETBSDSRCDIR}/lib/libc/include
+.endif
+
+.PATH: ${DIST} ${LIBC_NET}
+
 SCRIPTS=                       dhcpcd-run-hooks
 SCRIPTSDIR_dhcpcd-run-hooks=   /libexec
 


Home | Main Index | Thread Index | Old Index