Commit Diff


commit - 146b0cdc58cadf7ec01bb6db345d09d2abea732c
commit + 1e8e3702a6682dabd121a3d7d42db5ba44e7e1f9
blob - 4a6a93e685eb1ba10d0fdff9eebee3cfaceb14d4
blob + d354e63370a9d4bc2b261d9e1870b54f53b97d21
--- Makefile
+++ Makefile
@@ -35,6 +35,9 @@ config:
 od: examples/$T.elf
 	${CROSS}-objdump -d examples/$T.elf | less
 
+od-bb:
+	${CROSS}-objdump -d rootfs/bb/bin/busybox | less
+
 run: linurv ${PROGS}
 	mkdir -p rootfs/bin
 	cp -f linurv rootfs/bin/
blob - 06222139400a20c775cb8b590b9d526089016477
blob + 04763f60fba01cbabbfa8e86c862cfb657a8d83e
--- TODO
+++ TODO
@@ -5,3 +5,9 @@
   - linux_siginfo_t
   - linux_sigset_t
   - linux_sigaction
+
+- update:
+  - gcc 14.1.0
+  - musl 1.2.5
+  - linux 6.6.41
+
blob - ff746bfcf2f81ebf883fbf55efe07fa428d9922b
blob + 1d9e169bb9c3a2ee2a6f79a55f58b427cc8f4727
--- tools/Makefile
+++ tools/Makefile
@@ -21,13 +21,16 @@ DESTRUCT_VER = 0.3
 RVFORTH_VER = 0.1
 MCU_VER = 1.2
 GFORTH_VER = 0.7.9_20240627
+BUSYBOX_VER = 1.36.1
 
+BBFLAGS = HOSTCC="${CC}" HOSTCXX="${CXX}" CROSS_COMPILE="${PREFIX}/bin/${TARGET}-" CONFIG_PREFIX="${TOP}/rootfs/bb"
+
 GMAKE = $U/gmake
 SUDO =
 
 all: build
 
-extra: rvforth oksh mcu # gforth (broken)
+extra: rvforth oksh mcu busybox # gforth (broken)
 
 build: ${STAMPS}/libgcc-install ${STAMPS}/destruct-install
 
@@ -40,8 +43,8 @@ clean:
 test:
 	${PREFIX}/bin/${TARGET}-gcc -o /dev/null $U/test.c
 
-download: src/binutils.tgz src/gcc.tgz src/musl.tgz src/linux.tgz src/gmp.tgz src/mpfr.tgz src/mpc.tgz src/oksh.tgz src/destruct.tgz src/rvforth.tgz src/mcu.tgz src/gforth.txz
-extract: ${STAMPS}/binutils-extract ${STAMPS}/gcc-extract ${STAMPS}/musl-extract ${STAMPS}/linux-extract ${STAMPS}/gmp ${STAMPS}/mpfr ${STAMPS}/mpc ${STAMPS}/oksh ${STAMPS}/destruct ${STAMPS}/rvforth ${STAMPS}/mcu ${STAMPS}/gforth
+download: src/binutils.tgz src/gcc.tgz src/musl.tgz src/linux.tgz src/gmp.tgz src/mpfr.tgz src/mpc.tgz src/oksh.tgz src/destruct.tgz src/rvforth.tgz src/mcu.tgz src/gforth.txz src/busybox.tar.bz2
+extract: ${STAMPS}/binutils-extract ${STAMPS}/gcc-extract ${STAMPS}/musl-extract ${STAMPS}/linux-extract ${STAMPS}/gmp ${STAMPS}/mpfr ${STAMPS}/mpc ${STAMPS}/oksh ${STAMPS}/destruct ${STAMPS}/rvforth ${STAMPS}/mcu ${STAMPS}/gforth ${STAMPS}/busybox
 
 headers: ${STAMPS}/linux-headers
 install-headers: ${STAMPS}/linux-hdrinst
@@ -97,6 +100,10 @@ src/mcu.tgz:
 src/gforth.txz:
 	mkdir -p src
 	$U/download $@ https://www.complang.tuwien.ac.at/forth/gforth/Snapshots/${GFORTH_VER}/gforth-${GFORTH_VER}.tar.xz
+
+src/busybox.tar.bz2:
+	mkdir -p src
+	$U/download $@ https://busybox.net/downloads/busybox-${BUSYBOX_VER}.tar.bz2
 
 # EXTRACT
 
@@ -179,6 +186,12 @@ ${STAMPS}/gforth: src/gforth.txz
 	mv build/gforth-* build/gforth
 	touch $@
 
+${STAMPS}/busybox: src/busybox.tar.bz2
+	mkdir -p ${STAMPS}
+	tar -C build -xjf src/busybox.tar.bz2
+	mv build/busybox-* build/busybox
+	touch $@
+
 # KERNEL HEADERS
 
 ${STAMPS}/linux-headers: ${STAMPS}/linux-extract
@@ -286,7 +299,8 @@ ${STAMPS}/libgcc-install: ${STAMPS}/libgcc-build
 
 # OKSH
 
-${STAMPS}/oksh-configure: ${STAMPS}/oksh ${STAMPS}/gcc-install
+${STAMPS}/oksh-configure: ${STAMPS}/oksh ${STAMPS}/libgcc-install
+	i
 	cd ${TOOLS}/build/oksh &&			\
 	CFLAGS="-Og -g" ./configure			\
 		--prefix=/				\
@@ -326,7 +340,7 @@ destruct: ${STAMPS}/destruct-install
 
 # RVFORTH
 
-${STAMPS}/rvforth-build: ${STAMPS}/rvforth
+${STAMPS}/rvforth-build: ${STAMPS}/rvforth ${STAMPS}/libgcc-install
 	(cd ${TOOLS}/build/rvforth && ${MAKE} CC="${PREFIX}/bin/${TARGET}-gcc")
 	touch $@
 
@@ -420,3 +434,28 @@ clean-gforth:
 	rm -rf build/gforth
 
 gforth: ${TOP}/rootfs/bin/gforth
+
+# BUSYBOX
+
+${STAMPS}/busybox-config: ${STAMPS}/busybox ${STAMPS}/libgcc-install
+	(cd ${TOOLS}/build/busybox								\
+		&& ${GMAKE} ${BBFLAGS} defconfig						\
+		&& mv .config .config.old							\
+		&& sed	-e 's/^# CONFIG_DEBUG is not set/CONFIG_DEBUG=y/'			\
+			-e 's/^# CONFIG_DEBUG_PESSIMIZE is not set/CONFIG_DEBUG_PESSIMIZE=y/'	\
+			-e 's/^CONFIG_NO_DEBUG_LIB=y/# CONFIG_NO_DEBUG_LIB is not set/'		\
+			< .config.old > .config)
+	touch $@
+
+${STAMPS}/busybox-build: ${STAMPS}/busybox-config
+	 (cd ${TOOLS}/build/busybox && ${GMAKE} ${BBFLAGS})
+	 touch $@
+
+${TOP}/rootfs/bb/bin/busybox: ${STAMPS}/busybox-build
+	(cd ${TOOLS}/build/busybox && ${GMAKE} ${BBFLAGS} install)
+
+busybox: ${TOP}/rootfs/bb/bin/busybox
+	
+clean-busybox:
+	rm -f ${STAMPS}/busybox*
+	rm -rf build/busybox