packaging: Add -fPIC flag to perf build cflags 27/216727/1 submit/tizen/20191031.023155
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 31 Oct 2019 03:42:36 +0000 (12:42 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 31 Oct 2019 07:50:13 +0000 (16:50 +0900)
Current Tizen build environment requires -fPIC with relocation
and without the flag, there is build error for perf like below:

  armv7l
    armv7l-tizen-linux-gnueabi/bin/ld: perf-in.o: relocation R_ARM_MOVW_ABS_NC against `__stack_chk_guard' can not be used when making a shared object; recompile with -fPIC

  aarch64
    aarch64-tizen-linux-gnu/bin/ld: perf-in.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
    aarch64-tizen-linux-gnu/bin/ld: perf-in.o(.text+0x4): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'

Add -fPIC flag to perf build.

Change-Id: Icca04801698c88180dfde493a3ef92e5c01612b5
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
packaging/linux-rpi3.spec

index ed7aae01c0be7d852098ca6e5028bd56cbe7a6b0..71a40a51792e6f153cef858e83af891373e2f57e 100644 (file)
@@ -97,7 +97,7 @@ make modules %{?_smp_mflags}
 
 # 1-5. Build perf
 make -s -C tools/lib/traceevent %{?_smp_mflags}
-make -s -C tools/perf %{?_smp_mflags}
+make -s -C tools/perf EXTRA_CFLAGS=-fPIC %{?_smp_mflags}
 
 %install
 QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT