Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't build NSS for Android on Mac post NDK upgrade to 25 #5491

Closed
tarikeshaq opened this issue Apr 20, 2023 · 2 comments · Fixed by #5514
Closed

Can't build NSS for Android on Mac post NDK upgrade to 25 #5491

tarikeshaq opened this issue Apr 20, 2023 · 2 comments · Fixed by #5514
Assignees

Comments

@tarikeshaq
Copy link
Contributor

tarikeshaq commented Apr 20, 2023

After the NDK upgrade, the libs/verify-android-environment script fails for mac users. We've established there is a problem with the build script attempting to run the system assembler and passing in a --64 option, which the mac assembler doesn't support.

In the mean time, a few notes:

  • This does not affect anyone with an already existing build of NSS (i.e you've run verify-android-environment before the upgrade) and still have a working libs/android directory
  • If this affects you, one remedy is to:

┆Issue is synchronized with this Jira Task
┆Sprint End Date: 2023-05-04

@mhammond
Copy link
Member

So the new NDK is causing the assember to be executed via:

"/usr/bin/as" --64 ...

whereas the earlier NDK is executing:

"/Users/skip/Library/Android/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/as" --noexecstack --64

any they are quite different assembers:

% /Users/skip/Library/Android/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/as --version
GNU assembler (GNU Binutils) 2.27.0.20170315
Copyright (C) 2016 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-linux-android'.

% /usr/bin/as --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

apparently the new ndk doesn't come with any GCC tools - there's no as installed. According to this -fno-integrated-as should help, but didn't for me. However, the failing compilation is passing -no-integrated-as - and removing that seems to help, even though it seems the opposite of what should happen.

So I'm still confused but mildly less confused than I was :)

@mhammond
Copy link
Member

The gyp scripts also have a force_integrated_as variable, but no idea how that helps as yet

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants