Lines Matching +full:linux +full:- +full:musl +full:- +full:llvm
2 <!--#include file="header.html" -->
25 <!-- get binaries -->
29 <li><h2><a href="#system">What part of Linux/Android does toybox provide?</h2></li>
30 <li><h2><a href="#mkroot">How do I build a working Linux system with toybox?</a></h2></li>
43 and <a href=http://landley.net/notes-2006.html#28-09-2006>started over from
45 <a href=http://lists.busybox.net/pipermail/busybox/2006-September/058617.html>protracted licensing …
48 <a href=http://landley.net/notes-2011.html#13-11-2011>relaunched</a>
50 <a href=http://landley.net/aboriginal/about.html#selfhost>self-hosting</a>.
54 after a lot of thinking <a href=http://landley.net/talks/ohio-2013.txt>about
55 licenses</a> and <a href=http://landley.net/notes-2011.html#21-03-2011>the
59 <a href=http://landley.net/talks/celf-2013.txt>strategy</a>
60 to make Android self-hosting using toybox. This helped
73 <a href=http://meta.ath0.com/2012/02/05/apples-great-gpl-purge/>less subtle</a> response was to fre…
75 development of new projects (clang/llvm/lld) to replace them,
77 <a href=https://www.osnews.com/story/24572/apple-ditches-samba-in-favour-of-homegrown-replacement/>…
78 <a href=https://archive.org/details/copyleftconf2020-allison>replace samba</a>,
79 …a href=https://www.theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-…
94 <p>A: Our <a href=http://lists.busybox.net/pipermail/busybox/2006-September/058440.html>longstandin…
99 <p>My original theory was "4 to 5 of the 18-month cycles of moore's law should cover
102 and <a href=http://catb.org/esr/writings/world-domination/world-domination-201.html#id248066>update…
104 law below the high end systems, and that another 2-3 iterations should cover
108 <p>That analysis missed <a href=http://landley.net/notes-2011.html#26-06-2011>industry
111 <a href=https://landley.net/notes-2010.html#09-10-2010>the switch</a> from PC to smartphone cutting…
112 laptop market. Meanwhile the Moore's Law <a href=https://en.wikipedia.org/wiki/Logistic_function>s-…
120 <a href=https://www.cnet.com/news/end-of-moores-law-its-not-just-about-physics/>common knowledge</a…
121 <a href=http://www.acm.org/articles/people-of-acm/2016/david-patterson>widely
125 feature is less than 7 years old, I try to have a build-time configure test
131 <p>A: Toybox targets quarterly releases (a similar schedule to the Linux
141 Releases focus end-user testing on specific versions
148 control knobs... Toybox's switch from "ls -q" to "ls -b" as the default output
149 format was not-a-bug-it's-a "design improvement", but the
154 <p>The counter-argument is that "continuous integration"
156 …123071427/http://www.shirky.com/weblog/2013/11/healthcare-gov-and-the-gulf-between-planning-and-re…
157 emphasis on end-user feedback and learning from real world experience.
175 and starting the engine to leave doesn't provoke a last-minute rush of nearby
176 not-quite-ready passengers racing to catch it causing further delay and
192 <p><u>The configure stage</u> is copied from the Linux kernel (in the "kconfig"
199 down, enter to descend into a sub-menu, space to select an entry, ? to see
201 same as the command's "<b>--help</b>" output.</p>
207 argument is the command to run (ala "toybox ls -l").</p>
269 example binaries</a> against the output of "toybox --version".
270 Between releases the --version
271 information is in "git describe --tags" format with "tag-count-hash" showing the
293 "git describe --tags $HASH" in the vanilla tree should give you the --version
298 <p>A: Ideally on the <a href=http://lists.landley.net/listinfo.cgi/toybox-landley.net>mailing list<…
302 AOSP has its <a href=https://source.android.com/setup/contribute/report-bugs>own bug reporting mech…
322 and Linux Weekly News has covered toybox's history a
329 by hobbyist (volunteer) developers, originally for Linux but these days
339 <a href=http://androidbackstage.blogspot.com/2016/07/episode-53-adb-on-adb.html>this podcast</a>, s…
355 but develops on a standard 64-bit Linux+glibc distro while building embedded
356 32-bit big-endian nommu musl systems requiring proper data alignment for work,
361 …https://android.googlesource.com/platform/prebuilts/build-tools/+/refs/heads/master/path/linux-x86…
454 used to call them, so if you "mv toybox ls; ./ls -l" it acts like ls. Creating
460 <a href=http://git.musl-libc.org/cgit/musl/tree/include/paths.h>the
464 <blockquote><p><b>for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done</b></p></blockquote>
469 <blockquote><p><b>for i in $(./toybox); do ln -s toybox $i; done</b></p></blockquote></p>
479 command to run, so "./toybox ls -l" also behaves like ls. The "toybox"
480 name is special in that it can have a suffix (toybox-i686 or toybox-1.2.3)
486 level of symlink. So if your script needs "gsed" you can "ln -s sed gsed",
492 linux command shells search the directories listed in the $PATH envionment
499 For historical reasons PATH is colon-separated, and treats an
504 <p>Toybox's shell (toysh) checks for built-in commands before looking at the
507 you give a path to a command the shell won't run the built-in version
509 won't: "toybox /bin/ls" runs the built-in ls, you can't point it at an
536 same as the Linux kernel build uses. This is used to prefix all the tools
537 (target-cc, target-ld, target-strip) during the build, meaning the prefix
538 usually ends with a "-" that's easy to forget but kind of important
539 ("target-cc" and "targetcc" are not the same name).</p>
546 <b><p>make LDFLAGS=--static CROSS_COMPILE=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin/m68k-linu…
552 export "PATH=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin:$PATH"<br />
553 LDFLAGS=--static CROSS_COMPILE=m68k-linux-musl- make distclean defconfig toybox
557 the single file to target, or test them with "qemu-m68k toybox". Feel free
559 add-on to copy the compiler's shared libraries into the new root
564 "CROSS_COMPILE=prefix- CC=prefix-cc" gives "prefix-prefix-cc".</p>
570 an appropriate "path/prefix-".</p>
579 a processor-specific if/else staircase.).</p>
581 <P>Several commands (such as ps/top) are unavoidably full of Linux assumptions.
587 <p>Each release gets tested against two compilers (llvm, gcc), three C
588 libraries (bionic, musl, glibc), and a half-dozen different processor
594 <p>Most Linux distros come with that as a host compiler, which is used by
599 <p>You can use LDFLAGS=--static if you want static binaries, but static
600 glibc is hugely inefficient ("hello world" is 810k on x86-64) and throws a
604 <a href=https://elinux.org/images/2/2d/ELC2010-gc-sections_Denys_Vlasenko.pdf>obvious bugs</a>), pl…
605 …f=https://stackoverflow.com/questions/15165306/compile-a-static-binary-which-code-there-a-function…
609 <a href=https://stackoverflow.com/questions/14289488/use-dlsym-on-a-static-binary>improper support<…
611 <a href=https://www.youtube.com/watch?v=Ih-3vK2qLls>in brief, avoid</a>).
618 <p><a href="#cross2">2) gcc+musl = musl-cross-make</a></p>
621 <a href=http://musl.libc.org/>musl-libc</a> maintainer's
622 <a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>
623 …a href=https://github.com/landley/toybox/blob/master/scripts/mcm-buildall.sh>scripts/mcm-buildall.…
630 git clone https://github.com/richfelker/musl-cross-make
631 cd musl-cross-make
632 ../toybox/scripts/mcm-buildall.sh # this takes a while
633 ln -s $(realpath ccc) ../toybox/ccc
644 in the same format the Linux kernel build uses. You can either provide a
649 <b><p>make LDFLAGS=--static CROSS_COMPILE=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin/m68k-linu…
655 export "PATH=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin:$PATH"<br />
656 LDFLAGS=--static make distclean defconfig toybox CROSS=m68k-linux-musl-
659 <p>Note: these examples use static linking because a dynamic musl binary
660 won't run on your host unless you install musl's libc.so into the system
662 to most glibc linux distribution) or play with $LD_LIBRARY_PATH.
669 <p><a href="#cross3">3) llvm+bionic = Android NDK</a></p>
672 Native Development Kit</a> provides an llvm toolchain with the bionic
678 unzip android-ndk-r21b-linux-x86_64.zip
679 cd android-ndk-21b/toolchains/llvm/prebuilt/linux-x86_64/bin
680 ln -s x86_64-linux-android29-clang x86_64-linux-android-cc
684 make LDFLAGS=--static CROSS_COMPILE=x86_64-linux-android- defconfig toybox
694 Linux system, even "hello world"
707 make the Linux kernel honor DEVTMPFS_MOUNT in initramfs. Teaching toybox
709 presumably in <a href=https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.t…
711 <hr /><h2><a name="system" />Q: What part of Linux/Android does toybox provide?</h2>
714 Toybox is one of three packages (linux, libc, command line) which together provide a bootable unix-…
721 …=https://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html>Li…
722 <a href=https://man7.org/linux/man-pages/dir_section_1.html>Linux Manual
726 … shell prompt requires a kernel to drive the hardware (such as Linux, or BSD with a Linux emulatio…
733 but toybox either provides its own built-in versions of such functionality
738 <p>Static linking (with the --static option) copies library contents
746 <a href=https://www.man7.org/linux/man-pages/man1/ldd.1.html>ldd</a>,
747 <a href=https://www.man7.org/linux/man-pages/man8/ld.so.8.html>ld.so</a>,
748 and <a href=https://www.man7.org/linux/man-pages/man7/libc.7.html>libc</a>
757 and video players. A linux distro like Debian adds hundreds of packages.
760 <p>But all of these systems conceptually sit on a common three-package
765 <hr /><h2><a name="mkroot" />Q: How do you build a working Linux system with toybox?</h2>
767 <p>A: Toybox has a built-in <a href=https://github.com/landley/toybox/blob/master/mkroot/mkroot.sh>…
776 <p>You can cross compile simple three package (toybox+libc+linux) systems
780 and also pointing the build at a Linux kernel source directory, ala:</p>
782 <blockquote><p><b>make root CROSS=sh4 LINUX=~/linux</b></p></blockquote>
784 <p>Then you can <b>root/sh4/run-qemu.sh</b> to launch the emulator,
785 which boots the new Linux system (kernel and root filesystem) on a simulated
788 You'll need the appropriate qemu-system-* emulator binary for the selected
794 compiler has a libc built into it, 3) you tell it where to find a Linux kernel
795 source directory with LINUX= on the command line. If you don't say LINUX=,
805 built from the musl-libc maintainer's
806 <a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>
808 …ithub.com/landley/toybox/blob/master/scripts/mcm-buildall.sh>scripts/mcm-buildall.sh</a> in a musl…
815 git clone https://github.com/richfelker/musl-cross-make
816 cd musl-cross-make
817 ../toybox/scripts/mcm-buildall.sh # this takes a while
818 ln -s $(realpath ccc) ../toybox/ccc
841 <p><b>mkroot/mkroot.sh CROSS=all LINUX=~/linux dropbear</b></p>
849 scripts, I <a href=https://speakerdeck.com/landley/developing-for-non-x86-targets-using-qemu?slide=…
876 setsid -c <>/dev/$CONSOLE >&0 2>&1 $HANDOFF<br />
877 reboot -f &<br />
890 of sysfs, because the linux kernel's /dev/console device can't act as a
901 the kernel command line via "<b>KARGS='HANDOFF=cal' ./run-qemu.sh</b>"
902 since the <b>run-qemu.sh</b> script appends $KARGS to the end of the kernel
903 command line when launching QEMU, and unrecognized linux kernel command line
908 credentials") and the -c option makes stdin the controling TTY for the new
914 so -c grabs the new TTY device as the child's controlling tty.</p>
919 to PID 1, but that won't do anything useful here, so we give it the -f option to
921 some reason the Linux reboot() syscall exits the process instead of blocking,
926 <p>Toybox also has a <b>oneit</b> command that can do all this, and has a -3
933 <!--#include file="footer.html" -->