views:

39

answers:

1

I am trying to cross-compile busybox but I am getting 'undefined reference' at the linking stage. Using nm, the symbol were in fact missing from the library file (libbb.a in my case.) Looking into the source ('busybox/libbb/xfuncs.c'), there are all these #ifdef L_<function_name> wrapping around the functions in question. Does anyone know what these macros are? I grep through the source and cannot find where they are defined.

+1  A: 

These macros are used as sentinels for local versions of a function if the libc does not provide them. In many packages, the autoconf scripts are supposed to detect their presence and set the options in config.h accordingly so that the source files can know which should and shouldn't be defined.

Ignacio Vazquez-Abrams
I see... but some of those functions are things like bb_xstrdup and bb_strlen, which I assume are busybox specific so libc would not have those functions would it?
Ken