[mkroot] x32 mcm-buildall.sh final patch

Rob Landley rob at landley.net
Sat Mar 3 11:22:38 PST 2018


On 02/27/2018 02:02 PM, Alain Toussaint wrote:
> Hi,
> 
> Here's the final patch. Tested, work as intended for mcm-buildall.sh and build both variants of
> x86_64 ABI (64bits and x32).
> 
> Minor issue with cross.sh is that it doesn't distinguishes between both ABI:
> 
> testbuild at johnson:~/git/mkroot$ ./cross.sh 
> aarch64 armv5l armv7l armv7m armv7r i486 i686 microblaze mips mips64 mipsel powerpc powerpc64
> powerpc64le s390x sh2eb sh4 x86_64

Yeah, a while back I started fiddling with manually setting CROSS_SHORT. Needed
a bit of passthrough to do it at all:

--- a/mkroot.sh
+++ b/mkroot.sh
@@ -18,7 +18,7 @@ fi
 # Clear environment variables by restarting script w/bare minimum passed throug
 [ -z "$NOCLEAR" ] &&
   exec env -i NOCLEAR=1 HOME="$HOME" PATH="$PATH" \
-    CROSS_COMPILE="$CROSS_COMPILE" "$0" "$@"
+    CROSS_COMPILE="$CROSS_COMPILE" CROSS_SHORT="$CROSS_SHORT" "$0" "$@"

 # Parse arguments: assign NAME=VALUE to env vars and collect rest in $MODULES
 [ "$1" == "-n" ] && N=1 && shift
@@ -50,7 +50,7 @@ else
   echo "Cross compiling"
   CROSS_PATH="$(dirname "$(which "${CROSS_COMPILE}cc")")"
   CROSS_BASE="$(basename "$CROSS_COMPILE")"
-  CROSS_SHORT="${CROSS_BASE/-*/}"
+  [ -z "$CROSS_SHORT" ] && CROSS_SHORT="${CROSS_BASE/-*/}"
   if [ -z "$CROSS_PATH" ]
   then
     echo "no ${CROSS_COMPILE}cc in path" >&2

Mostly prompted by aarrcchh6644 being a really stupid name and I'm not humoring
it. But now I'm thinking maybe I should have some sort of CROSS=short/long-name-
syntax instead?

The larger question here is "toolchain the kernel builds with and toolchain
userspace builds with are different". Which is a recurring problem, and will
probably require some design work. And the OTHER problem is that x86_64-*-native
now resolves to two toolchains. (Which was already kind of a problem for
architectures that want both a nommu version and a with-mmu version for
otherwise the same processor. Sometimes you have "armv7r" distinguishing that,
and sometimes you don't ala microblaze.)

Rob


More information about the mkroot mailing list