aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-10-26 02:00:59 +0900
committerOphestra <cat@gensokyo.uk>2026-10-26 02:00:59 +0900
commit581e530c692e842cd9d8bd854c880c9575623e80 (patch)
tree48b120904c45aafa8bd79aaa20c809d48e2f899d
parent040b2fbca60af6ac742a20e3ad3492d5815c47e6 (diff)
internal/rosa/package/toybox: cross-compile via wrapper
This works around the rather janky Makefile not properly supporting additional CC flags for cross-compilation. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/rosa/package/toybox.az12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/rosa/package/toybox.az b/internal/rosa/package/toybox.az
index 720c736a..c2b8fb53 100644
--- a/internal/rosa/package/toybox.az
+++ b/internal/rosa/package/toybox.az
@@ -34,7 +34,7 @@ chmod +w /bin/
ln -rs "$(which bash)" /bin/ || true
chmod +w kconfig tests
-rm \
+rm -f \
tests/du.test \
tests/sed.test \
tests/tar.test \
@@ -91,8 +91,16 @@ LDFLAGS="${LDFLAGS:-''} -static"
chmod +w /bin/
ln -rs "$(which bash)" /bin/ || true
+if [ -n "${CC+x}" ]; then
+ echo '#!/bin/sh' > '/system/bin/`+linuxArch+`-cc'
+ echo "exec $CC "'"$@"' >> '/system/bin/`+linuxArch+`-cc'
+ chmod +x '/system/bin/`+linuxArch+`-cc'
+ unset CC
+ export CROSS_COMPILE=`+linuxArch+`-
+fi
+
chmod +w kconfig tests
-rm \
+rm -f \
tests/du.test \
tests/sed.test \
tests/tar.test \