[llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86
Nelson Elhage
nelhage at nelhage.com
Mon Jul 5 16:07:11 PDT 2010
On Mon, 5 Jul 2010 15:26:05 -0700, Eric Christopher <echristo at apple.com> wrote:
>
> On Jul 5, 2010, at 2:28 PM, Bill Wendling wrote:
>
> > This is in the "Generic" folder. Please don't change it like
> > this. If the test as is can no longer be done generically, then we
> > should find another solution.
> >
> > --- a/test/CodeGen/Generic/stack-protector.ll
> > +++ b/test/CodeGen/Generic/stack-protector.ll
> > @@ -1,5 +1,7 @@
> > -; RUN: llc < %s -o - | grep {__stack_chk_guard}
> > -; RUN: llc < %s -o - | grep {__stack_chk_fail}
> > +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_guard}
> > +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_fail}
> > +; Linux/x86 stores the stack cookie in a weird place. So we force an arbitrary
> > +; non-x86 test to make sure codegen uses the generic case.
> >
> > @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1]
>
> Yeah, we should probably move it to x86 and ppc so that each of them
> have their own stack protector tests.
>
> -eric
Ok, I can split this into arch-specific tests. Would you prefer if I
make a (nearly-identical) copy of this test for each architecture, or
just pick one or a handful, and let developers add more if appropriate
if and when they implement glibc stack cookie support for those targets?
I guess I should also add a case to the X86 test with
-mtriple=x86_64-apple-darwin or such, to check that we still use
__stack_chk_guard in that case.
- Nelson
More information about the llvm-commits
mailing list