platform_bionic/libc/include
Elliott Hughes 8f5608b614 Fix ffs on x86 for old API levels.
<strings.h>'s ffs used to work by accident. In the past, <strings.h> used
to incorrectly declare ffs for all platforms at all API levels. In the
unified headers, there's no such declaration for x86 before API 18 (which
makes sense, because that function was missing on x86 until then).

But as long as there was a declaration for ffs, the compiler just inlined
__builtin_ffs. There was no problem at link time because the compiler didn't
actually add a reference to the missing ffs symbol.

Restore the old behavior by manually instructing the compiler to inline its
builtin in these cases.

Bug: https://github.com/android-ndk/ndk/issues/439
Test: built new NDK 'ffs' test
Change-Id: I840e99f237c86f7cb028a0f67aaa8c6ff3eda245
2017-06-30 17:50:44 -07:00
..
android Fix ffs on x86 for old API levels. 2017-06-30 17:50:44 -07:00
arpa Remove remaining big-endian cruft. 2016-09-16 18:53:34 -07:00
bits Fix _POSIX_THREAD_PROCESS_SHARED. 2017-05-20 13:11:14 -07:00
net Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
netinet Add and use constants for the Android API levels. 2016-11-16 16:55:42 -08:00
netpacket
sys Merge "Add sys/stat.h compatibility macros for old NDKs." 2017-06-16 22:52:01 +00:00
alloca.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
ar.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
assert.h Stop #define'ing __func__ and __restrict. 2016-07-25 11:13:47 -07:00
byteswap.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
complex.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
cpio.h Add two missing POSIX constant-only headers. 2016-08-12 09:28:17 -07:00
ctype.h Add and use constants for the Android API levels. 2016-11-16 16:55:42 -08:00
dirent.h Remove unnecessary 'extern's. 2016-07-22 18:57:12 -07:00
dlfcn.h Add #defines for some key enums. 2017-06-15 15:12:29 -07:00
elf.h Restore ELF32_ST_INFO/ELF64_ST_INFO. 2017-04-30 22:56:10 -07:00
endian.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
err.h The err family allow null format strings. 2014-07-11 02:53:27 +00:00
errno.h Remove volatile from the __errno declaration. 2017-06-13 16:02:07 -07:00
error.h Make it possible to build bionic with -I instead of -isystem. 2016-07-22 13:12:53 -07:00
fcntl.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
features.h Move the meat of <features.h> into <sys/cdefs.h>. 2014-08-19 11:18:20 -07:00
fenv.h Add and use constants for the Android API levels. 2016-11-16 16:55:42 -08:00
fnmatch.h Remove unnecessary 'extern's. 2016-07-22 18:57:12 -07:00
fts.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
ftw.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
getopt.h Extract getopt and friends to <bits/getopt.h> 2016-04-07 18:01:59 -07:00
grp.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
ifaddrs.h Add versioning information to symbols. 2016-04-29 16:39:50 -07:00
inttypes.h Fix format macros for fast16 and fast32 int types. 2016-10-26 17:52:38 -07:00
langinfo.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
lastlog.h Fix various empty .h files in bionic. 2016-04-29 22:30:19 -07:00
libgen.h Remove unnecessary 'extern's. 2016-07-22 18:57:12 -07:00
limits.h Clean up <sys/limits.h> a bit. 2016-11-30 09:06:53 -08:00
link.h Make the _Unwind_Ptr declaration match clang's. 2017-04-21 19:52:21 +00:00
locale.h Provide fake definitions for libstdc++. 2016-09-08 16:13:28 -07:00
malloc.h Revert "Make mallopt available in the future." 2017-05-31 00:15:00 +00:00
math.h Revert "isnan and isinf aren't functions." 2017-03-30 17:18:31 -07:00
memory.h Fix <memory.h> to be a synonym for <string.h> like in glibc. 2013-02-22 11:11:48 -08:00
mntent.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
netdb.h Document that our getnameinfo(3) prototype is unfixably wrong. 2016-08-16 15:05:57 -07:00
nl_types.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
paths.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
poll.h libc: add clang FORTIFY support 2017-02-09 15:49:32 -08:00
pthread.h Put back more legacy pthread APIs. 2017-06-22 12:52:17 -07:00
pty.h Add versioning information to symbols. 2016-04-29 16:39:50 -07:00
pwd.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
regex.h Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64. 2015-08-27 14:48:32 -07:00
resolv.h Remove #pragma GCC visibility. 2016-07-25 15:57:02 -07:00
sched.h Remove unnecessary 'extern's. 2016-07-22 18:57:12 -07:00
search.h Update header versions for NDK platform fixes. 2016-06-02 13:40:35 -07:00
semaphore.h POSIX says SEM_FAILED shall have type sem_t*. 2016-08-12 10:28:52 -07:00
setjmp.h Update header versions for NDK platform fixes. 2016-06-02 13:40:35 -07:00
signal.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
stdatomic.h Guard include of uchar.h in stdatomic.h 2016-08-04 18:22:12 +00:00
stdint.h Fix instances of '#if __LP64__'. 2016-09-15 14:21:28 -07:00
stdio.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
stdio_ext.h Add versioning information to symbols. 2016-04-29 16:39:50 -07:00
stdlib.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
string.h libc: fix typo in __RENAME macro 2017-04-19 18:46:44 +00:00
strings.h Fix ffs on x86 for old API levels. 2017-06-30 17:50:44 -07:00
syscall.h Add all the glibc one-line "synonym" header files. 2015-07-17 13:59:36 -07:00
sysexits.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
syslog.h versioner: refactor to use CompilerInstance directly. 2016-11-09 13:50:07 -08:00
tar.h Add two missing POSIX constant-only headers. 2016-08-12 09:28:17 -07:00
termio.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
termios.h Add legacy inlines for more termios stuff. 2017-02-23 11:09:32 -08:00
time.h Add and use constants for the Android API levels. 2016-11-16 16:55:42 -08:00
time64.h Remove the non-standard time64 stuff for LP64. 2014-05-05 17:14:02 -07:00
uchar.h Clean up <uchar.h> and <wctype.h> transitive includes. 2016-07-27 10:45:05 -07:00
ucontext.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00
unistd.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
utime.h Remove unnecessary 'extern's. 2016-07-22 18:57:12 -07:00
utmp.h Add versioning information to symbols. 2016-04-29 16:39:50 -07:00
wait.h Add all the glibc one-line "synonym" header files. 2015-07-17 13:59:36 -07:00
wchar.h Move a <wchar.h> implementation detail into the implementation. 2017-06-15 10:37:26 -07:00
wctype.h DO NOT MERGE: The future is now. 2017-04-20 16:57:25 -07:00
xlocale.h Always include <sys/cdefs.h>. 2016-07-22 17:01:54 -07:00