LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Cannot build net-tools-1.60 (https://www.linuxquestions.org/questions/linux-from-scratch-13/cannot-build-net-tools-1-60-a-596016/)

dwhitney67 10-31-2007 03:21 AM

Cannot build net-tools-1.60
 
Hello,

I've built a i586 CLFS system, and when adding the net-tools supplemental package per the BLFS guide, I get an error when attempting to build.

Please note that I am building in a chroot-environment, not on the final target.

Is there a configuration option that should be used when building this package? The instructions only indicate that 3 patches be included before the 'make config' is performed. After that step, a couple of 'sed' statements.

Anyhow, the error I get is:
PHP Code:

make[3]: Leaving directory `/sources/build-blfs/net-tools/net-tools-1.60/lib'
cc -D_GNU_SOURCE -O2 -Wall -g  -I. -idirafter ./include/ -Ilib   -c -o iptunnel.o iptunnel.c
In file included from /usr/include/linux/if_tunnel.h:4,
                 from iptunnel.c:39:
/usr/include/linux/if.h:117: error: redefinition of 'struct ifmap'
/usr/include/linux/if.h:153: error: redefinition of 'struct ifreq'
/usr/include/linux/if.h:203: error: redefinition of 'struct ifconf'
In file included from /usr/include/linux/if_tunnel.h:5,
                 from iptunnel.c:39:
/usr/include/linux/ip.h:81: error: redefinition of 'struct iphdr'
iptunnel.c: In function 'print_tunnel':
iptunnel.c:412: warning: pointer targets in passing argument 3 of 'format_host' differ in signedness
iptunnel.c:413: warning: pointer targets in passing argument 3 of 'format_host' differ in signedness
make[2]: *** [iptunnel.o] Error 1
make[2]: Leaving directory 
`/sources/build-blfs/net-tools/net-tools-1.60'
make[1]: *** [net-tools-1.60.make] Error 2
make[1]: Leaving directory `/sources/build-blfs/net-tools'
make: *** [installError 1
make
Leaving directory `/sources/build-blfs'
make: *** [.blfs] Error 1 


greeklegend 10-31-2007 04:32 AM

I've also had some difficulties compilin net-tools, but not sure if they're the same problems as you (this was quite a while ago :P). The workaround for me was to make sure that in make config, i only built support for stuff that was in my kernel.

dwhitney67 10-31-2007 04:55 AM

I did notice that the net-tool config was somehow determining what kernel features are available. Is it possible that it is picking up the kernel settings of my running i686 system? I would hope (and want) it to pick up the settings within the kernel I have configured for CLFS.

I'm building net-tools after chroot-ing into my CLFS environment, and even though I have tricked the system to report i586 when "uname -m" is used, the Fedora 7 kernel (2.6.22.9-91.fc7) is still reported when using "uname -r".

Do you recall how you were able to adjust the configuration? All I really want is "ifconfig"! I am having trouble getting dhclient to acquire a DHCP IP address from my router, even though everything looks fine on my system (i.e. NIC detected, dhclient listening/sending on correct device, etc.).

dwhitney67 10-31-2007 05:30 AM

*** Update ***

I resolved how to manually configure net-tools. Hopefully what I have setup will suffice for my needs.

Should anyone come across this thread, the solution was to deviate from the BLFS instructions, and use this command to configure:

$ make config

BLFS indicates to use:

$ yes "" | make config

dwhitney67 10-31-2007 10:51 AM

It appears that the changes I made to the configuration made no difference. The compilation of iptunnel.c is still failing as described in the OP.

Can anyone help? Is there a patch out there?

dwhitney67 10-31-2007 11:32 AM

Upon examining the ip_tunnel.c file, I found the following:

Code:

#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
#include <net/if.h>
#include <net/if_arp.h>
#else
#include <linux/if.h>
#include <linux/if_arp.h>
#endif
#include <linux/types.h>
#include <linux/if_tunnel.h>

I am using Glibc-2.4, thus net/if.h and net/if_arp.h are being included. Within net/if.h, the structures for ifmap, ifreq, and ifconf are defined.

These structures are also defined in linux/if.h, which is not included directly, however it is included by linux/if_tunnel.h.

Apparently ip_tunnel.c requires certain definitions within linux/if_tunnel.h. Thus it seems to me that I am left with two choices, neither of which is probably correct:

1. Comment out the #include <linux/if.h> statement from within linux/if_tunnel.h

or

2. Add a preprocessor statement similar to that shown above to block linux/if.h from being included within linux/if_tunnel.h when dealing with versions of Glibc-2.1 or greater.

I will choose option 1 since it appears that linux/if_tunnel.h is not dependent on anything defined in linux/if.h, and thus should not include it.

Seriously though, can somebody advise me as why this issue exists and if there is a better workaround.

Thank you.

P.S. After a quick fix, I found another issue with a redefinition of struct iphdr. I commented out linux/ip.h from being included within linux/if_tunnel.h, however this solution is flawed because there is a dependency for struct iphdr in linux/if_tunnel.h.


All times are GMT -5. The time now is 12:25 PM.