32-bit compilation results

Below is the ending part of the build output for the current Swift compiler, from a Raspberry pi 4 running 32-bit Raspbian.
As you can see it doesn't finish and it gives some messy errors.

https://justpaste.it/1nbsm

Would you share what build command you used too? Looks like the Swift compiler tripped an LLVM assertion because of an alignment issue when trying to build the Swift portions of the stdlib.

Make sure you're using an up-to-date clang to build the Swift compiler, a buggy or old clang could cause this problem. Or look for standard C++ flags that your distro packager uses when building similar projects, that might be missing from this user build. Otherwise, you're stuck trying to track down where the misalignment comes from in a debugger.

You might want to try cross-compiling the stdlib and corelibs from linux x86_64 to linux ARMv7 with an official Swift compiler first, so you don't have to deal with a buggy Swift compiler. But that will require a linux ARMv7 clang cross-compiler and that you patch it in.

It's:
swift/utils/build-script -j4 --preset=buildbot_linux,no_test install_destdir=~/swift-install installable_package=~/swift.tgz

And here's my clang:
$ clang -v clang version 7.0.1-8+rpi3+deb10u2 (tags/RELEASE_701/final) Target: armv6k-unknown-linux-gnueabihf Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.4 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/5 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/6 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/6.5.0 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/7 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/7.3.0 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/8 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.9 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.9.4 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/5 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/5.5.0 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/6 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/6.5.0 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/7 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/7.3.0 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/8 Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/8 Candidate multilib: .;@m32 Selected multilib: .;@m32

When I boot the 64-bit OS I get clang 10, but the 32-bit OS despite being updated only has clang 7.

Clang 7 is not that old, released two years ago, but not a good sign that it reports the default arch in the triple as armv6k, which hasn't been used since RPi 1. You will have to check their Raspbian distro packaging scripts carefully to see what flags they apply and possibly fill in the gaps in what the Swift build-script does. Another good resource is @uraimo's ARM patches that I pointed you at last week.

I think I'll try to build clang 10 myself.
Or I could switch to another distro that runs on the Pi.

An Update:
The link phase when I tried to build Clang on the 32-bit raspberry pi failed with a memory exhaustion error. So apparently it required more RAM than a process was allowed.

Terms of Service

Privacy Policy

Cookie Policy