Add support for LLVM_USE_SANITIZER = SafeStack

Valérian Rousset via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 06:28:07 PDT 2015


So I just opened two Differential on Phabricator: D13464 and D13465 (one by
project, as there is changes on llvm and libcxx).

I've added the log to the Phabricator, in the libcxx one.

Correct, SafeStack doesn't intercept new/delete, I removed it on Phabricator.

On Mon, Oct 05, 2015 at 05:08:55PM -0700, Alexey Samsonov wrote:
> 0) Yeah, using Phabricator would be nice...
> 
> 1) Can you provide a log with link error you observe?
> 
> 2)
> @@ -632,6 +632,10 @@ class Configuration(object):
>                  self.cxx.flags += ['-fsanitize=thread']
>                  self.config.available_features.add('tsan')
>                  self.config.available_features.add('sanitizer-new-delete')
> +            elif san == 'SafeStack':
> +                self.cxx.flags += ['-fsanitize=safe-stack']
> +                self.config.available_features.add('safestack')
> +                self.config.available_features.add('sanitizer-new-delete')
> ^^
> This doesn't seem right - SafeStack doesn't provide new/delete replacement.
>              else:
>                  self.lit_config.fatal('unsupported value for '
>                                        'use_sanitizer: {0}'.format(san))
> 
> On Mon, Oct 5, 2015 at 4:46 PM, Kostya Serebryany via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
> 
> > +folks who may be able to answer...
> > Next time, please use http://llvm.org/docs/Phabricator.html, at least for
> > for changes around -fsanitize=*
> >
> > On Mon, Oct 5, 2015 at 2:20 AM, Valérian Rousset via llvm-commits <
> > llvm-commits at lists.llvm.org> wrote:
> >
> >> Hello all,
> >>
> >> Here is a trivial patch to allow LLVM to be build with SafeStack, via
> >> LLVM_USE_SANITIZER=SafeStack.
> >>
> >> It does compile without issue, but some tests fail, mainly due to
> >> profiling with
> >> instrumentation.
> >> It fails with `undefined reference to `__safestack_unsafe_stack_ptr'`
> >> because it
> >> has to link with the SafeStack runtime but it wasn't build. What is the
> >> best way
> >> to do this? Mark the tests as unsupported or did I missed something?
> >>
> >> Have a nice day.
> >> --
> >> tharvik
> >>
> >> _______________________________________________
> >> llvm-commits mailing list
> >> llvm-commits at lists.llvm.org
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> >>
> >>
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> >
> >
> 
> 
> -- 
> Alexey Samsonov
> vonosmas at gmail.com

-- 
Valérian Rousset


More information about the llvm-commits mailing list