[Toybox] [PATCH] Fix macOS build.

Rob Landley rob at landley.net
Thu Apr 2 19:38:46 PDT 2020


On 4/2/20 12:50 PM, enh via Toybox wrote:
> I'd put the rtc_wkalarm struct in the globals to get it zeroed for
> free, but since there's no such type on macOS, that breaks the
> build. Rather than define a bogus struct in portability.h, I've
> gone for making it an explicitly-zeroed local. (And I've sorted the
> locals largest-first.)

You didn't turn the TT.alarm references into alarm in the function, so the
result doesn't compile. I'll fix it up here...

> Note that the use of struct rtc_time as if it was the same as struct
> tm in this code follows the existing code in hwclock, but I worry
> that we're going to have trouble with that because of the extra
> tm_gmtoff and tm_zone fields in struct tm. But that's a worry for
> another day...

gcc at least produces really inefficient zeroing for = {} of structs. (Maybe
it's been fixed in the past couple years? I turned it into a memset anyway.)

> This patch also removes the CONFIG_CP_PRESERVE from the macos_miniconfig,
> since that option was removed a while back.

Ok.

Speaking of which, I'm trying to cut a release in the next day or so, and long
ago you said you would put bionic and macos binaries on an android web page
somewhere? (I can build NDK binaries, but that's not quite the same build
environment as AOSP, and I haven't got a mac build environment...)

I should dig up a freebsd build while I"m at it, that defconfig hasn't seen much
attention lately either...

Rob



More information about the Toybox mailing list