diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-15 21:40:08 +0100 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-15 21:40:08 +0100 |
commit | ddb2e563693fc76d1616f409990934699748c10b (patch) | |
tree | fe3320d4c5f46952ca9e43a08cb43c0c10d4aa98 | |
parent | 74beb12410bd700375138c991e40c60810d67d6a (diff) | |
download | bionic-linaro_android_4.2.tar.gz |
bionic: Add workarounds for current compilerslinaro_android_4.2
With current compilers, we're getting "this function cannot be inlined"
errors on vsnprintf and strlcpy because the always_inline attribute is
set.
Before marking this a "fix" instead of a "workaround", we should figure
out why the functions can't be inlined.
Change-Id: Id6c5464defafb3f9044c102d32a57e70d760b05d
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | libc/include/stdio.h | 2 | ||||
-rw-r--r-- | libc/include/string.h | 2 | ||||
-rw-r--r-- | libc/include/sys/cdefs.h | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 8b95663f4..9909fa19b 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -482,7 +482,7 @@ __END_DECLS #if defined(__BIONIC_FORTIFY_INLINE) -__BIONIC_FORTIFY_INLINE +__BIONIC_FORTIFY_INLINE_WITHOUT_ALWAYS __attribute__((__format__ (printf, 3, 0))) __attribute__((__nonnull__ (3))) int vsnprintf(char *dest, size_t size, const char *format, __va_list ap) diff --git a/libc/include/string.h b/libc/include/string.h index 06e22841b..bd332081b 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -153,7 +153,7 @@ extern void __strlcpy_error() __attribute__((__error__("strlcpy called with size bigger than buffer"))); extern size_t __strlcpy_chk(char *, const char *, size_t, size_t); -__BIONIC_FORTIFY_INLINE +__BIONIC_FORTIFY_INLINE_WITHOUT_ALWAYS size_t strlcpy(char *dest, const char *src, size_t size) { size_t bos = __builtin_object_size(dest, 0); diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h index ca81cb666..71f448c23 100644 --- a/libc/include/sys/cdefs.h +++ b/libc/include/sys/cdefs.h @@ -507,6 +507,10 @@ __attribute__ ((always_inline)) \ __attribute__ ((gnu_inline)) \ __attribute__ ((artificial)) +#define __BIONIC_FORTIFY_INLINE_WITHOUT_ALWAYS \ + extern inline \ + __attribute__ ((gnu_inline)) \ + __attribute__ ((artificial)) #define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1) #endif |