1.22.0 builds still broken due to strchrnul mis-declaration on FreeBSD

Matthias Andree mandree at FreeBSD.org
Tue Jan 7 23:34:45 UTC 2014


Am 07.01.2014 14:09, schrieb Denys Vlasenko:
> On Tue, Jan 7, 2014 at 1:43 AM, Matthias Andree <mandree at freebsd.org> 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.

EXCEPT the patch for include_libbb.h - I think that would require #ifdef
__FreeBSD__ or similar.

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.


The platform patch splits FreeBSD out from the other BSDs because it has
quite a few features that were listed as missing, and recent versions
are reasonably POSIX2008 compliant, too. strchrnul is the only #if
__FreeBSD_version we need to check currently.

The other patches fix missing prototype issues, usually a missing
#include <libgen.h>, or 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.

HTH
Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-archival__unzip.c
Type: text/x-csrc
Size: 275 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-coreutils__cp.c
Type: text/x-csrc
Size: 331 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-coreutils__dirname.c
Type: text/x-csrc
Size: 311 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment-0002.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-coreutils__install.c
Type: text/x-csrc
Size: 365 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment-0003.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-coreutils__rmdir.c
Type: text/x-csrc
Size: 243 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment-0004.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-include__libbb.h
Type: text/x-chdr
Size: 514 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-include__platform.h
Type: text/x-chdr
Size: 1337 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-libbb__speed_table.c
Type: text/x-csrc
Size: 265 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140108/c4f3bce9/attachment-0005.c>


More information about the busybox mailing list