On Saturday 09 April 2011 06:21, Rich Felker wrote:
> Hi,
> 
> I am the author of musl (www.etalabs.net/musl) and also follow busybox
> development on and off. Recently one of my project's testers has been
> experimenting with building a musl+busybox based mini-distro. I've
> been working with him to resolve the build issues caused by things on
> my end, but there are a few longstanding portability issues in busybox
> that would be easy to fix and would make things a lot easier for us if
> they could be fixed.
> 
> Chris's project, Sabotage Linux, contains a patch against busybox
> 1.18.4 that illustrates the issues he's encountered:
> 
> https://github.com/chneukirchen/sabotage/blob/master/KEEP/busybox.patch
> 
> Many of the chunks are not correct to apply to busybox. For example,
> __musl__ is not defined by musl; it's a hack Chris added to his build
> scripts to work around portability problems by special-casing. Some
> issues, however, can be fixed right away without controversial
> changes, I think, and I hope you'll consider them:
> 
> 1. The fdprintf/dprintf chunk in platform.h. The standard POSIX 2008
> name for this function is dprintf, and as far as I know, dprintf will
> be available on most if not all platforms busybox supports. If there
> are a few where it's not supported, could you instead #define fdprintf
> dprintf by default, and only #undef it for those specific oddball
> platforms?

Fixing in git... done. Please take a look.

 
> 2. The mkconfigs chunk. This problem has been floating around on the
> bug tracker and mailing list for a while. "\?" is not valid in POSIX
> BRE, and musl's regex implementation does not support it as an
> extension. This issue prevents building busybox when grep is linked
> against musl's regex.

Fixed in git.


> 3. The fdisk chunk. This code is conditional on large disk support, so
> lseek is already the 64-bit version of the function. There's no need
> to call lseek64 (which musl does not provide). Also the off64_t should
> be corrected to off_t.

Fixed in git.


> 4. Several #include chunks. Some of these look like hacks, but others
> look like cases where busybox is relying on header pollution (where
> one header wrongly includes another) to get certain definitions,
> rather than including the headers that are needed.

Added this one:

--- busybox-1.18.4.orig/networking/libiproute/ll_types.c 2011-03-13 
02:45:06.000000000 +0100
+++ busybox-1.18.4/networking/libiproute/ll_types.c 2011-04-05 
23:35:13.395240397 +0200
@@ -7,6 +7,7 @@
  *
  * Authors: Alexey Kuznetsov, <[email protected]>
  */
+#include <sys/socket.h>
 #include <arpa/inet.h>
 #include <linux/if_arp.h>



> Finally, one thing that's not in the patch, but should be: Busybox's
> "make config" and "make menuconfig" require a some POSIX interfaces to
> be provided by the standard C headers, so on musl, HOSTCFLAGS
> containing -D_POSIX_C_SOURCE=... or -D_XOPEN_SOURCE=... or
> -D_GNU_SOURCE is needed to avoid compile-time errors that prevent
> configuration. Adding -D_POSIX_C_SOURCE=200112L (or whatever version
> you like) to the default host cflags would be more correct and would
> avoid this issue.

Let's add those defines to the .c files which need them.
Can you let me know which ones need them?

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

Reply via email to