Closed Bug 911240 Opened 11 years ago Closed 11 months ago

nss fails to build with recent android NDK

Categories

(NSS :: Build, defect, P3)

x86
macOS

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jack, Unassigned)

Details

Attachments

(1 file)

Linux.mk explicitly uses a toolchains path pointing directly to the gcc 4.4.3 toolchain, but this toolchain has been deprecated and removed in the most recent NDK. I think a better solution is add an NDK_TOOLCHAIN which points to a toolchain directory set up via make-standalone-toolchain.sh (a helper script bundled with the NDK). Then the specific toolchain won't be hardcoded. Another issue is that it assumes ar and ranlib are compatible with the system ar and ranlib instead of using the toolchain provided ones. This causes the build to fail on Mac OS X. Finally, STANDARDS_CFLAGS sets up defines that on Darwin result in not having access to readlink and some functions. Adding -D_POSIX_C_SOURCE=200112 is needed to get these, but this causes Sqlite3 to fail to build as it thinks posix_fallocate is available. Adding -DHAVE_POSIX_FALLOCATE=0 fixes that issue. Patch attached; we're using this config for now in Servo, but I'd like to get the necessary changes upstream. I'm sure this isn't appropriate as is, but I'll need some guidance on how to get this patch into shape for upstream.
Attachment #797908 - Flags: review?(brian)
Comment on attachment 797908 [details] [diff] [review] nss-ndk-and-darwin.patch Sorry for the delay here. I am not a good reviewer for this code, especially because i don't use Mac OS X. I suggest asking :cviecco and/or :keeler for feedback on the patch after making sure it builds, and then ask for a review from wtc@google.com or rrelyea@redhat.com.
Attachment #797908 - Flags: review?(brian)
Severity: normal → S3

This bug is no longer relevant because we're now using NDK r21 and clang.

Status: NEW → RESOLVED
Closed: 11 months ago
Priority: -- → P3
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: