• Home
  • Raw
  • Download

Lines Matching +full:linux +full:- +full:musl +full:- +full:llvm

2 <!--#include file="header.html" -->
25 <!-- get binaries -->
31 <li><h2><a href="#system">What part of Linux/Android does toybox provide?</h2></li>
32 <li><h2><a href="#mkroot">How do I build a working Linux system with toybox?</a></h2></li>
45 and <a href=http://landley.net/notes-2006.html#28-09-2006>started over from
47 <a href=http://lists.busybox.net/pipermail/busybox/2006-September/058617.html>protracted licensing …
50 <a href=http://landley.net/notes-2011.html#13-11-2011>relaunched</a>
52 <a href=http://landley.net/aboriginal/about.html#selfhost>self-hosting</a>.
56 after a lot of thinking <a href=http://landley.net/talks/ohio-2013.txt>about
57 licenses</a> and <a href=http://landley.net/notes-2011.html#21-03-2011>the
61 <a href=http://landley.net/talks/celf-2013.txt>strategy</a>
62 to make Android self-hosting using toybox. This helped
75 <a href=http://meta.ath0.com/2012/02/05/apples-great-gpl-purge/>less subtle</a> response was to fre…
77 development of new projects (clang/llvm/lld) to replace them,
79 <a href=https://www.osnews.com/story/24572/apple-ditches-samba-in-favour-of-homegrown-replacement/>…
80 <a href=https://archive.org/details/copyleftconf2020-allison>replace samba</a>,
81 …a href=https://www.theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-
96 <p>A: Our <a href=http://lists.busybox.net/pipermail/busybox/2006-September/058440.html>longstandin…
101 <p>My original theory was "4 to 5 of the 18-month cycles of moore's law should cover
104 and <a href=http://catb.org/esr/writings/world-domination/world-domination-201.html#id248066>update…
106 law below the high end systems, and that another 2-3 iterations should cover
110 <p>That analysis missed <a href=http://landley.net/notes-2011.html#26-06-2011>industry
113 <a href=https://landley.net/notes-2010.html#09-10-2010>the switch</a> from PC to smartphone cutting…
114 laptop market. Meanwhile the Moore's Law <a href=https://en.wikipedia.org/wiki/Logistic_function>s-
122 <a href=https://www.cnet.com/news/end-of-moores-law-its-not-just-about-physics/>common knowledge</a…
123 <a href=http://www.acm.org/articles/people-of-acm/2016/david-patterson>widely
127 feature is less than 7 years old, I try to have a build-time configure test
133 <p>A: Toybox targets quarterly releases (a similar schedule to the Linux
143 Releases focus end-user testing on specific versions
150 control knobs... Toybox's switch from "ls -q" to "ls -b" as the default output
151 format was not-a-bug-it's-a "design improvement", but the
156 <p>The counter-argument is that "continuous integration"
158 …123071427/http://www.shirky.com/weblog/2013/11/healthcare-gov-and-the-gulf-between-planning-and-re…
159 emphasis on end-user feedback and learning from real world experience.
177 and starting the engine to leave doesn't provoke a last-minute rush of nearby
178 not-quite-ready passengers racing to catch it causing further delay and
194 <p><u>The configure stage</u> is copied from the Linux kernel (in the "kconfig"
201 down, enter to descend into a sub-menu, space to select an entry, ? to see
203 same as the command's "<b>--help</b>" output.</p>
209 argument is the command to run (ala "toybox ls -l").</p>
271 example binaries</a> against the output of "toybox --version".
272 Between releases the --version
273 information is in "git describe --tags" format with "tag-count-hash" showing the
295 "git describe --tags $HASH" in the vanilla tree should give you the --version
300 <p>A: Ideally on the <a href=http://lists.landley.net/listinfo.cgi/toybox-landley.net>mailing list<…
304 AOSP has its <a href=https://source.android.com/setup/contribute/report-bugs>own bug reporting mech…
324 and Linux Weekly News has covered toybox's history a
331 by hobbyist (volunteer) developers, originally for Linux but these days
341 <a href=http://androidbackstage.blogspot.com/2016/07/episode-53-adb-on-adb.html>this podcast</a>, s…
357 but develops on a standard 64-bit Linux+glibc distro while building embedded
358 32-bit big-endian nommu musl systems requiring proper data alignment for work,
363 …https://android.googlesource.com/platform/prebuilts/build-tools/+/refs/heads/master/path/linux-x86…
456 used to call them, so if you "mv toybox ls; ./ls -l" it acts like ls. Creating
462 <a href=http://git.musl-libc.org/cgit/musl/tree/include/paths.h>the
466 <blockquote><p><b>for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done</b></p></blockquote>
471 <blockquote><p><b>for i in $(./toybox); do ln -s toybox $i; done</b></p></blockquote></p>
481 command to run, so "./toybox ls -l" also behaves like ls. The "toybox"
482 name is special in that it can have a suffix (toybox-i686 or toybox-1.2.3)
488 level of symlink. So if your script needs "gsed" you can "ln -s sed gsed",
494 linux command shells search the directories listed in the $PATH envionment
501 For historical reasons PATH is colon-separated, and treats an
506 <p>Toybox's shell (toysh) checks for built-in commands before looking at the
509 you give a path to a command the shell won't run the built-in version
511 won't: "toybox /bin/ls" runs the built-in ls, you can't point it at an
526 about 10 times as large as the all-in-one multiplexer version (in disk space,
558 $ mkdir prereq; mv toybox-prereq prereq/
559 $ for i in $(prereq/toybox-prereq); do ln -s toybox-prereq prereq/$i; done
570 <b>scripts/recreate-prereq.sh</b> which records the commands used by
596 same as the Linux kernel build uses. This is used to prefix all the tools
597 (target-cc, target-ld, target-strip) during the build, meaning the prefix
598 usually ends with a "-" that's easy to forget but kind of important
599 ("target-cc" and "targetcc" are not the same name).</p>
606 <b><p>make LDFLAGS=--static CROSS_COMPILE=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin/m68k-linu…
612 export "PATH=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin:$PATH"<br />
613 LDFLAGS=--static CROSS_COMPILE=m68k-linux-musl- make distclean defconfig toybox
617 the single file to target, or test them with "qemu-m68k toybox". Feel free
619 add-on to copy the compiler's shared libraries into the new root
624 "CROSS_COMPILE=prefix- CC=prefix-cc" gives "prefix-prefix-cc".</p>
630 an appropriate "path/prefix-".</p>
639 a processor-specific if/else staircase.).</p>
641 <P>Several commands (such as ps/top) are unavoidably full of Linux assumptions.
647 <p>Each release gets tested against two compilers (llvm, gcc), three C
648 libraries (bionic, musl, glibc), and a half-dozen different processor
654 <p>Most Linux distros come with that as a host compiler, which is used by
659 <p>You can use LDFLAGS=--static if you want static binaries, but static
660 glibc is hugely inefficient ("hello world" is 810k on x86-64) and throws a
664 <a href=https://elinux.org/images/2/2d/ELC2010-gc-sections_Denys_Vlasenko.pdf>obvious bugs</a>), pl…
665 …f=https://stackoverflow.com/questions/15165306/compile-a-static-binary-which-code-there-a-function
669 <a href=https://stackoverflow.com/questions/14289488/use-dlsym-on-a-static-binary>improper support<…
671 <a href=https://www.youtube.com/watch?v=Ih-3vK2qLls>in brief, avoid</a>).
678 <p><a href="#cross2">2) gcc+musl = musl-cross-make</a></p>
681 <a href=http://musl.libc.org/>musl-libc</a> maintainer's
682 <a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>
683 …a href=https://github.com/landley/toybox/blob/master/scripts/mcm-buildall.sh>scripts/mcm-buildall.…
690 git clone https://github.com/richfelker/musl-cross-make
691 cd musl-cross-make
692 ../toybox/scripts/mcm-buildall.sh # this takes a while
693 ln -s $(realpath ccc) ../toybox/ccc
704 in the same format the Linux kernel build uses. You can either provide a
709 <b><p>make LDFLAGS=--static CROSS_COMPILE=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin/m68k-linu…
715 export "PATH=~/musl-cross-make/ccc/m68k-linux-musl-cross/bin:$PATH"<br />
716 LDFLAGS=--static make distclean defconfig toybox CROSS=m68k-linux-musl-
719 <p>Note: these examples use static linking because a dynamic musl binary
720 won't run on your host unless you install musl's libc.so into the system
722 to most glibc linux distribution) or play with $LD_LIBRARY_PATH.
729 <p><a href="#cross3">3) llvm+bionic = Android NDK</a></p>
732 Native Development Kit</a> provides an llvm toolchain with the bionic
738 unzip android-ndk-r21b-linux-x86_64.zip
739 cd android-ndk-21b/toolchains/llvm/prebuilt/linux-x86_64/bin
740 ln -s x86_64-linux-android29-clang x86_64-linux-android-cc
744 make LDFLAGS=--static CROSS_COMPILE=x86_64-linux-android- defconfig toybox
754 Linux system, even "hello world"
767 make the Linux kernel honor DEVTMPFS_MOUNT in initramfs. Teaching toybox
769 presumably in <a href=https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.t…
771 <hr /><h2><a name="system" />Q: What part of Linux/Android does toybox provide?</h2>
774 Toybox is one of three packages (linux, libc, command line) which together provide a bootable unix-
781 …=https://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html>Li…
782 <a href=https://man7.org/linux/man-pages/dir_section_1.html>Linux Manual
786 … shell prompt requires a kernel to drive the hardware (such as Linux, or BSD with a Linux emulatio…
793 but toybox either provides its own built-in versions of such functionality
798 <p>Static linking (with the --static option) copies library contents
806 <a href=https://www.man7.org/linux/man-pages/man1/ldd.1.html>ldd</a>,
807 <a href=https://www.man7.org/linux/man-pages/man8/ld.so.8.html>ld.so</a>,
808 and <a href=https://www.man7.org/linux/man-pages/man7/libc.7.html>libc</a>
817 and video players. A linux distro like Debian adds hundreds of packages.
820 <p>But all of these systems conceptually sit on a common three-package
825 <hr /><h2><a name="mkroot" />Q: How do you build a working Linux system with toybox?</h2>
827 <p>A: Toybox has a built-in <a href=https://github.com/landley/toybox/blob/master/mkroot/mkroot.sh>…
836 <p>You can cross compile simple three package (toybox+libc+linux) systems
840 and also pointing the build at a Linux kernel source directory, ala:</p>
842 <blockquote><p><b>make root CROSS=sh4 LINUX=~/linux</b></p></blockquote>
844 <p>Then you can <b>root/sh4/run-qemu.sh</b> to launch the emulator,
845 which boots the new Linux system (kernel and root filesystem) on a simulated
848 You'll need the appropriate qemu-system-* emulator binary for the selected
854 compiler has a libc built into it, 3) you tell it where to find a Linux kernel
855 source directory with LINUX= on the command line. If you don't say LINUX=,
865 built from the musl-libc maintainer's
866 <a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>
868 …ithub.com/landley/toybox/blob/master/scripts/mcm-buildall.sh>scripts/mcm-buildall.sh</a> in a musl…
875 git clone https://github.com/richfelker/musl-cross-make
876 cd musl-cross-make
877 ../toybox/scripts/mcm-buildall.sh # this takes a while
878 ln -s $(realpath ccc) ../toybox/ccc
901 <p><b>mkroot/mkroot.sh CROSS=all LINUX=~/linux dropbear</b></p>
909 scripts, I <a href=https://speakerdeck.com/landley/developing-for-non-x86-targets-using-qemu?slide=…
936 setsid -c &lt;&gt;/dev/$CONSOLE >&0 2>&1 $HANDOFF<br />
937 reboot -f &amp;<br />
950 of sysfs, because the linux kernel's /dev/console device can't act as a
961 the kernel command line via "<b>KARGS='HANDOFF=cal' ./run-qemu.sh</b>"
962 since the <b>run-qemu.sh</b> script appends $KARGS to the end of the kernel
963 command line when launching QEMU, and unrecognized linux kernel command line
968 credentials") and the -c option makes stdin the controling TTY for the new
974 so -c grabs the new TTY device as the child's controlling tty.</p>
979 to PID 1, but that won't do anything useful here, so we give it the -f option to
981 some reason the Linux reboot() syscall exits the process instead of blocking,
986 <p>Toybox also has a <b>oneit</b> command that can do all this, and has a -3
993 <!--#include file="footer.html" -->