LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices



Reply
 
Search this Thread
Old 10-31-2007, 04:21 AM   #1
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,523

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
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 
 
Old 10-31-2007, 05:32 AM   #2
greeklegend
Member
 
Registered: Feb 2006
Location: At a computer
Distribution: Ubuntu 7.04, LFS 6.3 rc1 (living dangerously ;), Windows XP
Posts: 75

Rep: Reputation: 15
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.
 
Old 10-31-2007, 05:55 AM   #3
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,523

Original Poster
Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
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.).
 
Old 10-31-2007, 06:30 AM   #4
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,523

Original Poster
Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
*** 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
 
Old 10-31-2007, 11:51 AM   #5
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,523

Original Poster
Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
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?
 
Old 10-31-2007, 12:32 PM   #6
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,523

Original Poster
Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
net tools satimis Linux - Software 3 08-21-2005 10:29 AM
rpm-build-tools-4.3.1? hotpepsi Linux - Newbie 0 01-03-2005 07:43 AM
net-tools in LFS 6.0? TLV Linux From Scratch 2 10-25-2004 04:55 AM
Net tools azul79 Linux - Networking 0 09-09-2004 11:52 AM
Cannot compile net-tools donbellioni Linux - Software 0 07-22-2004 11:39 AM


All times are GMT -5. The time now is 08:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration