-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
scripts: add termux_setup_gnu_as_23c for NDK r25 #11615
Conversation
1f0004c
to
039fd7c
Compare
039fd7c
to
2eec541
Compare
Not building Arm with custom assembly might have performance penalty... Next step either choose:
|
223a802
to
3d1d436
Compare
I added back GAS from NDK r23c... Seems to work fine with NDK r25... |
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 for looking into this!
Editing/enhancing the ndk really should only be dons as a last resort I think, would be better to fix the assembly in the affected packages, but obviously that isn't trivial.
So, this seems like a good approach for me where we would otherwise have to disable assembly and get massive penalties
# 1. bin/*-linux-android*-as | ||
# 2. *-linux-android*/bin/as (symlink to #1) | ||
# 3. lib/gcc/*-linux-android*/4.9.x/crtbegin.o (dummy file) | ||
cp -f "$NDK"/toolchains/llvm/prebuilt/linux-x86_64/bin/{arm-linux-androideabi,{aarch64,i686,x86_64}-linux-android}-as \ |
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.
I think it would be better to add this stuff to a separate folder (maybe something like ~/.termux-build/_cache/android-r23c-gas-api-24-v0
) to make it similar to what we do for the ndk toolchain.
3d1d436
to
082366f
Compare
Useful if we need to download a separate ndk version for some packages.
termux_step_ functions should be the ones run from build-package.sh, while non step functions are run from within other functions, or in build recipes.
And update PATH so as is found. Co-authored-by: Henrik Grimler <grimler@termux.dev>
a3d7704
to
0d1b991
Compare
Apparently openssl has a typo ASLAGS instead of ASFLAGS which supposedly should be CFLAGS and fno-integrated-as never worked 😅 Remove it since its no longer needed I still need to refine the comments |
Added a small repro case to determine clang does detect the GCC toolchain (in this case GAS only) so it should clear up the confusion whether the path is needed in the first place. Will squash all this into one commit if everybody agrees. |
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.
Nice work, looks good to me!
if [ ! -d "$NDK" ]; then
, that I added, can be removed as well, as setup-android-sdk already checks the same thing (see comment)
local GAS_TOOLCHAIN_REVISION="-v0" | ||
local GAS_TOOLCHAIN_DIR="$TERMUX_COMMON_CACHEDIR/android-r23c-gas-api-${TERMUX_PKG_API_LEVEL}${GAS_TOOLCHAIN_REVISION}" | ||
local NDK="$(dirname "$NDK")"/android-ndk-r23c | ||
if [ ! -d "$NDK" ]; 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.
this if
(that I added) is unnecessary, setup-android-sdk.sh already checks if folder exists
Gah... messed up the commit message... welp |
NDK r25 has removed GNU Assembler (GAS). Removal of GAS introduced a number of build issues. The most prominent is: /usr/bin/as: unrecognized option '-EL' Some options to solve this: 1. Disable building custom assembly and suffer performance penalty 2. Hand rewrite the custom assembly to be LLVM compatible 3. Wait for upstream to write LLVM compatible assembly (openssl, openssl-1.1) 4. Bring back GAS from NDK r23c In this commit, GAS is brought back as a separate toolchain instead of following NDK r23c file hierarchy. We pass "--gcc-toolchain=GAS_TOOLCHAIN_DIR" to NDK r25 clang to detect. Packages only have to add "termux_step_gnu_as_23c" to build.sh to enable GAS. In the future, we expect packages should follow option 3 more than option 4 as that is a last resort. This commit also bumps revision for packages that rely (or previously rely) on "-fno-integrated-as": hors, libffi, libgcrypt, libpixman, openssl, openssl-1.1 Co-authored-by: Henrik Grimler <grimler@termux.dev> Co-authored-by: Chongyun Lee <45286352+licy183@users.noreply.github.com>
NDK r25 has removed GNU Assembler (GAS). Removal of GAS introduced a number of build issues. The most prominent is: /usr/bin/as: unrecognized option '-EL' Some options to solve this: 1. Disable building custom assembly and suffer performance penalty 2. Hand rewrite the custom assembly to be LLVM compatible 3. Wait for upstream to write LLVM compatible assembly (openssl, openssl-1.1) 4. Bring back GAS from NDK r23c In this commit, GAS is brought back as a separate toolchain instead of following NDK r23c file hierarchy. We pass "--gcc-toolchain=GAS_TOOLCHAIN_DIR" to NDK r25 clang to detect. Packages only have to add "termux_step_gnu_as_23c" to build.sh to enable GAS. In the future, we expect packages should follow option 3 more than option 4 as that is a last resort. This commit also bumps revision for packages that rely (or previously rely) on "-fno-integrated-as": hors, libffi, libgcrypt, libpixman, openssl, openssl-1.1 Co-authored-by: Henrik Grimler <grimler@termux.dev> Co-authored-by: Chongyun Lee <45286352+licy183@users.noreply.github.com>
Fixes #11614
Fixes #11587