Go to file
Nick Kralevich 16d1af167f libc: add limited FORTIFY_SOURCE support for clang
In 829c089f83, we disabled all
FORTIFY_SOURCE support when compiling under clang. At the time,
we didn't have proper test cases, and couldn't easily create targeted
clang tests.

This change re-enables FORTIFY_SOURCE support under clang for a
limited set of functions, where we have explicit unittests available.
The functions are:

* memcpy
* memmove
* strcpy
* strncpy
* strcat
* strncat
* memset
* strlen (with modifications)
* strchr (with modifications)
* strrchr (with modifications)

It may be possible, in the future, to enable other functions. However,
I need to write unittests first.

For strlen, strchr, and strrchr, clang unconditionally calls the
fortified version of the relevant function. If it doesn't know the
size of the buffer it's dealing with, it passes in ((size_t) -1),
which is the largest possible size_t.

I added two new clang specific unittest files, primarily copied
from fortify?_test.cpp.

I've also rebuild the entire system with these changes, and didn't
observe any obvious problems.

Change-Id: If12a15089bb0ffe93824b485290d05b14355fcaa
2013-06-18 12:14:20 -07:00
libc libc: add limited FORTIFY_SOURCE support for clang 2013-06-18 12:14:20 -07:00
libdl Drop unnecessary execution permission for .cpp/.c/.h 2013-03-22 10:28:15 +08:00
libm Take upstream libm changes. 2013-06-12 16:37:58 -07:00
libstdc++ Clean up internal libc logging. 2013-03-15 16:12:58 -07:00
libthread_db Fix the pthread_setname_np test. 2013-02-15 12:08:59 -08:00
linker Honor p_vaddr if set 2013-06-07 12:47:58 -07:00
tests libc: add limited FORTIFY_SOURCE support for clang 2013-06-18 12:14:20 -07:00
.gitignore Merge memory checking functionality from sandbox 2010-02-16 11:43:18 -08:00
ABI-bugs.txt Regenerate NOTICE files. 2013-03-07 11:51:10 -08:00
Android.mk Remove the simulator target from all makefiles. 2011-07-11 22:11:41 -07:00
CleanSpec.mk Add an empty CleanSpec.mk 2010-03-08 18:04:02 -08:00