This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][Revisedx4] Enable libsanitizer on darwin
- From: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- To: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, wmi at google dot com, dodji at redhat dot com, mikestump at comcast dot net, iain at codesourcery dot com, ro at cebitec dot uni-bielefeld dot de, glider at google dot com
- Date: Thu, 22 Nov 2012 06:48:32 +0400
- Subject: Re: [PATCH][Revisedx4] Enable libsanitizer on darwin
- References: <20121121184459.GA5081@bromo.med.uc.edu>
Looks good, but I guess we also need to copy the file LICENSE.TXT
--kcc
On Wed, Nov 21, 2012 at 10:44 PM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> The attached patch imports the missing mach_override/mach_override.h and
> mach_override/mach_override.c files from llvm.org's compiler-rt at
>
> r168032 | glider | 2012-11-15 03:32:16 -0500 (Thu, 15 Nov 2012) | 3 lines
>
> [ASan] Add the "lea $imm(%rip),%rax" instruction to mach_override.c
> The need for this has been reported by Jack Howarth (howarth@bromo.med.uc.edu) who's porting ASan-Darwin to GCC
>
> The patch adds darwin to the supported target list in configure.tgt and
> defines USING_MACH_OVERRIDE for darwin in configure.ac. The definition of
> USING_MACH_OVERRIDE is used in Makefile.am as the test for appending
> mach_override/mach_override.c to libinterception_la_SOURCES. LINK_COMMAND_SPEC_A
> in gcc/config/darwin.h is modified to add an entry to handle fsanitize=address
> so that the required linkages are used for libasan. The static linkage of libasan.a
> in LINK_COMMAND_SPEC_A is handle separately for -static-libstdc++ (which requires
> libstdc++.a) and the -static, -static-gcc and -static-gfortran cases. Tested on
> x86_64-apple-darwin12 for both -m32 and -m64 with the both use-after-free.c testcase
> and...
>
> make -k check RUNTESTFLAGS="asan.exp --target_board=unix'{-m32,-m64}'"
>
> without regressions.
> Jack
> ps This patch is identical to the prior version (asan_v7.diff) except the changes to
> gcc/config/darwin.h are adjusted for the renaming of the -faddress-sanitizer option to
> -fsanitize=address.
>