TARGET_ARFLAGS := crs
TARGET_LIBGCC := $(shell $(TARGET_CC) -mthumb-interwork -print-libgcc-file-name)
-TARGET_LDLIBS := -Wl,-rpath-link=$(SYSROOT)/usr/lib $(TARGET_LIBGCC)
+TARGET_LDLIBS := -Wl,-rpath-link=$(SYSROOT)/usr/lib
# These flags are used to ensure that a binary doesn't reference undefined
# flags.
# this toolchain's generated binaries
TARGET_ABI_SUBDIR := armeabi
+# NOTE: Ensure that TARGET_LIBGCC is placed after all private objects
+# and static libraries, but before any other library in the link
+# command line when generating shared libraries and executables.
+#
+# This ensures that all libgcc.a functions required by the target
+# will be included into it, instead of relying on what's available
+# on other libraries like libc.so, which may change between system
+# releases due to toolchain or library changes.
+#
define cmd-build-shared-library
$(TARGET_CC) \
-nostdlib -Wl,-soname,$(notdir $@) \
$(PRIVATE_WHOLE_STATIC_LIBRARIES) \
-Wl,--no-whole-archive \
$(PRIVATE_STATIC_LIBRARIES) \
+ $(TARGET_LIBGCC) \
$(PRIVATE_SHARED_LIBRARIES) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_LDLIBS) \
-Wl,-dynamic-linker,/system/bin/linker \
-Wl,--gc-sections \
-Wl,-z,nocopyreloc \
- $(PRIVATE_SHARED_LIBRARIES) \
$(TARGET_CRTBEGIN_DYNAMIC_O) \
$(PRIVATE_OBJECTS) \
$(PRIVATE_STATIC_LIBRARIES) \
+ $(TARGET_LIBGCC) \
+ $(PRIVATE_SHARED_LIBRARIES) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_LDLIBS) \
$(TARGET_CRTEND_O) \
Android NDK ChangeLog:
-------------------------------------------------------------------------------
+current version
+
+IMPORTANT BUG FIXES:
+
+- Make target shared libraries portable to systems that don't use the exact same
+ toolchain (GCC 4.2.1) .
+
+-------------------------------------------------------------------------------
android-ndk-1.6_r1
IMPORTANT BUG FIXES:
in $(CLEAR_VARS) script.
-IMPORTANT CHANGES
+IMPORTANT CHANGES:
- The 'sources' directory is gone. The NDK build system now looks for
$(APP_PROJECT_PATH)/jni/Android.mk by default. You can override this with