659 Commits
Author SHA1 Message Date
Rob Landley 08c7a4b240 Make new kconfig -d write usable defconfig. 2025-04-14 19:56:20 -05:00
Rob Landley d025058800 More kconfig replacement work, doesn't get defconfig right yet. 2025-04-14 09:08:43 -05:00
Rob Landley 185722d30a Start of new kconfig plumbing, for now just replacing old config2help. 2025-04-09 10:04:36 -05:00
Rob Landley b4fd71d18f Slightly better error reporting. 2025-02-25 21:33:20 -06:00
Rob Landley 0abe8e19f0 Add a status.html category. 2025-02-17 21:02:11 -06:00
Rob Landley 006dfd8d7c Mention $TOOLCHAIN in install_airlock help text, and accept CSV too. 2025-01-12 16:16:30 -06:00
Rob Landley 58500b8029 Adjust various tests to pass on TEST_HOST debian bookworm. 2025-01-06 09:47:13 -06:00
Rob Landley a51c66edb7 Switch type to long long one entry earlier so (1<<31) isn't negative
and printf("%llx\n", _PS_RGROUP|_PS_RUSER) isn't ffffffff80000000
2024-11-17 01:01:53 -06:00
Rob Landley 658189ac53 Allow TOOLCHAIN= to list additional host commands for airlock_install. 2024-11-01 17:25:12 -05:00
Rob Landley 9115abfe45 Fix ASAN with new debian toolchain.
Even building standalone hello world complains "ASan runtime does
not come first in initial library list" and says to use LD_PRELOAD
without saying WHAT to set it to. This avoids that. (It breaks llvm,
but https://github.com/llvm/llvm-project/pull/98194 fixes it.)
2024-07-10 19:49:54 -05:00
Rob Landley dca6d212e7 Building static dropbear wants "ar". 2024-06-19 11:32:55 -05:00
Rob Landley d52e93c947 Create generated/tags.h with sed and bash instead of C. 2024-04-30 15:18:24 -05:00
Rob Landley 3101559d35 Only --start-group and --end-group when static linking.
Mac doesn't use llvm's lld linker, it uses its own producing mach-o
binaries, which barfs on --start-group.
2024-04-29 15:18:45 -05:00
Rob Landley 1b6d64ffc3 The "extra" libraries want to go in a magic order when static linking,
and probing them in parallel makes that awkward, so if there are any
pass --start-group and --end-group to the linker so it actually
resolves crosstalk between them.
2024-04-27 13:47:35 -05:00
Rob Landley 7c6aecd477 Two changes to record-commands: 1) busybox find doesn't understand commas
in -type so use parentheses and -o, 2) change semantics (sourcing changes
variables) so running with no arguments sets up a persistent wrapper
and outputs an export line to update variables.
2024-04-20 09:58:06 -05:00
Rob Landley 9f7d285af6 Copy numeric config symbols into config.h. 2024-04-05 11:51:20 -05:00
Rob Landley 3bbc31c78b Alas, nproc isn't portable (sched_getaffinity() syscall) and
scripts/portability.sh already has two fallbacks (sysctl -n hw.nproc for
mac/bsd and if that doesn't work either it sets CPUS=1).

With this, I built on mac outside of homebrew, albeit cheating to get .config:
$ homebrew
$ make macos_defconfig
$ make clean
$ exit
$ scripts/prereq/build.sh #ignoring SO many warnings
$ mkdir prereq; mv toybox-prereq prereq/
$ for i in $(prereq/toybox-prereq); do ln -s toybox-prereq prereq/$i; done
$ PATH=$PWD/prereq:$PATH scripts/make.sh
$ ./toybox
2024-04-05 07:06:05 -05:00
Rob Landley d21f10ecf7 Add suffix to toybox-prereq build. 2024-04-05 05:35:57 -05:00
Rob Landley d1acc6e88b Add a canned minimal toybox build that does "cc *.c" against saved headers
to provide the toybox commands used by the full scripts/make.sh,
with minimal dependencies and using whatever #!/bin/sh you've got.

Run scripts/prereq/build.sh to make a first stage toybox.

Run scripts/recreate-prereq.sh to enumerate the commands a "defconfig" build
uses out of the $PATH and populate the scripts/prereq directory
with a minimal build.sh and stripped down headers.

Does not yet include the shell: you still need #!/bin/bash for that.

Does not yet include make. You can call scripts/make.sh directly
(and scripts/test.sh and scripts/single.sh) if you've got a .config,
but until kconfig/ is replaced defconfig/menuconfig still need make.

Yes, I am shipping generated files. Seemed an appropriate date for it.
2024-04-01 07:46:47 -05:00
Rob Landley 28316b3621 List (installed) debian packages each toybox command lives in. 2024-04-01 05:15:39 -05:00
Rob Landley bb91cee6fa Use current musl-cross-make and build more toolchains. 2024-03-28 03:27:48 -05:00
Rob Landley 567f8daac6 Build plumbing: redo compflags(), pull out $VERSION calculation,
allow $VERSION override without the -DTOYBOX_VERSION=\"blah\" wrapper,
remove magic sed line ranges for dependency checking (tag lines with #d
instead), split out FILES= in generated build.sh and wordwrap it to
be more legible, make PATH= a comment for dependency checking instead of
a variable override on the target system.
2024-03-18 07:02:14 -05:00
Rob Landley f888f11f25 Emit make test_help and make test_install targets, only skip command targets.
(Because "make help" and "make install" have existing meanings, and
thus can't build those standalone commands.)
2024-03-18 05:00:33 -05:00
Rob Landley 919273caec Simplify and parallelize library probe. 2024-03-15 17:36:15 -05:00
Rob Landley 7768b83385 Add riscv64 and sh4eb compiler targets. 2024-03-03 17:04:44 -06:00
Rob Landley c39a6eefc8 Upstream musl-cross-make finally updated to musl-1.2.4. 2024-03-03 17:04:04 -06:00
Rob Landley 1e3708a912 Change file list collection for build.
Oliver Webb noticed that selecting allnoconfig then enabling just sh
(instead of "make sh" singleconfig) build breaks because test.c isn't
build but it tries to pull in test_main().

So search for files to compile using unintented USE() macros wrapping NEW()
2024-02-21 17:51:37 -06:00
Rob Landley 9f4df994dd Oliver Webb noticed that MAYFORK OLDTOY() aliases don't become builtins. 2024-02-12 02:19:13 -06:00
Rob Landley 73645dac0b Whitespace: remove unnecessary/inconsistent newline 2024-02-11 02:27:21 -06:00
Rob Landley 8a2d19bf12 Rewrite globals.h generation to only call sed twice.
This version runs every time (much faster), and only includes enabled
structures so the union's size is the enabled high water mark rather than
pending: scripts/probes/GLOBALS now says that ps is the largest one,
setting the sizeof(this) to 336 bytes.
2024-02-09 06:21:42 -06:00
Rob Landley 792c5a2882 Fix TEST_HOST for wc, adding "utf8locale" function. 2024-02-05 07:42:01 -06:00
Rob Landley 316a2676cc Switch to newer sed syntax to make generated/config.h, as long as we're
using $SED instead of sed anyway (and thus gsed instead of ancient sed
on MacOS). Also, yank check and just always rebuild it.
2024-01-27 17:10:03 -06:00
Rob Landley e64f361e40 Compress help text with gzip. 2024-01-10 15:12:34 -06:00
Rob Landley a17fee7788 Silence more false positive gcc warnings.
ASAN finds leaks. The gcc array overlap detector isn't even close to sane,
and we have to switch it off TWICE for some reason.
2023-12-29 16:46:41 -06:00
Rob Landley 9a83d36f5f Change findglobals output. 2023-12-27 06:05:34 -06:00
Rob Landley 8092111b9d Add second stage toolchain to command line dependencies.
Because we statically link the binaries against musl-libc, we need a musl-libc
toolchain for the host. (Static linking is broken on modern glibc.)

The -host toolchain we build first has various shortcuts to remove
incestuous dependencies, and the result is mostly good for building the
full toolchain. (Because gcc is rickety and overcomplicated. Yes there's
a pattern here: "If it starts with g, scream and flee...")

Thus non-host toolchains need the full host toolchain to (reliably) build,
and if you did a fresh clone and built a specific toolchain ala
"~/toybox/scripts/mcm-buildall.sh or1k::" it needs both host toolchains,
so add it as a dependency when you specify toolchains to build on the command
line. (In theory, if the toolchain exists it shouldn't rebuild it. You have
to rm -rf the corresponding dir/sqf out of ccc to force a rebuild.)
2023-12-14 16:10:23 -06:00
Rob Landley ab046139f9 Add or1k toolchain. 2023-12-14 03:18:48 -06:00
Rob Landley b5be73ab5e Fix gz/xz mismatch. 2023-11-18 14:47:45 -06:00
Rob Landley 3690494282 Update mcm-buildall.sh wrapper to autodetect host type and automatically
select package versions. This means it now builds arm hosted toolchains on
arm, builds x86-64 (not i686) on x86-64, and you should just be able to
clone and copy a "sources" directory in and build without net access.

Also backported a bugfix patch for the x86-64 host build.
2023-11-17 13:07:10 -06:00
Rob Landley b166aa7e62 Add probes README and move bloatcheck into probes, adjusting makefile. 2023-11-13 13:17:06 -06:00
Rob Landley ef46c27869 Add scripts/probes directory with script to measure GLOBALS() size,
and move findglobals and showasm into it.
2023-11-13 10:40:36 -06:00
Rob Landley 574b26b960 Simplify bloatcheck a little. 2023-10-11 03:09:01 -05:00
Rob Landley a70025e613 Make two more vars local. 2023-07-25 19:02:21 -05:00
Rob Landley 03e1cc1e45 Don't use relative paths for expected/actual so cd/symlinks can't confuse diff 2023-07-25 18:56:53 -05:00
Rob Landley c807258d65 Add comments and collate some assignments. 2023-07-11 00:56:22 -05:00
Rob Landley 216e4d1398 Implement set -u in toysh. 2023-05-09 22:47:40 -05:00
Rob Landley ca91a90ac0 Fix a missing space.
Two command names got glued together so neither was found. Didn't hurt
the patched kernel building most architectures, but vanilla didn't build.
2023-05-09 08:50:02 -05:00
Rob Landley 5083274a8a Add redirector from old mkroot location. 2023-04-17 18:39:33 -05:00
Rob Landley 126c719dd2 Move mkroot into its own directory. 2023-04-16 20:18:02 -05:00
Rob Landley a228c0698e Fix redundant name appending when testcmd's first argument is blank. 2023-04-06 06:06:26 -05:00