summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fbe9d3d)
raw | patch | inline | side by side (parent: fbe9d3d)
author | Chih-Hung Hsieh <chh@google.com> | |
Thu, 28 Aug 2014 18:47:48 +0000 (11:47 -0700) | ||
committer | Chih-Hung Hsieh <chh@google.com> | |
Thu, 28 Aug 2014 22:10:01 +0000 (15:10 -0700) |
GCC assembler allows xyz to be redeclared as weak,
by __weak_alias(xyz, _xyz), while _xyz is undefined.
Clang does not like that but silently generates no code.
It will reject its own .s file if the assembly code is saved first.
Since we have no reason to define xyz or _xyz as weak symbol now,
and _xyz is a macro to xyz, we simplify libC to have only
xyz defined as global.
BUG: 17186746
Change-Id: I24b154425838683cae69248cc750c59e26fd5467
by __weak_alias(xyz, _xyz), while _xyz is undefined.
Clang does not like that but silently generates no code.
It will reject its own .s file if the assembly code is saved first.
Since we have no reason to define xyz or _xyz as weak symbol now,
and _xyz is a macro to xyz, we simplify libC to have only
xyz defined as global.
BUG: 17186746
Change-Id: I24b154425838683cae69248cc750c59e26fd5467
index 6bb0a5720df906d6f5beeb9da14f92607d304f1e..a40a867b8e3be4d8f3bfc64a01b9bda1e4a9639d 100644 (file)
__asm__(".global " #alias "\n" \
#alias " = " #sym);
-#define __weak_alias(alias,sym) \
- __asm__(".weak " #alias "\n" \
- #alias " = " #sym);
-
/* We use __warnattr instead of __warn_references.
* TODO: remove this and put an empty definition in one of the upstream-* compatibility headers.
*/
diff --git a/libc/upstream-netbsd/android/include/namespace.h b/libc/upstream-netbsd/android/include/namespace.h
index 5df543cfc961c0e04f60dfe095727ea31178307e..630ea9b060ec4723304d11c45728af45003810da 100644 (file)
#ifndef _BIONIC_NETBSD_NAMESPACE_H_included
#define _BIONIC_NETBSD_NAMESPACE_H_included
-// NetBSD uses __weak_alias on a lot of functions. We don't want that.
-#if defined(__weak_alias)
-#undef __weak_alias
-#endif
-
__LIBC_HIDDEN__ int __res_enable_mt(void);
__LIBC_HIDDEN__ int __res_disable_mt(void);
diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h
index b9768e1856321570e40e24da5deb4de17bb99d88..630094d9950b2e8abad2a222fb3f49e13862b9ca 100644 (file)
#define _warn warn
#define _warnx warnx
+/* Ignore all __weak_alias in OpenBSD. */
+#define __weak_alias(alias,sym)
+
/* OpenBSD's <ctype.h> uses these names, which conflicted with stlport.
* Additionally, we changed the numeric/digit type from N to D for libcxx.
*/