This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR lto/61048 Write/read option -fsanitize to/from object files
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Ilya Palachev <i dot palachev at samsung dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>, Vyacheslav Barinov <v dot barinov at samsung dot com>, Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>
- Date: Thu, 16 Oct 2014 13:38:32 +0200
- Subject: Re: [PATCH] PR lto/61048 Write/read option -fsanitize to/from object files
- Authentication-results: sourceware.org; auth=none
- References: <543D51CC dot 6050202 at samsung dot com> <20141015065919 dot GK10376 at tucnak dot redhat dot com> <543E2DC7 dot 3080907 at samsung dot com> <CAFiYyc0MMUTb6-ECMnuOg6BsLhLOF0aE+YkQk4GBXCvJaS86bg at mail dot gmail dot com> <543E891C dot 4080303 at samsung dot com>
On Wed, Oct 15, 2014 at 4:47 PM, Ilya Palachev <email@example.com> wrote:
> Hi all,
> The attached patch fixes PR lto/61048.
> The basic idea is to write option -fsanitize to existing ELF section
> .gnu.lto_.opts in object files and then read it in lto-wrapper.
> On 15.10.2014 12:46, Richard Biener wrote:
>> You need to handle them in lto-opts.c and output them to the existing
> 2 minor changes are added to existing function that write options (in
> lto-opts.c) and then read them from object files (lto-wrapper.c).
> The patch was bootstrapped and regtested on x86_64-unknown-linux-gnu.
> Ok for trunk?
Note that for mismatched options you'll now get the "first" chosen.
Which could be -fno-sanitize=address. Also if you build one file
with -fsanitize=address and one with -fsanitize=undefined you'll
get either but not both enabled.
So the patch works for the simple cases but it will likely require
more complex handling in lto-wrapper.c:merge_and_complain
to do something sensible for mismatches (and not treat
-fsanitize=address equal to -fsanitize=undefined).
Btw, similar merging issues probably exist for -fsanitize-recover,
-fsanitize-undefined-trap-on-error, or do they apply during
> Best regards,
> Ilya Palachev