* [PATCH] perf s390: always build with -fPIC
@ 2017-11-30 8:49 Hendrik Brueckner
2017-12-01 2:17 ` Namhyung Kim
0 siblings, 1 reply; 3+ messages in thread
From: Hendrik Brueckner @ 2017-11-30 8:49 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Linux perf users list, Linux s390 list, Martin Schwidefsky,
Heiko Carstens, Thomas Richter, jonathan.hermann
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 <jonathan.hermann@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
---
tools/perf/Makefile.config | 1 +
1 file changed, 1 insertion(+)
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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf s390: always build with -fPIC
2017-11-30 8:49 [PATCH] perf s390: always build with -fPIC Hendrik Brueckner
@ 2017-12-01 2:17 ` Namhyung Kim
2017-12-01 14:12 ` Hendrik Brueckner
0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2017-12-01 2:17 UTC (permalink / raw)
To: Hendrik Brueckner
Cc: Arnaldo Carvalho de Melo, Linux perf users list, Linux s390 list,
Martin Schwidefsky, Heiko Carstens, Thomas Richter,
jonathan.hermann, kernel-team, jolsa
(+ Jiri)
Hello,
On Thu, Nov 30, 2017 at 09:49:25AM +0100, Hendrik Brueckner wrote:
> 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.
Could you please tell me what was the actual problem? I guess this is
somewhat related to the Jiri's Fedora build fix.
Thanks,
Namhyung
>
> Reported-by: Jonathan Hermann <jonathan.hermann@de.ibm.com>
> Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
> ---
> tools/perf/Makefile.config | 1 +
> 1 file changed, 1 insertion(+)
>
> 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)
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf s390: always build with -fPIC
2017-12-01 2:17 ` Namhyung Kim
@ 2017-12-01 14:12 ` Hendrik Brueckner
0 siblings, 0 replies; 3+ messages in thread
From: Hendrik Brueckner @ 2017-12-01 14:12 UTC (permalink / raw)
To: Namhyung Kim
Cc: Hendrik Brueckner, Arnaldo Carvalho de Melo,
Linux perf users list, Linux s390 list, Martin Schwidefsky,
Heiko Carstens, Thomas Richter, jonathan.hermann, kernel-team,
jolsa
Hi Namhyung,
On Fri, Dec 01, 2017 at 11:17:09AM +0900, Namhyung Kim wrote:
> On Thu, Nov 30, 2017 at 09:49:25AM +0100, Hendrik Brueckner wrote:
> > 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.
>
> Could you please tell me what was the actual problem? I guess this is
> somewhat related to the Jiri's Fedora build fix.
Building, linking of perf did not work (I think it was on a Fedora 27)
resulting in an error message like:
/usr/bin/ld: perf-in.o: `__printf_chk@@GLIBC_2.4' non-PLT reloc for symbol
defined in shared library and accessed from executable (rebuild file with
-fPIC ?)
/usr/bin/ld: final link failed: Bad value
On s390, objects must be compiled with -fPIC when used for shared object
or position-indendepent executables (PIE). In doubt, it is better to
build with -fPIC (there are no performance degration).
Thanks and kind regards,
Hendrik
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-01 14:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-30 8:49 [PATCH] perf s390: always build with -fPIC Hendrik Brueckner
2017-12-01 2:17 ` Namhyung Kim
2017-12-01 14:12 ` Hendrik Brueckner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).