Message ID | 93AF3828-84AA-46A2-AAC0-7A4C4618ECB1@sandoe.co.uk |
---|---|
State | New |
Headers | show |
Series | PATCH, testsuite, x86] Make the requires test for CET a bit stronger. | expand |
On Wed, May 15, 2019 at 6:48 PM Iain Sandoe <iain@sandoe.co.uk> wrote: > > Hi, > > There is at least one assembler that supports ‘setssbsy' but not “endbr*”. > We can catch this by adding "-fcf-protection” to the check_effective_target_cet test. How about adding asm ("endbr") to the source? Uros. > OK for trunk? > Iain > > gcc/testsuite/ > > *lib/target-supports.exp (check_effective_target_cet): Add the > fcf-protection flag to tet CET test. > > diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp > index da132369a4..b7c6bb67ce 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -9212,7 +9212,7 @@ proc check_effective_target_cet { } { > { > asm ("setssbsy"); > } > - } "-O2" ] > + } "-O2 -fcf-protection" ] > } > > # Return 1 if target supports floating point "infinite" > -- > 2.17.1
> On 15 May 2019, at 19:02, Uros Bizjak <ubizjak@gmail.com> wrote: > > On Wed, May 15, 2019 at 6:48 PM Iain Sandoe <iain@sandoe.co.uk> wrote: >> >> Hi, >> >> There is at least one assembler that supports ‘setssbsy' but not “endbr*”. >> We can catch this by adding "-fcf-protection” to the check_effective_target_cet test. > > How about adding asm ("endbr") to the source? it would have to be ‘endbr32’ or ‘endbr64’ I suppose.. I guess #if __LP64__ asm (“endbr64”); #else asm (“endbr32”): #endif would work? AFAICT that’s effectively what adding -fcf-protection does. I’m happy with either. Iain
On Wed, May 15, 2019 at 8:29 PM Iain Sandoe <iain@sandoe.co.uk> wrote: > > > > On 15 May 2019, at 19:02, Uros Bizjak <ubizjak@gmail.com> wrote: > > > > On Wed, May 15, 2019 at 6:48 PM Iain Sandoe <iain@sandoe.co.uk> wrote: > >> > >> Hi, > >> > >> There is at least one assembler that supports ‘setssbsy' but not “endbr*”. > >> We can catch this by adding "-fcf-protection” to the check_effective_target_cet test. > > > > How about adding asm ("endbr") to the source? > > it would have to be ‘endbr32’ or ‘endbr64’ I suppose.. I guess > > #if __LP64__ > asm (“endbr64”); > #else > asm (“endbr32”): > #endif > > would work? > > AFAICT that’s effectively what adding -fcf-protection does. > > I’m happy with either. No need to complicate things too much, your original patch is OK. Thanks, Uros. > Iain > >
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index da132369a4..b7c6bb67ce 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -9212,7 +9212,7 @@ proc check_effective_target_cet { } { { asm ("setssbsy"); } - } "-O2" ] + } "-O2 -fcf-protection" ] } # Return 1 if target supports floating point "infinite"