All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] package/libusb: compile with -fPIC when BR2_PIC_PIE is set
@ 2021-09-28 23:08 Ankur Tyagi
  0 siblings, 0 replies; only message in thread
From: Ankur Tyagi @ 2021-09-28 23:08 UTC (permalink / raw)
  To: buildroot; +Cc: Ankur Tyagi, Zoltan Gyarmati

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' '-Wl,-z,now' '-Wl,-z,relro' '-shared' '.libs/core.o' '.libs/descriptor.o' '.libs/hotplug.o' '.libs/io.o' '.libs/strerror.o' '.libs/sync.o' 'os/.libs/events_posix.o' 'os/.libs/threads_posix.o' 'os/.libs/linux_usbfs.o' 'os/.libs/linux_netlink.o' '-lpthread' '-pthread' '-Os' '-g2' '-pthread' '-Wl,-soname' '-Wl,libusb-1.0.so.0' '-o' '.libs/libusb-1.0.so.0.3.0'
/tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/7.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld: os/.libs/threads_posix.o(.text+0x284): R_ARM_TLS_LE32 relocation not permitted in shared object
os/.libs/threads_posix.o: In function `usbi_get_tid':
/home/user/work/buildroot/output/build/libusb-1.0.24/libusb/os/threads_posix.c:129:(.text+0x284): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
Makefile:584: recipe for target 'libusb-1.0.la' failed
make[4]: *** [libusb-1.0.la] Error 1

Signed-off-by: Ankur Tyagi <ankur.tyagi@gallagher.com>

---
Changes v1 -> v2:
- Removed wrong config option

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

diff --git a/package/libusb/libusb.mk b/package/libusb/libusb.mk
index 28efcadefc..2c07a0e2dc 100644
--- a/package/libusb/libusb.mk
+++ b/package/libusb/libusb.mk
@@ -34,5 +34,10 @@ endef
 LIBUSB_POST_INSTALL_TARGET_HOOKS += LIBUSB_INSTALL_TARGET_EXAMPLES
 endif
 
+ifeq ($(BR2_PIC_PIE),y)
+LIBUSB_CFLAGS += -fPIC
+LIBUSB_CONF_OPTS += CFLAGS="$(LIBUSB_CFLAGS)"
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
2.25.1

###########################################################################
This email is confidential and may contain information subject to legal 
privilege.  If you are not the intended recipient please advise us of our
error by return e-mail then delete this email and any attached files.  
You may not copy, disclose or use the contents in any way.  

The views expressed in this email may not be those of Gallagher Group 
Ltd or subsidiary companies thereof.
###########################################################################
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-28 23:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 23:08 [Buildroot] [PATCH v2 1/1] package/libusb: compile with -fPIC when BR2_PIC_PIE is set Ankur Tyagi

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.