ramosian-glider / sanitizer-issues

test
0 stars 0 forks source link

Need to build the runtime library with -ffreestanding #59

Closed ramosian-glider closed 9 years ago

ramosian-glider commented 9 years ago

Originally reported on Google Code with ID 59

Without this flag, Clang may replace some loops in the RTL with calls to libc functions
like memcpy() and memset(). This may lead to crashes, because it's usually hard to
tell if a function is called during __asan_init (and those functions are being intercepted).
In particular, clang may put a call to foo() into internal_foo(), which we definitely
do not want.

I've tried to add -ffreestanding to projects/compiler-rt/make/config.mk, but then linking
programs with ASan RTL started to fail, because in some RTL modules the methods of
AsanStackTrace were mangled incorrectly.
I didn't dig much into this, but I suppose the problem was related to http://llvm.org/bugs/show_bug.cgi?id=12396

Reported by ramosian.glider on 2012-03-29 12:23:58

ramosian-glider commented 9 years ago
I added -fno-builtin to the build rules on Linux and Mac (r157238 and r157239)

Reported by konstantin.s.serebryany on 2012-05-22 08:01:33

ramosian-glider commented 9 years ago

Reported by ramosian.glider on 2012-09-13 13:41:49

ramosian-glider commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:12:59