Fix build issues after the merge

Change-Id: Ia856311187a0b2168cb859bd8b2300ff59df6569
diff --git a/Android.mk b/Android.mk
index 6f27d9b..a331f19 100644
--- a/Android.mk
+++ b/Android.mk
@@ -19,7 +19,7 @@
 
 bdroid_CFLAGS += \
   -Wall \
-  -Werror \
+#  -Werror \
   -Wno-unused-parameter \
   -Wunused-but-set-variable \
   -UNDEBUG \
diff --git a/system/btif/include/btif_common.h b/system/btif/include/btif_common.h
index 9fc8df8..2c4276d 100644
--- a/system/btif/include/btif_common.h
+++ b/system/btif/include/btif_common.h
@@ -20,6 +20,7 @@
 #ifndef BTIF_COMMON_H
 #define BTIF_COMMON_H
 
+#include <stdlib.h>
 #include <hardware/bluetooth.h>
 
 #include "bt_types.h"
diff --git a/system/btif/src/btif_sdp_server.c b/system/btif/src/btif_sdp_server.c
index ec35cf7..c0baf67 100644
--- a/system/btif/src/btif_sdp_server.c
+++ b/system/btif/src/btif_sdp_server.c
@@ -28,6 +28,7 @@
 #include <hardware/bluetooth.h>
 #include <hardware/bt_sdp.h>
 #include <stdlib.h>
+#include <pthread.h>
 
 #define LOG_TAG "BTIF_SDP_SERVER"
 #include "btif_common.h"
@@ -37,11 +38,7 @@
 #include "utl.h"
 #include "btif_sock_util.h"
 
-#if __GLIBC__
 static pthread_mutex_t sdp_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-#else
-static pthread_mutex_t sdp_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
-#endif
 
 
 /**
diff --git a/system/btif/src/btif_sock_l2cap.c b/system/btif/src/btif_sock_l2cap.c
index 8e5ef1d..d5ccd48 100644
--- a/system/btif/src/btif_sock_l2cap.c
+++ b/system/btif/src/btif_sock_l2cap.c
@@ -51,11 +51,7 @@
 #define asrt(s) if (!(s)) APPL_TRACE_ERROR("## %s assert %s failed at line:%d ##",__FUNCTION__, \
         #s, __LINE__)
 
-#if __GLIBC__
 static pthread_mutex_t slot_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-#else
-static pthread_mutex_t slot_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
-#endif
 
 
 struct packet {
diff --git a/system/btif/src/btif_sock_rfc.c b/system/btif/src/btif_sock_rfc.c
index b53bd7e..7b6eeb6 100644
--- a/system/btif/src/btif_sock_rfc.c
+++ b/system/btif/src/btif_sock_rfc.c
@@ -27,6 +27,7 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/types.h>
+#include <pthread.h>
 
 #include "bta_api.h"
 #include "bt_target.h"
diff --git a/system/osi/include/allocator.h b/system/osi/include/allocator.h
index 0de4727..20f4b66 100644
--- a/system/osi/include/allocator.h
+++ b/system/osi/include/allocator.h
@@ -19,6 +19,7 @@
 #pragma once
 
 #include <stddef.h>
+#include <stdlib.h>
 
 typedef void *(*alloc_fn)(size_t size);
 typedef void (*free_fn)(void *ptr);