scripts/bootstrap.sh Doesn't work correctly
Hello, I've run into a a few problems while trying to build a cross-compilation toolchain for aarch64 (host x86_64). Some of this I think comes down to a lack of documentation, and possibly a misunderstanding on my part.
- How do you run the script?
Reading the script (and the internet) you would expect that this would work..
./scripts/bootstrap.sh aarch64
However, this will generate you an invalid sysroot-unknown
because the code is anticipating the hostspec.
CBUILDROOT="$(CTARGET=$TARGET_ARCH . /usr/share/abuild/functions.sh ; echo $CBUILDROOT)"
- Inconsistent usage of TARGET_ARCH as hostspec AND arch
When you do run this to fix the sysroot:
./scripts/bootstrap.sh aarch64-alpine-linux-musl
You run into trouble starting here:
EXTRADEPENDS_BUILD="gcc-pass2-$TARGET_ARCH" \
CHOST=$TARGET_ARCH BOOTSTRAP=nolibc APKBUILD=$(apkbuildname musl) abuild -K -k -r
EXTRADEPENDS_BUILD expands to gcc-pass2-, When ARCH was expected (fixed by using $CARCH1
instead).
It would be great if the abuild functions were a bit more clear about these variables declarations
CTARGET=$TARGET_ARCH
vs CHOST=$TARGET_ARCH
Lastly, the scripts/bootstrap.sh I think should setup the missing dependencies for the first pass of musl. In my testing, I've had to install theses on the host prior to running script/bootstrap (autoconf may not be required)
apk add build-base make gcc g++ autoconf
After making tweaks, I'm still running my bootstrapping build so I may respond with additional issues.