1

I'm trying to compile Busybox with Buildroot Cross-Compiler.

Here are the steps:

(The path to the Cross-Compiler is correct)

The compilation returns the following error:

CC      networking/nslookup.o
networking/nslookup.c: In function ‘server_print’:
networking/nslookup.c:123:37: error: ‘struct <anonymous>’ has no member named ‘nsaddrs’
networking/nslookup.c: In function ‘set_default_dns’:
networking/nslookup.c:163:15: error: ‘struct <anonymous>’ has no member named ‘nsaddrs’
make[1]: *** [networking/nslookup.o] Error 1
make: *** [networking] Error 2

If I don't use the Cross-Compiler everything builds fine.

Do you have any advice?

UserK
  • 884
  • 3
  • 17
  • 40
  • 1
    Are these the only errors? Generally, learn to do a recursive search of your codebase (either with the -r flag to grep or in an IDE), figure out where these identifiers are found and what causes them to be missing. You should also do a web search on key parts of the message to see if someone else working with that package has encountered and understood it. Can you get a version of busybox already ported to the pi from somewhere? – Chris Stratton Jul 21 '14 at 17:02
  • I don't know how to use grep -r in this case. Yes, I have a working linux version from a previous work – UserK Jul 21 '14 at 18:04
  • I've used Buildroot,which uses busybox, to populate the file system. What caused the error is still a mystery. – UserK Jul 22 '14 at 17:57
  • 1
    In the random version of nslookup.c I found with a web search, this code only comes into play if `ENABLE_FEATURE_IPV6` is defined. Perhaps that got turned on when the libs/includes you are building against don't support it. Did you want it? Do you need it? Did you autconfigure this project or similar? If so, be aware of the subtle mistake of detecting the configuration of your *build system* and then trying to apply the result to a cross target, which might still be a linux, but a *different* one. – Chris Stratton Jul 22 '14 at 18:11
  • Yes! I checked the IPv6 option during the configuration. It's not compulsory. Ok Thanks I'll try to run the make command – UserK Jul 22 '14 at 19:12
  • Since you have Buildroot, why aren't you using Buildroot to download, configure and compile Busybox? Why are you doing this manually? Is this really an XY problem? – sawdust Jul 23 '14 at 18:07
  • 1
    http://stackoverflow.com/questions/22409516/how-to-compile-busybox/22475170#22475170 – vinay hunachyal Mar 18 '15 at 07:07

1 Answers1

1

Before

make menuconfig

You should first create the default configuration for cross compiling busybox based on the type of board used

make defconfig or
make vexpress_defconfig //if the board you are using is similar to vexpress

Also one important argument is the architecture name, if you are building busybox for ARM then you should pass that as an argument along with make

make ARCH=arm CROSS_COMPILE=

For more details on cross compilation you can also refer
http://wiki.beyondlogic.org/index.php?title=Cross_Compiling_BusyBox_for_ARM

Santosh A
  • 5,173
  • 27
  • 37