package/libusb: add -latomic to libusb-1.0.pc if needed
libusb unconditionally uses atomic since version 1.0.25 and1a08aa84d9
resulting in the following build failure with pcsc-lite or openocd since commitaad609936f
: checking for libusb_init... configure: error: libusb not found, use ./configure LIBUSB_LIBS=... /home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libusb-1.0.so: undefined reference to `__atomic_fetch_add_4' collect2: error: ld returned 1 exit status Fixes: - http://autobuild.buildroot.org/results/4a27a769bb3cdf78643c3049b87d792178d6512c - http://autobuild.buildroot.org/results/b59b30cbe0e27399db5c7586f369104e68a1589a Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
parent
33ea4d7887
commit
d661740201
@ -0,0 +1,39 @@
|
||||
From 0b857081d687f7ee41483a3d7e9846af44a5ba7d Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Mon, 7 Feb 2022 11:55:54 +0100
|
||||
Subject: [PATCH] configure.ac: link with -latomic if needed
|
||||
|
||||
libusb unconditionally uses atomic_fetch_add since version 1.0.25 and
|
||||
https://github.com/libusb/libusb/commit/1a08aa84d96397a3840a75abe66051f5360c2c84
|
||||
https://github.com/libusb/libusb/commit/eed8a371ea53939096ba94d44001e0637d042572
|
||||
but some architectures (e.g. sparc) needs to link with -latomic to be
|
||||
able to use it. So check if -latomic is needed and update libusb-1.0.pc
|
||||
accordingly to avoid the following build failure with openocd:
|
||||
|
||||
/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libusb-1.0.so: undefined reference to `__atomic_fetch_add_4'
|
||||
collect2: error: ld returned 1 exit status
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.org/results/4a27a769bb3cdf78643c3049b87d792178d6512c
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
[Upstream status: https://github.com/libusb/libusb/pull/1064]
|
||||
---
|
||||
configure.ac | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f6cf2f9..002bcf6 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -152,6 +152,7 @@ if test "x$platform" = xposix; then
|
||||
AC_SEARCH_LIBS([pthread_create], [pthread],
|
||||
[test "x$ac_cv_search_pthread_create" != "xnone required" && AC_SUBST(THREAD_LIBS, [-lpthread])],
|
||||
[], [])
|
||||
+ AC_SEARCH_LIBS([__atomic_fetch_add_4], [atomic])
|
||||
elif test "x$platform" = xwindows; then
|
||||
AC_DEFINE([PLATFORM_WINDOWS], [1], [Define to 1 if compiling for a Windows platform.])
|
||||
else
|
||||
--
|
||||
2.34.1
|
||||
|
@ -13,6 +13,8 @@ LIBUSB_LICENSE_FILES = COPYING
|
||||
LIBUSB_CPE_ID_VENDOR = libusb
|
||||
LIBUSB_DEPENDENCIES = host-pkgconf
|
||||
LIBUSB_INSTALL_STAGING = YES
|
||||
# We're patching configure.ac
|
||||
LIBUSB_AUTORECONF = YES
|
||||
|
||||
# Avoid the discovery of udev for the host variant
|
||||
HOST_LIBUSB_CONF_OPTS = --disable-udev
|
||||
|
Loading…
Reference in New Issue
Block a user