[Toybox] make menuconfig

Rob Landley rob at landley.net
Sun May 3 11:19:56 PDT 2015


On 05/02/2015 11:47 PM, Isaac Dunham wrote:
> On Sat, May 02, 2015 at 10:30:36PM -0500, Rob Landley wrote:
>> On 05/02/2015 02:54 PM, enh wrote:
>>> anyone else having trouble with "make menuconfig"? getprop and setprop
>>> aren't showing up for me, and i don't see where to set
>>> CONFIG_TOYBOX_ON_ANDROID and generated/mkflags segfaults if i have ls
>>> configured and...
>>
>> Sorry, my recent ls checkin screwed it up. I've been digging into the
>> mkflags.c code to figure out _why_ it's doing that, but had family
>> obligations most of today.
>>
>> (I fully expect I screwed up ls's option string, but it should give a
>> diagnostic message, not a segfault.)
> 
> This is...odd.
> On Alpine Linux, ls enabled/ls --color disabled, I only get this:
> (after "git pull; make menuconfig; make" and saving the "new" config):
> toys/posix/ls.c: In function 'zmack':
> toys/posix/ls.c:154:5: warning: implicit declaration of function 'fgetxattr' [-Wimplicit-function-declaration]
>      len = fgetxattr(fd, XATTR_NAME_SMACK, pad?buf:0, pad?SMACK_LABEL_LEN:0);
>           ^

I have a local prototype for fgetxattr() in the else case of
platform.h's smack bit because attr/attr.h (sys/attr.h?) might not be
there in all build environments.

(I was avoiding this can of worms for a reason: I need multiple
different build and test environments to check the android and smack
security stuff.)

> ...toys/posix/ls.c: At top level:
> cc1: warning: unrecognized command line option "-Wno-string-plus-int"
> 
> ./toybox ls does segfault, however, as does any invocation of toybox:
> $ strace ./toybox
> execve("./toybox", ["./toybox"], [/* 20 vars */]) = 0
> mprotect(0xb77ec000, 4096, PROT_READ)   = 0
> --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0xb5a42c} ---
> +++ killed by SIGSEGV +++

I'm getting a build break, so I didn't get to runtime. But yeah, still
sounds like the option parsing code. (Something like "true" wouldn't use
it.)

> 
> Incidentally, I will note this from open(2):
>     O_PATH (since Linux 2.6.39)
> 	 Obtain a file descriptor that can be used for two  purposes:  to
> 	 indicate a location in the filesystem tree and to perform opera-
> 	 tions that act purely at the file descriptor  level.   The  file
> 	 itself  is not opened, and other file operations (e.g., read(2),
>          write(2), fchmod(2), fchown(2), fgetxattr(2), mmap(2)) fail with
>          the error EBADF.
> 
> Curiously, fstat() has *recently* (Linux 3.6) been added to the list of
> allowed syscalls accepting such an FD.
> 
> (Yes, the xattr stuff seems to be utterly nuts.)

"Recently" in this case being 3 years ago, but yes.

(I don't know why it would _not_ work before that, though. Sounds like a
kernel bug.)

That said, smack support requiring a reasonably recent kernel sounds
feasible.
https://wiki.tizen.org/wiki/Standard_of_Tizen_Reference_Kernel_Version
says they use the most recent "LTS/LTSi" kernel, and
https://wiki.tizen.org/wiki/Linux#LTSI_KERNEL_3.14.y is talking about
3.14 (so only 6 releases behind vanilla).

What I'm trying to make sure is when you switch it off in the config, it
should break other builds.

> Thanks,
> Isaac Dunham

Rob

 1430677196.0


More information about the Toybox mailing list