All of lore.kernel.org
 help / color / mirror / Atom feed
* perf build failure on Fedora 27 and linux kernel 4.15.0-rc2
@ 2017-12-07 13:03 Thomas-Mich Richter
  2017-12-07 13:27 ` Thomas-Mich Richter
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas-Mich Richter @ 2017-12-07 13:03 UTC (permalink / raw)
  To: linux-perf-use.

 Maybe its me doing something wrong.
I just installed a KVM virtual machine on my x86 notebook (lenovo P50) with Fedora 27 workstation.
I then downloaded latest 4.15.0rc2 linux kernel and compiled and installed it.
This went fine, then I decided to build the perf tool and got this error:


 GEN      python/perf.so
/usr/bin/ld: perf-in.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: libperf.a(libperf-in.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.perf:507: perf] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile.perf:210: sub-make] Error 2
make: *** [Makefile:70: all] Error 2
[root@localhost-live perf]# 


Any ideas? Is this just on a KVM guest? Thanks for any help.
-- 
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: perf build failure on Fedora 27 and linux kernel 4.15.0-rc2
  2017-12-07 13:03 perf build failure on Fedora 27 and linux kernel 4.15.0-rc2 Thomas-Mich Richter
@ 2017-12-07 13:27 ` Thomas-Mich Richter
  2017-12-07 14:43   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas-Mich Richter @ 2017-12-07 13:27 UTC (permalink / raw)
  To: linux-perf-use.

On 12/07/2017 02:03 PM, Thomas-Mich Richter wrote:
>  Maybe its me doing something wrong.
> I just installed a KVM virtual machine on my x86 notebook (lenovo P50) with Fedora 27 workstation.
> I then downloaded latest 4.15.0rc2 linux kernel and compiled and installed it.
> This went fine, then I decided to build the perf tool and got this error:
> 
> 
>  GEN      python/perf.so
> /usr/bin/ld: perf-in.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: libperf.a(libperf-in.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile.perf:507: perf] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [Makefile.perf:210: sub-make] Error 2
> make: *** [Makefile:70: all] Error 2
> [root@localhost-live perf]# 
> 
> 
> Any ideas? Is this just on a KVM guest? Thanks for any help.
> 

To remedy above build issue, here is the fix:

root@localhost-live perf]# git diff
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index ed65e82f034e..263611caaf7b 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)
[root@localhost-live perf]# 


-- 
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: perf build failure on Fedora 27 and linux kernel 4.15.0-rc2
  2017-12-07 13:27 ` Thomas-Mich Richter
@ 2017-12-07 14:43   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-12-07 14:43 UTC (permalink / raw)
  To: Thomas-Mich Richter; +Cc: linux-perf-use.

Em Thu, Dec 07, 2017 at 02:27:42PM +0100, Thomas-Mich Richter escreveu:
> On 12/07/2017 02:03 PM, Thomas-Mich Richter wrote:
> >  Maybe its me doing something wrong.
> > I just installed a KVM virtual machine on my x86 notebook (lenovo P50) with Fedora 27 workstation.
> > I then downloaded latest 4.15.0rc2 linux kernel and compiled and installed it.
> > This went fine, then I decided to build the perf tool and got this error:
> > 
> > 
> >  GEN      python/perf.so
> > /usr/bin/ld: perf-in.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
> > /usr/bin/ld: libperf.a(libperf-in.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
> > /usr/bin/ld: final link failed: Nonrepresentable section on output
> > collect2: error: ld returned 1 exit status
> > make[2]: *** [Makefile.perf:507: perf] Error 1
> > make[2]: *** Waiting for unfinished jobs....
> > make[1]: *** [Makefile.perf:210: sub-make] Error 2
> > make: *** [Makefile:70: all] Error 2
> > [root@localhost-live perf]# 
> > 
> > 
> > Any ideas? Is this just on a KVM guest? Thanks for any help.
> > 
> 
> To remedy above build issue, here is the fix:
> 
> root@localhost-live perf]# git diff
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index ed65e82f034e..263611caaf7b 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)
> [root@localhost-live perf]# 

This is what is in perf/core:

https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=c6707fdef7e2c1eb5458988b49c33497affdebbf

[acme@jouet linux]$ git log --oneline -1 c6707f
c6707fdef7e2 perf tools: Fix up build in hardnened environments

I'll put it into perf/urgent

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-07 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07 13:03 perf build failure on Fedora 27 and linux kernel 4.15.0-rc2 Thomas-Mich Richter
2017-12-07 13:27 ` Thomas-Mich Richter
2017-12-07 14:43   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.