Fix build (take two).
Make sure __netdClientDispatch is defined in the same set of libraries that
refer to it (e.g.: with connect.cpp).
(cherry picked from commit 8205a61248973ac13716ae80e712c80e126b0541)
Change-Id: I86d7bf2df5bde09f75a35b204eac0e1361747e22
diff --git a/libc/bionic/NetdClient.cpp b/libc/bionic/NetdClient.cpp
index 56d8244..6826ee8 100644
--- a/libc/bionic/NetdClient.cpp
+++ b/libc/bionic/NetdClient.cpp
@@ -14,24 +14,14 @@
* limitations under the License.
*/
+#ifdef LIBC_STATIC
+#error NetdClient.cpp should NOT be included in static libc builds.
+#endif
+
#include <private/NetdClient.h>
#include <private/libc_logging.h>
#include <pthread.h>
-#ifdef __i386__
-#define __socketcall __attribute__((__cdecl__))
-#else
-#define __socketcall
-#endif
-
-extern "C" __socketcall int __connect(int, const sockaddr*, socklen_t);
-
-NetdClientDispatch __netdClientDispatch __attribute__((aligned(32))) = {
- __connect
-};
-
-#ifndef LIBC_STATIC
-
#include <dlfcn.h>
template <typename FunctionType>
@@ -56,13 +46,9 @@
static pthread_once_t netdClientInitOnce = PTHREAD_ONCE_INIT;
-#endif // LIBC_STATIC
-
extern "C" __LIBC_HIDDEN__ void netdClientInit() {
-#ifndef LIBC_STATIC
if (pthread_once(&netdClientInitOnce, netdClientInitImpl)) {
__libc_format_log(ANDROID_LOG_ERROR, "netdClient",
"Unable to initialize netd_client component.");
}
-#endif // LIBC_STATIC
}