Bob Wilson
e67004e2f1
Back out some changes that accidentally committed.
...
llvm-svn: 150254
2012-02-10 16:41:46 +00:00
Bob Wilson
ddd971564e
Revert r150232 since it breaks the build when there's no ARM assembler.
...
llvm-svn: 150253
2012-02-10 16:36:49 +00:00
Daniel Dunbar
d205200d41
make/clang_darwin: Tweak CheckArches function to force the integrated-as and use
...
the stub SDK to try and ensure we always pick up the right archs when they
should be able to be used.
- Also, warn when we drop an architecture.
llvm-svn: 150232
2012-02-10 06:00:35 +00:00
Timur Iskhodzhanov
7ce3e5bb8e
[asan] The first version of the RTL for Windows, reviewed at http://codereview.appspot.com/5647052
...
llvm-svn: 150185
2012-02-09 17:20:14 +00:00
Timur Iskhodzhanov
bc9bb3f581
Test commit + fix an obvious typo
...
llvm-svn: 150184
2012-02-09 16:29:41 +00:00
Alexey Samsonov
9654367cbc
AddressSanitizer: move mach_override inside interception library
...
llvm-svn: 150171
2012-02-09 11:36:12 +00:00
Kostya Serebryany
0394da7bea
[asan] unpoison the stack before every noreturn call. Fixes asan issue 37. rt part
...
llvm-svn: 150101
2012-02-08 21:33:27 +00:00
Alexey Samsonov
8489f2a564
AddressSanitizer: start factoring out interception machinery
...
llvm-svn: 150083
2012-02-08 19:52:01 +00:00
Alexander Potapenko
1da11ec357
Move the _ReturnAddress definition out of the __asan:: namespace
...
Patch by Timur Iskhodzhanov (timurrrr@google.com )
llvm-svn: 150075
2012-02-08 14:14:18 +00:00
Alexey Samsonov
e725478e2f
AddressSanitizer: replace all "real_X" calls with "REAL(X)"
...
llvm-svn: 150073
2012-02-08 13:45:31 +00:00
Alexander Potapenko
42cdb7e640
Typo fix: s/SNPrint/SNPrintf
...
llvm-svn: 150069
2012-02-08 11:45:09 +00:00
Kostya Serebryany
9716914b2d
[asan] better warning messages for double-free bugs (provide allocation/deallocation stack traces)
...
llvm-svn: 150027
2012-02-08 00:42:29 +00:00
Kostya Serebryany
f98fc08bc7
[asan] GET_CALLER_PC macro for Win. Patch by timurrrr@google.com
...
llvm-svn: 149994
2012-02-07 18:23:54 +00:00
Kostya Serebryany
d61255638f
[asan] print 'ALL TESTS PASSED' in makefile when running tests (convenience)
...
llvm-svn: 149990
2012-02-07 17:36:07 +00:00
Kostya Serebryany
614b53de1b
[asan] don't crash if /proc/self/maps has enormous size (linux)
...
llvm-svn: 149944
2012-02-07 00:47:35 +00:00
Kostya Serebryany
b5eb5a7a05
[asan] make sure the AsanThread object is destroyed if pthread_exit is called
...
llvm-svn: 149940
2012-02-07 00:27:15 +00:00
Kostya Serebryany
546ba363ea
[asan] use raw syscalls for open/close on linux to avoid being intercepted
...
llvm-svn: 149892
2012-02-06 19:23:38 +00:00
Kostya Serebryany
9ff28d661d
[asan] The first version of Windows malloc interceptors, patch by timurrrr@google.com
...
llvm-svn: 149875
2012-02-06 17:56:38 +00:00
Nick Kledzik
686f0d17a6
On Apple platforms, wire up compilerrt_abort() to log file and function info
...
llvm-svn: 149723
2012-02-03 23:53:40 +00:00
Nick Kledzik
a2b846c000
Remove __attribute__((weak)) on function prototype. It has a different meaning on prototypes then it does on definitions. It is not needed on the prototype and causes build failures for static codegen
...
llvm-svn: 149720
2012-02-03 23:10:55 +00:00
Alexey Samsonov
f9fef3d275
AddressSanitizer: simplify RoundUpToPowerOfTwo/clz; add a couple of CHECKs for real_X calls. Patch by timurrrr@google.com
...
llvm-svn: 149687
2012-02-03 08:50:16 +00:00
Alexey Samsonov
23e3b90319
AddressSanitizer: Replace __attribute__ with macro (for Win compatibility). Patch by timurrrr@google.com
...
llvm-svn: 149686
2012-02-03 08:37:19 +00:00
Alexey Samsonov
15965f9c3d
AddressSanitizer: Add macro for definition/declaration of interceptors
...
llvm-svn: 149602
2012-02-02 10:39:40 +00:00
Alexander Potapenko
c97434ecaf
Disable wrapping memcpy() on Mac OS Lion, where it
...
actually falls back to memmove.
In this case we still need to initialize real_memcpy, so we set it to
real_memmove
We check for MACOS_VERSION_SNOW_LEOPARD, because currently only Snow
Leopard and Lion are supported.
llvm-svn: 149492
2012-02-01 10:07:52 +00:00
Alexander Potapenko
f504602a0f
Disables testing memcpy() on Mac OS 10.7,
...
where memcpy() in fact aliases memmove() and thus calling it with
overlapping parameters is not an error.
llvm-svn: 149491
2012-02-01 09:47:40 +00:00
Kostya Serebryany
9160b5059b
[asan] fix the wrong __WORDSIZE definition on Win x64, add ASAN_INTERFACE_FUNCTION_ATTRIBUTE. Patch by timurrrr@google.com
...
llvm-svn: 149395
2012-01-31 18:13:50 +00:00
Kostya Serebryany
7e7d0ca1a2
[asan] remove dead code
...
llvm-svn: 149392
2012-01-31 17:29:02 +00:00
Alexander Potapenko
81203bdb33
Implement GetMacosVersion() to obtain the OS X version at runtime.
...
llvm-svn: 149382
2012-01-31 13:19:18 +00:00
Kostya Serebryany
ad1fccdb1c
[asan] tests should not require the asan-rt to be built with debug info
...
llvm-svn: 149330
2012-01-31 01:56:58 +00:00
Kostya Serebryany
bca91defcb
[asan] new run-time flag: sleep_before_dying (asan Issue #31 )
...
llvm-svn: 149306
2012-01-31 00:52:18 +00:00
Kostya Serebryany
9aca3b0d2f
[asan] re-enable the test for ObjC initialization bug
...
llvm-svn: 149302
2012-01-30 23:55:46 +00:00
Kostya Serebryany
39ba3f724f
[asan] fix issue 35: don't let the optimizer to optimize the test code away.
...
llvm-svn: 149296
2012-01-30 23:23:26 +00:00
Kostya Serebryany
fed83c5755
[asan] ifdef/include cleanup
...
llvm-svn: 149281
2012-01-30 22:11:04 +00:00
Kostya Serebryany
cf2c65aa8e
[asan] add a test for __attribute__ no_address_safety_analysis
...
llvm-svn: 149278
2012-01-30 21:34:59 +00:00
Kostya Serebryany
510850c345
[asan] minor ifdef cleanup
...
llvm-svn: 149274
2012-01-30 20:55:02 +00:00
Alexey Samsonov
2dcef2d2a8
AddressSanitizer: Enforce default visibility for all libc interceptors
...
llvm-svn: 149247
2012-01-30 13:42:44 +00:00
Alexander Potapenko
81ebb0aafb
Add a mask for "cmpb $imm, (%rdi)" on x86_64
...
llvm-svn: 149245
2012-01-30 12:49:00 +00:00
Anton Korobeynikov
28037ceacf
Proper divmod implementation
...
llvm-svn: 149242
2012-01-30 10:21:51 +00:00
Anton Korobeynikov
b047b04c4c
Provide aeabi_mem* functions.
...
llvm-svn: 149241
2012-01-30 10:21:23 +00:00
Alexander Potapenko
f519564d7c
Make compiler-rt/trunk/lib/asan compileable with Visual Studio 2008 on Windows.
...
Patch by Timur Iskhodzhanov (timurrrr@google.com )
To test:
$ cl /c *.c*
in the asan directory.
The code fails to link if you omit the "/c" part but that's one of the
next steps,
as well as a few TODO's I've put into the Windows-specific code.
llvm-svn: 149130
2012-01-27 15:15:04 +00:00
Alexander Potapenko
13d95d5e5a
Make compiler-rt/trunk/lib/asan compileable with g++.
...
Patch by Timur Iskhodzhanov (timurrrr@google.com )
The double-extern thing is
http://llvm.org/bugs/show_bug.cgi?id=11869
And the #include <string[s].h> are only needed on Mac (see comments in
the original code)
and also including them might make strchr/index conflict with the g++
system headers (which don't follow the man pages, ouch!)
llvm-svn: 149129
2012-01-27 10:52:37 +00:00
Alexander Potapenko
fabfcd8bea
Darwin-specific templates for the output tests.
...
These should fix the output tests on Mac.
llvm-svn: 149068
2012-01-26 17:40:18 +00:00
Alexander Potapenko
02a71626e3
More accurate atos execution which depends on the file type (EXECUTE, DYLIB) of the binary.
...
More Linux-like output on Mac (to match more output tests).
llvm-svn: 149064
2012-01-26 17:06:50 +00:00
Alexander Potapenko
98f0c713d9
Fix a bug in AsanProcMaps on Mac: on 64 bits the program was trying to read twice as many segment load commands as the binary actually contained.
...
llvm-svn: 149063
2012-01-26 17:01:20 +00:00
Alexander Potapenko
1f397fb87f
Tune asan_symbolize.py to symbolize 64-bit binaries correctly.
...
Add the DEBUG flag to test_output.sh
llvm-svn: 148798
2012-01-24 10:44:44 +00:00
Kostya Serebryany
586ade114b
[asan] use internal_strcmp before asan_init is done. *may* fix asan issue #30
...
llvm-svn: 148726
2012-01-23 21:20:05 +00:00
Kostya Serebryany
f9418f9679
[asan] test that -fno-optimize-sibling-calls helps to get sane stack traces
...
llvm-svn: 148714
2012-01-23 18:44:34 +00:00
Alexander Potapenko
046ecc06be
Wrap CFStringCreateCopy to prevent copying constant CF strings.
...
This should fix http://code.google.com/p/address-sanitizer/issues/detail?id=10
llvm-svn: 148696
2012-01-23 10:09:54 +00:00
Alexander Potapenko
f9392011c8
Add a test for CFStringCreateCopy.
...
Normally this function should not create copies of constant strings, but it does when the default CFAllocator
is replaced (e.g. under AddressSanitizer)
This test is related to http://code.google.com/p/address-sanitizer/issues/detail?id=10
llvm-svn: 148695
2012-01-23 10:06:14 +00:00
Evgeniy Stepanov
3f6840745c
Make the Android TSD workaround more reliable.
...
By scanning the thread list backwards.
llvm-svn: 148476
2012-01-19 13:57:45 +00:00