[Toybox] macOS sitrep

enh enh at google.com
Fri Nov 30 14:46:48 PST 2018


so, if you merge this afternoon's patches, you can build toybox for
macOS. with two provisos:

1. i'm only talking about a very limited .config, that's basically
"the easy parts of the subset needed by the AOSP build". specifically:

CONFIG_TOYBOX_ICONV=y
CONFIG_TOYBOX_UTMPX=y
CONFIG_TOYBOX_FORK=y
CONFIG_BASENAME=y
CONFIG_CAT=y
CONFIG_CHMOD=y
CONFIG_CMP=y
CONFIG_COMM=y
CONFIG_CUT=y
CONFIG_DIRNAME=y
CONFIG_DU=y
CONFIG_ECHO=y
CONFIG_FALSE=y
CONFIG_FILE=y
CONFIG_GREP=y
CONFIG_EGREP=y
CONFIG_FGREP=y
CONFIG_HEAD=y
CONFIG_ID=y
CONFIG_WHOAMI=y
CONFIG_LN=y
CONFIG_MKDIR=y
CONFIG_OD=y
CONFIG_PASTE=y
CONFIG_PATCH=y
CONFIG_PWD=y
CONFIG_RM=y
CONFIG_RMDIR=y
CONFIG_SED=y
CONFIG_SLEEP=y
CONFIG_SLEEP_FLOAT=y
CONFIG_SORT=y
CONFIG_SORT_BIG=y
CONFIG_SORT_FLOAT=y
CONFIG_TAIL_SEEK=y
CONFIG_TEE=y
CONFIG_TRUE=y
CONFIG_UNAME=y
CONFIG_UNIQ=y
CONFIG_WC=y
CONFIG_XARGS=y
CONFIG_DOS2UNIX=y
CONFIG_UNIX2DOS=y
CONFIG_HELP=y
CONFIG_HELP_EXTRAS=y
CONFIG_READLINK=y
CONFIG_REALPATH=y
CONFIG_SETSID=y
CONFIG_TIMEOUT=y
CONFIG_XXD=y
CONFIG_HOSTNAME=y
CONFIG_MD5SUM=y
CONFIG_SHA1SUM=y
CONFIG_MKTEMP=y
CONFIG_TOYBOX=y
CONFIG_TOYBOX_SUID=y
CONFIG_TOYBOX_LSM_NONE=y
CONFIG_TOYBOX_FLOAT=y
CONFIG_TOYBOX_HELP=y
CONFIG_TOYBOX_HELP_DASHDASH=y
CONFIG_TOYBOX_I18N=y

i'm not sure what we want to do about that long-term. add `depends on
TOYBOX_LINUX` to all the stuff like dmesg that's never going to work?
(and probably to the "too much work for anyone to care" stuff like ps
too.)

2. lib/getmountlist.c doesn't compile. i have #ifndef __APPLE__ ...
#endif around the whole file locally. macos seems to have a wholly
different API, getmntinfo(3). if/when i get around to porting toybox
stat(1) to macOS i might have to fix this properly, but for now i'm
punting. (df isn't used by AOSP and mount/umount seem to be in the
"probably not worth it" territory mentioned in #1.)

things like struct stat and struct statfs turn out to be quite
different on macOS. but that's a problem for another day.


More information about the Toybox mailing list