On Thu, Feb 19, 2026 at 3:59 AM Thomas Schwinge <[email protected]> wrote:
>
> Hi!
>
> On 2021-09-21T09:37:15+0200, Eric Botcazou <[email protected]> wrote:
> > The implementation of the no_fsanitize_address effective target was copied
> > from asan-dg.exp without realizing that it does not work outside of this
> > context (there is a comment explaining why).  As a consequence, it always
> > returns 0, so for example the directive in gnat.dg/asan1.adb:
> >
> > { dg-skip-if "no address sanitizer" { no_fsanitize_address } }
> >
> > does not work.  [...], thus disabling them
> > everywhere instead of just for the problematic targets.
> >
> > The attached patch cleans up the mess, [...]
>
> > --- a/gcc/testsuite/lib/target-supports.exp
> > +++ b/gcc/testsuite/lib/target-supports.exp
>
> > -# Return 1 if target is not support address sanitize, 1 otherwise.
> > +# Return 1 if the target does not support address sanitizer, 0 otherwise
> >
> >  proc check_effective_target_no_fsanitize_address {} {
> >      if ![check_no_compiler_messages fsanitize_address executable {
> >       int main (void) { return 0; }
> > -    }] {
> > +    } "-fsanitize=address" ] {
> >       return 1;
> >      }
> > +
> >      return 0;
> >  }
>
> Turns out, that's still not sufficient.  ;-)
>
> I've pushed to trunk commit de1f7025fab32bc823a56a596a368e2e73eb2437
> "Further fix up effective-target 'no_fsanitize_address' check", see
> attached.

Thanks for doing this as I just fixed up a tetcase to use
no_fsanitize_address and missed that it would fail this way because I
only tested it with an already installed compiler so it was finding
libsan :).

Thanks,
Andrew

>
>
> Grüße
>  Thomas
>
>

Reply via email to