Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1400737 > unrolled thread

[PATCH] tools: testing: define the _GNU_SOURCE macro

Started byMuhammad Falak R Wani <falakreyaz@gmail.com>
First post2016-05-13 14:10 +0200
Last post2016-05-16 18:20 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] tools: testing: define the _GNU_SOURCE macro Muhammad Falak R Wani <falakreyaz@gmail.com> - 2016-05-13 14:10 +0200
    Re: [PATCH] tools: testing: define the _GNU_SOURCE macro Shuah Khan <shuahkh@osg.samsung.com> - 2016-05-16 15:30 +0200
      Re: [PATCH] tools: testing: define the _GNU_SOURCE macro Muhammad Falak R Wani <falakreyaz@gmail.com> - 2016-05-16 16:10 +0200
        Re: [PATCH] tools: testing: define the _GNU_SOURCE macro Shuah Khan <shuahkh@osg.samsung.com> - 2016-05-16 18:20 +0200

#1400737 — [PATCH] tools: testing: define the _GNU_SOURCE macro

FromMuhammad Falak R Wani <falakreyaz@gmail.com>
Date2016-05-13 14:10 +0200
Subject[PATCH] tools: testing: define the _GNU_SOURCE macro
Message-ID<ryk4O-2Yo-7@gated-at.bofh.it>
Add the macro _GNU_SOURCE, so that compilation does not terminate.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
 tools/testing/selftests/intel_pstate/run.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index bdaf37e..7868c10 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -32,7 +32,7 @@ EVALUATE_ONLY=0
 max_cpus=$(($(nproc)-1))
 
 # compile programs
-gcc -o aperf aperf.c -lm
+gcc aperf.c -Wall -D_GNU_SOURCE -o aperf  -lm
 [ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1
 gcc -o msr msr.c -lm
 [ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1
-- 
1.9.1

[toc] | [next] | [standalone]


#1401494

FromShuah Khan <shuahkh@osg.samsung.com>
Date2016-05-16 15:30 +0200
Message-ID<rzqKR-7Ac-5@gated-at.bofh.it>
In reply to#1400737
On 05/13/2016 06:05 AM, Muhammad Falak R Wani wrote:
> Add the macro _GNU_SOURCE, so that compilation does not terminate.

What error are you seeing? Could you please send the compilation
error log.

thanks,
-- Shuah
> 
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> ---
>  tools/testing/selftests/intel_pstate/run.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
> index bdaf37e..7868c10 100755
> --- a/tools/testing/selftests/intel_pstate/run.sh
> +++ b/tools/testing/selftests/intel_pstate/run.sh
> @@ -32,7 +32,7 @@ EVALUATE_ONLY=0
>  max_cpus=$(($(nproc)-1))
>  
>  # compile programs
> -gcc -o aperf aperf.c -lm
> +gcc aperf.c -Wall -D_GNU_SOURCE -o aperf  -lm
>  [ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1
>  gcc -o msr msr.c -lm
>  [ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1
> 

[toc] | [prev] | [next] | [standalone]


#1401515

FromMuhammad Falak R Wani <falakreyaz@gmail.com>
Date2016-05-16 16:10 +0200
Message-ID<rzrnz-82y-5@gated-at.bofh.it>
In reply to#1401494
On Mon, May 16, 2016 at 07:27:25AM -0600, Shuah Khan wrote:
> On 05/13/2016 06:05 AM, Muhammad Falak R Wani wrote:
> > Add the macro _GNU_SOURCE, so that compilation does not terminate.
> 
> What error are you seeing? Could you please send the compilation
> error log.
> 
> thanks,
> -- Shuah
> > 
> > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> > ---
> >  tools/testing/selftests/intel_pstate/run.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
> > index bdaf37e..7868c10 100755
> > --- a/tools/testing/selftests/intel_pstate/run.sh
> > +++ b/tools/testing/selftests/intel_pstate/run.sh
> > @@ -32,7 +32,7 @@ EVALUATE_ONLY=0
> >  max_cpus=$(($(nproc)-1))
> >  
> >  # compile programs
> > -gcc -o aperf aperf.c -lm
> > +gcc aperf.c -Wall -D_GNU_SOURCE -o aperf  -lm
> >  [ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1
> >  gcc -o msr msr.c -lm
> >  [ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1
> > 
> 
When I try to run "run.sh", I get the following linker error
------

mfrw@kp:~/kp/tools/testing/selftests/intel_pstate$ ./run.sh 
/tmp/ccVLsFVk.o: In function `main':
aperf.c:(.text+0x12e): undefined reference to `CPU_ZERO'
aperf.c:(.text+0x14a): undefined reference to `CPU_SET'
collect2: error: ld returned 1 exit status
Problem compiling aperf.c.

------

The root cause of the problem is, we haven't defined a macro
_GNU_SOURCE, which is necessary for CPU_ZERO, CPU_SET.
After adding the appropriate macro, it compiles without
any error.

[toc] | [prev] | [next] | [standalone]


#1401604

FromShuah Khan <shuahkh@osg.samsung.com>
Date2016-05-16 18:20 +0200
Message-ID<rztpo-Ox-19@gated-at.bofh.it>
In reply to#1401515
On 05/16/2016 08:02 AM, Muhammad Falak R Wani wrote:
> On Mon, May 16, 2016 at 07:27:25AM -0600, Shuah Khan wrote:
>> On 05/13/2016 06:05 AM, Muhammad Falak R Wani wrote:
>>> Add the macro _GNU_SOURCE, so that compilation does not terminate.
>>
>> What error are you seeing? Could you please send the compilation
>> error log.
>>
>> thanks,
>> -- Shuah

Applied to linux-kselftest next fgor 4.7-rc1 with fixed up changelog
to include why the change is needed.

thanks,
-- Shuah

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web