diff mbox

[PING] Add direct support for Linux kernel __fentry__ patching

Message ID 20140927153547.GH2905@two.firstfloor.org
State New
Headers show

Commit Message

Andi Kleen Sept. 27, 2014, 3:35 p.m. UTC
On Sat, Sep 27, 2014 at 01:21:29PM +0200, Dominique Dhumieres wrote:
> The new tests fail on darwin:
> 
> /opt/gcc/work/gcc/testsuite/gcc.target/i386/nop-mcount.c:1:0: error: -mnop-mcount is not implemented for -fPIC
> 
> and gcc.target/i386/record-mcount.c fails because mcount_loc is not found in the assembly.

Sorry. Here's a patch. I'll install it as obvious unless someone
complains. Also I hope it's the last mcount patch for now :-)

-Andi

Comments

Dominique d'Humières Sept. 27, 2014, 4:55 p.m. UTC | #1
Le 27 sept. 2014 à 18:45, Dominique d'Humières <dominiq@lps.ens.fr> a écrit :

> I think the patch for gcc.target/i386/nop-mcount.c should be
> 
> --- ../_clean/gcc/testsuite/gcc.target/i386/nop-mcount.c	2014-09-26 23:29:45.000000000 +0200
> +++ gcc/testsuite/gcc.target/i386/nop-mcount.c	2014-09-27 18:43:40.000000000 +0200
> @@ -1,5 +1,5 @@
>  /* Test -mnop-mcount */
> -/* { dg-do compile } */
> +/* { dg-do compile { target { *-*-linux* && nonpic } } } */
>  /* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */
>  /* { dg-final { scan-assembler-not "__fentry__" } } */
>  /* Origin: Andi Kleen */
> 
> Dominique
> 
> Le 27 sept. 2014 à 17:35, Andi Kleen <andi@firstfloor.org> a écrit :
> 
>> On Sat, Sep 27, 2014 at 01:21:29PM +0200, Dominique Dhumieres wrote:
>>> The new tests fail on darwin:
>>> 
>>> /opt/gcc/work/gcc/testsuite/gcc.target/i386/nop-mcount.c:1:0: error: -mnop-mcount is not implemented for -fPIC
>>> 
>>> and gcc.target/i386/record-mcount.c fails because mcount_loc is not found in the assembly.
>> 
>> Sorry. Here's a patch. I'll install it as obvious unless someone
>> complains. Also I hope it's the last mcount patch for now :-)
>> 
>> -Andi
>> 
>> diff --git a/gcc/testsuite/gcc.target/i386/nop-mcount.c b/gcc/testsuite/gcc.target/i386/nop-mcount.c
>> index 2592231..942cae0 100644
>> --- a/gcc/testsuite/gcc.target/i386/nop-mcount.c
>> +++ b/gcc/testsuite/gcc.target/i386/nop-mcount.c
>> @@ -1,5 +1,5 @@
>> /* Test -mnop-mcount */
>> -/* { dg-do compile } */
>> +/* { dg-do compile { target *-*-linux* } } */
>> /* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */
>> /* { dg-final { scan-assembler-not "__fentry__" } } */
>> /* Origin: Andi Kleen */
>> diff --git a/gcc/testsuite/gcc.target/i386/record-mcount.c b/gcc/testsuite/gcc.target/i386/record-mcount.c
>> index dae413e..26b0dbc 100644
>> --- a/gcc/testsuite/gcc.target/i386/record-mcount.c
>> +++ b/gcc/testsuite/gcc.target/i386/record-mcount.c
>> @@ -1,5 +1,5 @@
>> /* Test -mrecord-mcount */
>> -/* { dg-do compile } */
>> +/* { dg-do compile { target *-*-linux* } } */
>> /* { dg-options "-pg -mrecord-mcount" } */
>> /* { dg-final { scan-assembler "mcount_loc" } } */
>> /* Origin: Andi Kleen */
>
Andi Kleen Sept. 27, 2014, 5:01 p.m. UTC | #2
On Sat, Sep 27, 2014 at 06:45:21PM +0200, Dominique d'Humières wrote:
> I think the patch for gcc.target/i386/nop-mcount.c should be

True. Thanks.

-Andi
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/i386/nop-mcount.c b/gcc/testsuite/gcc.target/i386/nop-mcount.c
index 2592231..942cae0 100644
--- a/gcc/testsuite/gcc.target/i386/nop-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/nop-mcount.c
@@ -1,5 +1,5 @@ 
 /* Test -mnop-mcount */
-/* { dg-do compile } */
+/* { dg-do compile { target *-*-linux* } } */
 /* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */
 /* { dg-final { scan-assembler-not "__fentry__" } } */
 /* Origin: Andi Kleen */
diff --git a/gcc/testsuite/gcc.target/i386/record-mcount.c b/gcc/testsuite/gcc.target/i386/record-mcount.c
index dae413e..26b0dbc 100644
--- a/gcc/testsuite/gcc.target/i386/record-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/record-mcount.c
@@ -1,5 +1,5 @@ 
 /* Test -mrecord-mcount */
-/* { dg-do compile } */
+/* { dg-do compile { target *-*-linux* } } */
 /* { dg-options "-pg -mrecord-mcount" } */
 /* { dg-final { scan-assembler "mcount_loc" } } */
 /* Origin: Andi Kleen */