Initialize the rest of libcore's native code.

This native code requires NewGlobalRef, so this patch also implements
NewLocalRef/DeleteLocalRef, NewGlobalRef/DeleteGlobalRef, and
NewWeakGlobalRef/DeleteWeakGlobalRef.

(The assembler change is because "math.h" also defines OVERFLOW. A slight
change in #include ordering caused the names to conflict.)

Change-Id: Ifbf3b532ec3b0896bd7507d2881c6b77b64f01e7
diff --git a/build/Android.libart.mk b/build/Android.libart.mk
index b71cc53..61a25b4 100644
--- a/build/Android.libart.mk
+++ b/build/Android.libart.mk
@@ -38,7 +38,7 @@
     LOCAL_CFLAGS += -UNDEBUG
   endif
   LOCAL_C_INCLUDES += src $(ART_C_INCLUDES)
-  LOCAL_SHARED_LIBRARIES := liblog
+  LOCAL_SHARED_LIBRARIES := liblog libnativehelper
   ifeq ($(1),target)
     LOCAL_SHARED_LIBRARIES += libcutils libstlport libz libdl
   else
diff --git a/build/Android.test.mk b/build/Android.test.mk
index 3f5673c..22209ec 100644
--- a/build/Android.test.mk
+++ b/build/Android.test.mk
@@ -32,10 +32,10 @@
   LOCAL_C_INCLUDES += $(ART_C_INCLUDES)
   LOCAL_SHARED_LIBRARIES := libarttest libartd
   ifeq ($(1),target)
-    LOCAL_SHARED_LIBRARIES += libdl libicuuc libicui18n libstlport libz
+    LOCAL_SHARED_LIBRARIES += libdl libicuuc libicui18n libnativehelper libstlport libz
     LOCAL_STATIC_LIBRARIES := libgtest libgtest_main
   else
-    LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host libz-host
+    LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host libnativehelper libz-host
     LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_host libgtest_main_host
   endif
   ifeq ($(1),target)