-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Regression] Build fails on Linux Armv7 #61965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@buttaface Do you have any patches to deal with the |
I was able to get past the
|
No, this seems specific to glibc/armv7, I have not seen it with bionic/armv7, which built fine last week (I have not run that 5.7.1 armv7 build yet, but 5.7 mostly worked fine). I did make other modifications for 32-bit ARM with the 5.7 update, such as turning bootstrapping off because the resulting compiler segfaults. I also had to modify trunk last month, one of which @eeckstein later remedied in #61868. |
@buttaface From what I understood looking at your Termux build script, you are cross compiling from x86_64 to Armv7, and relying on the official Ubuntu releases, that's also how you are able to disable bootstrapping, because you already have an existing compiler. |
Yes, but there's no need for that official host x86_64 Swift compiler to cross-compile the Swift compiler itself for armv7 once you disable bootstrapping. I do use the official host x86_64 Swift compiler to then cross-compile the stdlib and the rest of the toolchain, but if you're building natively on armv7, you can just use the natively-built compiler with bootstrapping similarly turned off. In other words, turning bootstrapping off should work no matter what. |
Ok, I will try both approaches. Thanks for the info. I also wanted to know are all the patches in that swift package folder being applied? Or only some? Which ones besides https://github.com/termux/termux-packages/blob/master/packages/swift/swift-include-swift-AST-Expr.h.patch ? |
Yes, all of them, though most are specific to Android and so will not be relevant to linux armv7. |
After applying patches and building with
I get the following error:
|
Huh, that's strange: you built the Swift compiler natively but it couldn't build the stdlib, even though it works when cross-compiling the stdlib? Could you check and see if bootstrapping is really turned off, either by running |
|
/home/coleman/Developer/swift-source/build/buildbot_linux/swift-linux-armv7/CMakeCache.txt
|
OK, so it is turned off. One other difference is that I almost always build in release mode with assertions turned off, but you appear to have assertions enabled above. Maybe that's the reason you're seeing this crash? |
@buttaface I will try that, but if that doesn't work I am just gonna have to try to cross compile everything, which is gonna involve more custom scripting to setup. This build is basically a modified |
Building with
|
The only flag I might change is to patch the place where libdispatch is configured with the stdlib directly and remove the |
Building with
|
When cross compiling, LLVM is failing to build:
|
So, I managed to cross compile |
Try the native build without |
Unable to cross compile
|
Yeah, cross-compiling parts of the toolchain using SPM hasn't been configured in trunk yet, other than for macOS and Android. Does the Swift compiler you cross-compiled for linux armv7 run now? |
Huh, that's funny, is there something substantially different about the clang toolchain you're using to natively compile the Swift compiler versus the one you're using to cross-compile it? What did you change from before, when you cross-compiled swift-frontend and it didn't work? If you want to cross-compile sourcekit-lsp, you'll want to generate an SPM JSON file, like I did for Android. You could also try supplying the cross-compiled toolchain up through SPM to the native build, then only build the SPM-configured portions of the toolchain natively. |
|
If you want to cross-compile, you'll need to modify those build-script-helpers too, swiftlang/sourcekit-lsp#424. Note that many other toolchain repos, like swift-docc, do not support anything other than macOS cross-compilation, so native may be your best bet if you want a lot of those. |
@buttaface I was able to cross compile everything, but sourcekit-lsp is crashing with VS Code (remote).
|
Sourcekit-lsp has to be built with indexstore-db, and either that or SPM relied on |
It is, that is not the issue. |
Huh, could be a genuine alignment issue on 32-bit armv7 then, |
The cross compiled https://github.com/PureSwift/Bluetooth/actions/runs/3458951709/jobs/5777868385
|
OK, that's pretty much the same error I was seeing when building the 5.6 release stdlib natively for linux armv7 earlier in the year, futurejones/ci-swiftlang#12. I'll check and see if I can reproduce on Android armv7. |
Would enabling the new Swift Driver (written in Swift) help this issue? |
It seems this specific code has been mostly migrated to Swift on trunk ed54253 |
How would you build the new Swift Driver in the first place, since it requires a working Swift toolchain, cross-compile it too? I suppose that's worth a shot if you think the problem is in the legacy C++ Driver in the Swift compiler. |
I'm cross compiling everything, but it seems the passes are still in C++ on 5.7.1 release. |
I cross-compile swift-driver for Android now, so there is some support for it in the build scripts, which you'd just have to tweak similarly to what you did to sourcekit-lsp above to get that cross-compiling too. I'm skeptical that any C++ issue in the C++ driver would stay isolated there though, you'd probably just see other C++ portions of the Swift compiler then fail. |
I will try to build natively for i386 to see if the 32-bit issues are reproducible there. |
Can't build with sanitizer. @buttaface Have you tried that on Android? |
Yes, the sanitizer tests are run as part of the compiler validation suite on Android AArch64. There was some issue several months ago where a handful of them started failing with this error, but I didn't look into it. |
@colemancda, still failing with Swift 6.0? Please close if not. |
Gonna have to test again, will try to get to this next week. I've been cross compiling from 5.8-6.0.3 so I haven't encountered this recently. |
+1, it would be good to know* if this is still failing. I'm working on the ability to just cross compile from an x86_64 or aarch64 host, but it would be good if the stuff can also build on an armhf host directly. |
LOL I tried to run this on my Pi 2B+ and after a day and a half of it struggling to compile LLVM it finally gave up. @colemancda any luck on your end? My Pi only has 1GB of RAM so it couldn't do it... :'( |
Describe the bug
I am trying to compile Swift with the
buildbot_linux,no_test
preset and the build fails.Steps To Reproduce
Steps to reproduce the behavior:
./swift/utils/build-script --preset=buildbot_linux,no_test
...
Expected behavior
The build process should not fail. This previously worked with Swift 5.1.5.
Environment (please fill out the following information)
Additional context
swift-linux-armv7.log
Running on CTL J4+ Chromebook with Cadmium.
The text was updated successfully, but these errors were encountered: