2017-12-06 14:42:43

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [PATCH 18/36] perf s390: Always build with -fPIC

From: Hendrik Brueckner <[email protected]>

On s390, object files must be compiled with position-indepedent code in
order to be incrementally linked or linked to shared libraries.
Therefore, add -fPIC to the CFLAGS for s390 to ensure each object file
is built properly.

Reported-by: Jonathan Hermann <[email protected]>
Signed-off-by: Hendrik Brueckner <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Thomas Richter <[email protected]>
Cc: linux s390 list <[email protected]>
LPU-Reference: [email protected]
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/Makefile.config | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 2c437baf8364..bf86c09ca889 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -41,6 +41,7 @@ ifeq ($(SRCARCH),x86)
LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
endif
NO_PERF_REGS := 0
+ CFLAGS += -fPIC
endif

ifeq ($(SRCARCH),arm)
--
2.13.6


2017-12-07 08:10:01

by Hendrik Brueckner

[permalink] [raw]
Subject: Re: [PATCH 18/36] perf s390: Always build with -fPIC

Hi Arnaldo,

On Wed, Dec 06, 2017 at 11:40:57AM -0300, Arnaldo Carvalho de Melo wrote:
> From: Hendrik Brueckner <[email protected]>
>
> On s390, object files must be compiled with position-indepedent code in
> order to be incrementally linked or linked to shared libraries.
> Therefore, add -fPIC to the CFLAGS for s390 to ensure each object file
> is built properly.
>
> Reported-by: Jonathan Hermann <[email protected]>
> Signed-off-by: Hendrik Brueckner <[email protected]>
> Cc: Heiko Carstens <[email protected]>
> Cc: Martin Schwidefsky <[email protected]>
> Cc: Thomas Richter <[email protected]>
> Cc: linux s390 list <[email protected]>
> LPU-Reference: [email protected]
> Link: https://lkml.kernel.org/n/[email protected]
> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
> ---
> tools/perf/Makefile.config | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 2c437baf8364..bf86c09ca889 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -41,6 +41,7 @@ ifeq ($(SRCARCH),x86)
> LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
> endif
> NO_PERF_REGS := 0
> + CFLAGS += -fPIC
> endif

I was just rebasing my syscall table work on top of your perf/core tree.
It looks like that there is a significant difference compared to linux
master tree.

With f704ef44602fbf403e6722c7ed13f62d17e8cb20 ("s390/perf: add support for
perf_regs and libdw"), Heiko introduced a change in the Makefile.config:

--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -53,6 +53,10 @@ ifeq ($(SRCARCH),arm64)
LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
endif

+ifeq ($(ARCH),s390)
+ NO_PERF_REGS := 0
+endif
+
ifeq ($(NO_PERF_REGS),0)

The CFLAGS actually should applied to the s390 block and not in the x86
block. Somehow this got messed up with git cherryp-pick / am. So actually,
this should go into the section above:

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index ed65e82..0833d9f 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -55,6 +55,7 @@ endif

ifeq ($(ARCH),s390)
NO_PERF_REGS := 0
+ CFLAGS += -fPIC
endif

ifeq ($(NO_PERF_REGS),0)

Subject: [tip:perf/core] perf s390: Always build with -fPIC

Commit-ID: a9a3f1d18a6c9ccf89728e23474645aa91e2f4f1
Gitweb: https://git.kernel.org/tip/a9a3f1d18a6c9ccf89728e23474645aa91e2f4f1
Author: Hendrik Brueckner <[email protected]>
AuthorDate: Wed, 13 Dec 2017 17:46:54 -0300
Committer: Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 27 Dec 2017 12:15:57 -0300

perf s390: Always build with -fPIC

On s390, object files must be compiled with position-indepedent code in
order to be incrementally linked or linked to shared libraries.

Therefore, add -fPIC to the CFLAGS for s390 to ensure each object file
is built properly.

Reported-by: Jonathan Hermann <[email protected]>
Signed-off-by: Hendrik Brueckner <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Thomas Richter <[email protected]>
Cc: linux s390 list <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/Makefile.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index eb6bd99..f050f38 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -58,7 +58,7 @@ endif
ifeq ($(ARCH),s390)
NO_PERF_REGS := 0
NO_SYSCALL_TABLE := 0
- CFLAGS += -I$(OUTPUT)arch/s390/include/generated
+ CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
endif

ifeq ($(NO_PERF_REGS),0)