-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Update to NDK 27 #20935
Update to NDK 27 #20935
Conversation
Emmm... Seems out of space on GitHub Action... |
e4ccc07
to
1c0b2a1
Compare
Should wait for actions/runner-images#10314, otherwise CI will fail on the packages in |
Can |
I think some packages require it, so not dropped completely, but if you want to remove it from this central location, see which packages fail to build or run, then add it for just those, that's fine. |
Ok I will kick off a test build with NDK r26b with the openmp options removed... |
Why can't we just update to ndk 29? |
I think you are confusing NDK version and API level. |
Possible. I just tried to build one app on Termux and it throws an error that the function appeared in Android 29. I assumed it was about NDK because it's a C++ app |
Yeah you're probably talking about the API target.
for additional information. |
ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-linux.zip | ||
ANDROID_NDK_SHA256=ad73c0370f0b0a87d1671ed2fd5a9ac9acfd1eb5c43a7fbfbd330f85d19dd632 | ||
ANDROID_NDK_SHA256=2f17eb8bcbfdc40201c0b36e9a70826fcd2524ab7a2a235e2c71186c302da1dc | ||
elif [ "$TERMUX_NDK_VERSION" = 23c ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this pull keeps 23c around, rather than switching to keeping 26b as the backup and 27 as the new default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the last NDK to support -march=armv7-a -mfpu=vfpv3-d16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some packages are still using it for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All existing arm packages are built with LDFLAGS -mfpu=neon
so no. This is only kept to extend hardware support for Termux. I am pretty much the only maintainer that still uses it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, what do you use 23c for, some old armv7 devices?
@licy183, would it make sense to keep 26b around also as a backup or no need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emmm... I think there is no need to keep NDK 26b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't 23c useful for compiling some packages in termux-user-repository as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, github is removing everything older than NDK 26 from their CI images, actions/runner-images#10342.
Android 29 is the version of the OS APIs, while NDK 27 is a new development toolchain that supports Android OS APIs 21 through 35, the latest OS API version that will be released next month. We target Android OS API 24, partially for the reasons given in the links @TomJo2000 gave. |
#include <stdarg.h> | ||
#include <stddef.h> | ||
|
||
+#if !defined(__swift__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed this last commit for the upcoming Swift 6, shouldn't affect anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the reason for this change or what issues are fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, wasn't sure if anyone would be interested. 😄
Swift 6 adds a fully modularized android.modulemap
, as opposed to the glibc.modulemap
we reuse from linux in the current Swift 5.10 package. This change is primarily to help with the new C++ interoperability features of Swift, which require a modularized libc module map to go with the libc++ module.modulemap from the NDK that we currently ship.
The problem is these additional headers we patch in for Termux break that modularity, in ways I don't understand. So, I found that the Swift compiler sets __swift__
when importing these headers and undefined these when building for Swift, including the ctermid()
inline function definition that needs that header.
I have yet to see any build failure when openmp options are removed (currently up to 832 packages) |
@Grimler91, do we need a full package rebuild after this? |
@finagolfin based on previous updates there should be no need. Also doesn't seem to be any large obvious changes that should affect us in changelog, but I'll try to run some builds to check for new errors affecting packages |
ndk-patches/27/stdlib.h.patch
Outdated
+#include <stdint.h> | ||
+endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing #
here, #endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@licy183, I didn't pull again before fixing this typo just now. Feel free to push your local branch again with my last commit added if I missed something.
I'm going to test my daily Swift CI for Android now with NDK 27, will add that cached NDK download step to this pull too if all goes well, so we won't have to wait on the github runner image to add NDK 27. |
Busybox fails to build due to missing symbols in static lib generation, so maybe several packages that internally use static libs will have similar errors:
|
That's probably not related to NDK update, see https://www.mail-archive.com/busybox%40busybox.net/msg29286.html. There are similar issues reported about glibc or Linux kernel update (googlefu). |
I'm seeing an issue with using |
Heh, I first looked up if anyone had reported a Edit: I didn't read it closely enough, he's actually a non-Termux user complaining about how a change I made to CMake for Termux affects him. 😉 |
Alright, added a commit to download NDK 27 to the github CI for big packages and cache it for later, plus kicked off a build of libllvm using it. |
Libllvm setup with the new NDK all looked fine, but failed only because I didn't update the flang version also, which is enforced to match. Kicked off a new build of zig instead, which won't take hours like libllvm. |
Alright, Zig built fine with NDK 27. I didn't know it shipped with its own copy of the LLVM source now, so that builds fine too. This pull now works for all packages and can be used as a base for any further CI testing wanted, before merging. |
NDK r27 fails to build current apt |
Can reproduce as well, error looks something like:
|
Termux builds. Unfortunately "too many" ncurses based packages fail to build on NDK r27. I think "all" the OpenMP options should be dropped and re-enabled per package. The current sox package that was enabled together with toolchain wide OpenMP options in #6146 just dont expose Here is what I am thinking to do:
However whether to do this before or after switching to NDK r27 is up for debate |
Updated this pull to use NDK 27 from the CI image for non-Docker builds, now that it's deployed.
After the switch IMO, as we should get this in soon. |
Time to get this in? I've moved my Swift CI for Android to NDK 27 without a problem. |
Tests fine on all of my devices (Android9-MIX2s-arm, Android13-MIX4-aarch64, Android7-Bluestacks-i686, Android7-Bluestacks-x86_64). I'll merge this now. |
…docker-build variable
They were added by the Termux build. They weren't present yesterday. |
It will be fixed in #21038. |
Closes #20927
I'll update the flang toolchain this weekend.