diff mbox series

[1/1] package/pcsc-lite: compile with -fPIC when BR2_PIC_PIE is set

Message ID 20210928231936.1161-1-ankur.tyagi@gallagher.com
State Rejected
Headers show
Series [1/1] package/pcsc-lite: compile with -fPIC when BR2_PIC_PIE is set | expand

Commit Message

Ankur Tyagi Sept. 28, 2021, 11:19 p.m. UTC
Otherwise build fails with following error:Toolchain wrapper executing: '/tools/arm-unknown-linux-gnueabi/bin//arm-unknown-linux-gnueabi-gcc' '--sysroot' '/home/user/work/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot' '-mabi=aapcs-linux' '-msoft-float' '-marm' '-fstack-protector-strong' '-march=armv5te' '-msoft-float' '-mfpu=vfp' '-mfloat-abi=soft' '-mcpu=arm926ej-s' '-fPIE' '-pie' '-Wl,-z,now' '-Wl,-z,relro' '-Wall' '-fno-common' '-D_LARGEFILE_SOURCE' '-D_LARGEFILE64_SOURCE' '-D_FILE_OFFSET_BITS=64' '-Os' '-g2' '-D_FORTIFY_SOURCE=1' '-o' 'pcsc-wirecheck-gen' 'pcsc-wirecheck-gen.o' '-ldl' '-lrt'
/tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld: .libs/libpcsclite_la-error.o(.text+0x3bc): R_ARM_TLS_LE32 relocation not permitted in shared object
.libs/libpcsclite_la-error.o: In function `pcsc_stringify_error':
/home/user/work/buildroot/output/build/pcsc-lite-1.9.1/src/error.c:98:(.text+0x3bc): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
Makefile:703: recipe for target 'libpcsclite.la' failed
make[4]: *** [libpcsclite.la] Error 1

Signed-off-by: Ankur Tyagi <ankur.tyagi@gallagher.com>
---
 package/pcsc-lite/pcsc-lite.mk | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/package/pcsc-lite/pcsc-lite.mk b/package/pcsc-lite/pcsc-lite.mk
index 94f38b3d85..510ed2c4a0 100644
--- a/package/pcsc-lite/pcsc-lite.mk
+++ b/package/pcsc-lite/pcsc-lite.mk
@@ -44,4 +44,9 @@  ifeq ($(PACKAGE_PCSC_LITE_EMBEDDED),y)
 PCSC_LITE_CONF_OPTS += --enable-embedded
 endif
 
+ifeq ($(BR2_PIC_PIE),y)
+PCSC_LITE_CFLAGS += -fPIC
+PCSC_LITE_CONF_OPTS += CFLAGS="$(PCSC_LITE_CFLAGS)"
+endif
+
 $(eval $(autotools-package))