[PATCH] some Mac OS X fixes

Devin Bayer devin at freeshell.org
Sat Feb 18 03:53:31 UTC 2006


On Feb 17, 2006, at 17:15, Rob Landley wrote:

> On Friday 17 February 2006 2:45 am, Devin Bayer wrote:
>> I wanted to do a little busybox hacking on my laptop recently and
>> found it didn't even compile on OS X.  This patch fixes those bugs
>> blocking my development, but it doesn't go far enough to make busybox
>> useful on OS X.  It touches lots of different files, but most of the
>> changes are too minor for individual patches.  A summary of the  
>> fixes:
>>
>> * Don't try to make empty archives
>
> What exactly is wrong with that?

$ ar cru ifeelemptyinside.a
ar: no archive members specified (exit status 1)

>> * wait is the name of a function - don't use variables with that name
>
> Which header is that prototyped in?  Can we avoid #including it?

sys/wait.h is included by stdlib.h, so no luck.

>> * bb_strlen called strlen which was a macro to bb_strlen.  How did  
>> this
>>    ever work for anybody?
>
> Up until yesterday there was an #undef there.  Vodz just removed  
> it.  I don't
> know why.

OK, understood.  But I removed the kludge altogether because it  
didn't seem necessary.  I'm guessing  it's to save space.  But  
doesn't -fno-inline-strlen work just as well?

> That said, I don't think losetup is ever going to work on MacOS X.   
> And lots
> of our applets get data out of /proc, which macos X doesn't have.   
> At best
> you're only ever going to build a subset.

That's why I said "mostly" short-term.  losetup is useless, but most  
of the applets getting data out of /proc could be re-written to not  
be proc-centric.  Then the libbb function could either get the data  
out of proc or if on OS X, get it the OS X way.

>> * SUSv3 doesn't require -lcrypt - nor does OS X even have it
>
> Does it have the functionality?

SUSv3 defines encrypt, setkey, and crypt.  Mac OS X has those and  
des_ varients.  I don't have any idea about their behavior.  My  
concern was with failing to link against the non-existant libcrypt  
and also including the obsolete header crypt.h.

>> * OS X uses different macros for endian-detection
>
> We have a #platform.h to hide those kind of differences...

OK, it doesn't mention anything about endianness, so you could  
probably just move my patch from hash_fd.c to platform.h.  What  
should the standard busybox way be of detecting endianness?  I  
suggest BB_BIG_ENDIAN = 0|1 and use that for all the tests.

> Much as I'm interested in getting busybox to work on MacOS X, it's  
> going to
> take me a little while to work through a patch this big doing this  
> many
> different things...

Well, if there's anyway I can help...  I need SHA1 and MD5 functions  
exported.  You said before you were working on that.  Would I be  
stepping on your toes if I went ahead and submitted a patch to do  
just that?

-- 
Devin Bayer



More information about the busybox mailing list