On Wed, Jan 8, 2014 at 12:34 AM, Matthias Andree <[email protected]> wrote:
> Am 07.01.2014 14:09, schrieb Denys Vlasenko:
>> On Tue, Jan 7, 2014 at 1:43 AM, Matthias Andree <[email protected]> wrote:
>>> FreeBSD/HEAD fails to build busybox 1.22.0, because busybox's
>>> strchrnul() declaration is in conflict with FreeBSD's; sources at
>>> <http://svnweb.freebsd.org/base/head/include/string.h?annotate=246803#l75>.
>>>
>>> There is, unfortunately, no exact version tag that you can test against,
>>> but on FreeBSD, you might use:
>>>
>>> // sys/param.h is system-specific
>>> #include <sys/param.h>
>>> #if __FreeBSD_version < 1000029
>>> // declare strchrnul
>>> #endif
>>>
>>> Please fix busybox to not declare strchrnul if the system provides it.
>>
>> Does attached patch work for you?
>>
>
> It's not complete.  I am attaching my complete series of patches from
> the FreeBSD port.  Please consider them for inclusion.

archival/unzip.c, coreutils/cp.c, coreutils/dirname.c, coreutils/install.c,
coreutils/rmdir.c patches all ad just one line:

+#include <libgen.h>

This looks bogus: libgen.h is already included by libbb.h.

Why do you need these patches? Does build really
not work without them?


> I also run these in-place-editing sed commands routinely before the
> build to replace obsolescent headers by modern equivalents:
>
> /usr/bin/sed -i.bak -e 's/<malloc.h>/<stdlib.h>/'  \
>         busybox-1.22.0/libbb/appletlib.c  busybox-1.22.0/shell/hush.c
>
> /usr/bin/sed -i.bak -e 's/<alloca.h>/<stdlib.h>/'  \
>         busybox-1.22.0/scripts/basic/*.c
>
> Please consider modifying the sources accordingly.

stdlib.h is included by libbb.h too.
As comment in hush.h says, it needs malloc.h to be able to call
malloc_trim(), not merely malloc().

> widening types sufficiently for the baudrate
> tables - FreeBSD defines all baudrate constants to the actual baudrate,
> so they do not fit into a short, starting with 38400 and stepping upwards.

A struct with "short" and "int" fields has padding, effectively
making it take as much space as two ints.

I'm adding #if defined __FreeBSD__ there so that others don't suffer,
care to code a better fix?

Please try current git.

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to