toolchain: add BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET option
RFC PATCH 1/2 toolchain: add BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET option
The build of libcap fails for ARC Targets which don't have the ATOMICS_EXT flag set:
configure:5053: checking for cap_set_proc in -lcap
cap_proc.c:(.text+0x78): undefined reference to `__atomic_test_and_set'
configure:5086: result: no
configure:5097: error: libcap support was requested but the library was not found
The patch disables BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET for BR2_arc without BR2_ARC_ATOMIC_EXT.
Fixes:
- http://autobuild.buildroot.net/results/66ee26677777124eafb4740a3c7437e06f704f98
--- toolchain/Config.in | 5 +++++ 1 file changed, 5 insertions(+)
toolchain/Config.in +5 -0
@@ -855,6 +855,11 @@ config BR2_TOOLCHAIN_HAS_SYNC_4 depends on !BR2_sparc depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT) +config BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET + bool + default y + depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT) + # The availability of __sync for 8-byte types on ARM is somewhat # complicated: #
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
RFC PATCH 2/2 package/libcap: fix build failure on ARC targets
Building arp-scan with --with-libcap for the ARC target raises the following error:
configure:5053: checking for cap_set_proc in -lcap
cap_proc.c:(.text+0x78): undefined reference to `__atomic_test_and_set'
configure:5086: result: no
configure:5097: error: libcap support was requested but the library was not found
The patch adds the dependency on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET to libcap.
Additionally, besides libcap, it was necessary to add the dependency on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET to other packages to remove warnings of this type:
WARNING: unmet direct dependencies detected for BR2_PACKAGE_LIBCAP
Depends on [n]: BR2_USE_MMU [=y] && BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET [=n] Selected by [y]:
- BR2_PACKAGE_RNG_TOOLS [=y] && BR2_TOOLCHAIN_HAS_THREADS_NPTL [=y] && BR2_USE_MMU [=y]
WARNING: unmet direct dependencies detected for BR2_PACKAGE_LIBCAP
Depends on [n]: BR2_USE_MMU [=y] && BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET [=n] Selected by [y]:
- BR2_PACKAGE_RNG_TOOLS [=y] && BR2_TOOLCHAIN_HAS_THREADS_NPTL [=y] && BR2_USE_MMU [=y]
Fixes:
- http://autobuild.buildroot.net/results/66ee26677777124eafb4740a3c7437e06f704f98
--- package/bubblewrap/Config.in | 1 + package/cdrkit/Config.in | 1 + package/chrony/Config.in | 1 + package/criu/Config.in | 1 + package/libcap/Config.in | 1 + package/ntpsec/Config.in | 1 + package/proftpd/Config.in | 1 + package/rng-tools/Config.in | 2 +- package/slirp4netns/Config.in | 1 + package/squid/Config.in | 1 + package/systemd/Config.in | 1 + package/vdr/Config.in | 1 + 12 files changed, 12 insertions(+), 1 deletion(-)
package/bubblewrap/Config.in +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_BUBBLEWRAP bool "bubblewrap" depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_LIBCAP help Unprivileged sandbox tool based on Linux namespaces.
package/cdrkit/Config.in +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_CDRKIT bool "cdrkit" depends on BR2_USE_MMU # fork + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap # Needed for libbz select BR2_PACKAGE_BZIP2 select BR2_PACKAGE_LIBCAP
package/chrony/Config.in +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_CHRONY bool "chrony" depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_LIBCAP help Chrony is a pair of programs which are used to maintain the
package/criu/Config.in +1 -0
@@ -26,6 +26,7 @@ config BR2_PACKAGE_CRIU depends on BR2_INSTALL_LIBSTDCPP # protobuf depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf, libnl depends on BR2_USE_WCHAR # libbsd + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_HOST_PYTHON3 select BR2_PACKAGE_HOST_PYTHON3_SSL select BR2_PACKAGE_PROTOBUF
package/libcap/Config.in +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_LIBCAP bool "libcap" depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET help This library implements the user-space interfaces to the POSIX 1003.1e capabilities available in Linux kernels. These
package/ntpsec/Config.in +1 -0
@@ -4,6 +4,7 @@ config BR2_PACKAGE_NTPSEC depends on BR2_USE_WCHAR # python3 depends on BR2_TOOLCHAIN_HAS_THREADS # python3 depends on !BR2_STATIC_LIBS # python3 + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_LIBCAP select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_PYTHON3
package/proftpd/Config.in +1 -0
@@ -12,6 +12,7 @@ if BR2_PACKAGE_PROFTPD config BR2_PACKAGE_PROFTPD_MOD_CAP bool "mod_cap support" + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_LIBCAP help Compile ProFTPD with mod_cap support
package/rng-tools/Config.in +1 -1
@@ -2,7 +2,7 @@ config BR2_PACKAGE_RNG_TOOLS bool "rng-tools" # pthread_setaffinity_np depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL - depends on BR2_USE_MMU # libcap + depends on BR2_USE_MMU && BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL select BR2_PACKAGE_LIBCAP select BR2_PACKAGE_OPENSSL
package/slirp4netns/Config.in +1 -0
@@ -5,6 +5,7 @@ config BR2_PACKAGE_SLIRP4NETNS depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2, slirp depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS # libseccomp depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # libseccomp + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_LIBCAP select BR2_PACKAGE_LIBGLIB2 select BR2_PACKAGE_LIBSECCOMP
package/squid/Config.in +1 -0
@@ -15,6 +15,7 @@ config BR2_PACKAGE_SQUID depends on BR2_HOST_GCC_AT_LEAST_8 # C++17 # needs fork() depends on BR2_USE_MMU + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_LIBCAP select BR2_PACKAGE_LIBTOOL select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
package/systemd/Config.in +1 -0
@@ -25,6 +25,7 @@ menuconfig BR2_PACKAGE_SYSTEMD depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 depends on BR2_HOST_GCC_AT_LEAST_8 # host-systemd + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_HAS_UDEV select BR2_PACKAGE_DBUS if !BR2_PACKAGE_DBUS_BROKER # runtime select BR2_PACKAGE_LIBCAP
package/vdr/Config.in +1 -0
@@ -6,6 +6,7 @@ config BR2_PACKAGE_VDR depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9 depends on BR2_USE_MMU # fork() depends on BR2_USE_WCHAR + depends on BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SET # libcap select BR2_PACKAGE_FONTCONFIG select BR2_PACKAGE_FREETYPE select BR2_PACKAGE_JPEG
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 13 lines · On Thu, 3 Oct 2024 18:26:28 +0200 Dario Binacchi…
The build of libcap fails for ARC Targets which don't have the
ATOMICS_EXTflag set:configure:5053: checking for
cap_set_procin -lcapcap_proc.c:(.text+0x78): undefined reference to `__atomic_test_and_set'
configure:5086: result: no
configure:5097: error: libcap support was requested but the library was not foundThe patch disables
BR2_TOOLCHAIN_HAS_ATOMIC_TEST_AND_SETforBR2_arcwithoutBR2_ARC_ATOMIC_EXT.
Quoted 7 lines
Fixes:
- http://autobuild.buildroot.net/results/66ee26677777124eafb4740a3c7437e06f704f98Signed-off-by Dario Binacchi <[email protected]>--- toolchain/Config.in | 5 +++++ 1 file changed, 5 insertions(+)
Thanks for the patch, but I'm afraid this is not the right approach. We don't want to have BR2_* options for each and every atomic_* function. We already have BR2_TOOLCHAIN_HAS_ATOMIC which serves this purpose. However, what you need to make sure is to link against libatomic. Could you try this instead?
Thanks,
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot