Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to build the runtime library with -ffreestanding #59

Closed
ramosian-glider opened this issue Aug 31, 2015 · 3 comments
Closed

Need to build the runtime library with -ffreestanding #59

ramosian-glider opened this issue Aug 31, 2015 · 3 comments

Comments

@ramosian-glider
Copy link
Member

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
Copy link
Member Author

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

  • Status changed: Fixed

@ramosian-glider
Copy link
Member Author

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

  • Labels added: OpSys-All

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

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

  • Labels added: ProjectAddressSanitizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant