2015-02-11 17:16:59

by Josh Boyer

[permalink] [raw]
Subject: [PATCH] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check

The man page for pthread_attr_set_affinity_np states that _GNU_SOURCE must
be defined before pthread.h is included in order to get the proper function
declaration. Define this in the Makefile.

Without this defined, the feature check fails on a Fedora system with gcc5
and then the perf build later fails with conflicting prototypes for the
function.

Signed-off-by: Josh Boyer <[email protected]>
---
tools/perf/config/feature-checks/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Full logs at:
http://koji.fedoraproject.org/koji/getfile?taskID=8895543&name=build.log

diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 42ac05aaf8ac..b32ff3372514 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -49,7 +49,7 @@ test-hello.bin:
$(BUILD)

test-pthread-attr-setaffinity-np.bin:
- $(BUILD) -Werror -lpthread
+ $(BUILD) -D_GNU_SOURCE -Werror -lpthread

test-stackprotector-all.bin:
$(BUILD) -Werror -fstack-protector-all
--
2.1.0


2015-02-11 20:39:00

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check

Em Wed, Feb 11, 2015 at 11:24:05AM -0500, Josh Boyer escreveu:
> The man page for pthread_attr_set_affinity_np states that _GNU_SOURCE must
> be defined before pthread.h is included in order to get the proper function
> declaration. Define this in the Makefile.
>
> Without this defined, the feature check fails on a Fedora system with gcc5
> and then the perf build later fails with conflicting prototypes for the
> function.
>
> Signed-off-by: Josh Boyer <[email protected]>
> ---
> tools/perf/config/feature-checks/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied

Subject: [tip:perf/core] perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check

Commit-ID: 39f5704399042fff5f0d5f6af32bbbc3e787a897
Gitweb: http://git.kernel.org/tip/39f5704399042fff5f0d5f6af32bbbc3e787a897
Author: Josh Boyer <[email protected]>
AuthorDate: Wed, 11 Feb 2015 11:24:05 -0500
Committer: Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 11 Feb 2015 17:38:55 -0300

perf tools: Define _GNU_SOURCE on pthread_attr_setaffinity_np feature check

The man page for pthread_attr_set_affinity_np states that _GNU_SOURCE
must be defined before pthread.h is included in order to get the proper
function declaration. Define this in the Makefile.

Without this defined, the feature check fails on a Fedora system with
gcc5 and then the perf build later fails with conflicting prototypes for
the function.

Signed-off-by: Josh Boyer <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Vineet Gupta <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/config/feature-checks/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 42ac05a..b32ff33 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -49,7 +49,7 @@ test-hello.bin:
$(BUILD)

test-pthread-attr-setaffinity-np.bin:
- $(BUILD) -Werror -lpthread
+ $(BUILD) -D_GNU_SOURCE -Werror -lpthread

test-stackprotector-all.bin:
$(BUILD) -Werror -fstack-protector-all