[Toybox] toybox and NDK sitrep

Rob Landley rob at landley.net
Sat Dec 2 23:16:10 PST 2017


On 04/28/2017 05:31 PM, enh wrote:
> since rob asked on some other thread earlier this week...
> 
> NDK r15beta2 should hopefully ship in time for I/O in a couple of weeks,
> so i had a quick go at building toybox out of the box with the latest
> bits...

By the way, I've been meaning to ask:

$ /opt/android/x86_64/bin/clang --static -s hello.c && ls -l a.out
-rwxrwxr-x 1 landley landley 485880 Dec  2 22:10 a.out

$ ~/mcm/bin/x86_64-linux-musl-cc hello.c -s --static && ls -l a.out
-rwxrwxr-x 1 landley landley 17584 Dec  2 22:16 a.out

$ cat hello.c
#include <stdio.h>

int main(int argc, char *argv[])
{
  printf("hello world %d\n", 5);

  return 0;
}

Did that ever become... less bad? Yes, I'm forcing printf to do
something so gcc can't "optimize" it to puts, so it's a fair test. But
this seems to mostly be a "strip didn't" issue? A "grep -ai bionic" on
the stripped bionic binary (manually re-stripped to make sure) produced
stuff like:

0123456789ABCDEF0123456789abcdefconversion specifier
unsupportedbionic/libc/bionic/libc_logging.cppFORTIFY_SOURCE: %s.
Calling abort().open(O_CREAT): called without specifying a
modeopenat(O_CREAT): called without specifying a modeNo [stack] line
found in /proc/self/maps!pthread_create sched_setscheduler call failed:
%spthread_create failed: couldn't allocate threadpthread_create failed:
couldn't allocate %zd-byte stack: %spthread_create failed: couldn't
mprotect PROT_NONE %zd-byte stack guard region: %spthread_create failed:
clone failed: %sMath argument out of domain of funcToo many symbolic
links encounteredValue too large for defined data typeCan not access a
needed shared libraryAccessing a corrupted shared library.lib section in
a.out corruptedAttempting to link in too many shared librariesCannot
exec a shared library directlyInterrupted system call should be
restartedSocket operation on non-socketProtocol wrong type for
socketOperation not supported on transport endpointAddress family not
supported by protocolCannot assign requested addressNetwork dropped
connection because of resetSoftware caused connection abortTransport
endpoint is already connectedTransport endpoint is not connectedCannot
send after transport endpoint shutdownToo many references: cannot
splice%s(3) is not implemented on Android
strchr: prevented read past end of
bufferbionic/libc/upstream-netbsd/lib/libc/string/strcoll.cvoid
endusershell()void setusershell()char* getusershell()void
endpwent()/dev/socket/property_service

(Although I'm pretty sure the strchr warning near the end there is
ubuntu 14.04's grep being buggy. Did I mention I break everything?)

Rob



More information about the Toybox mailing list