From bd6099b1b868b9dcd02c82a6224f138da9382084 Mon Sep 17 00:00:00 2001 From: Tafil Avdyli Date: Sat, 24 Jan 2026 21:54:21 +0100 Subject: [PATCH] CMakeLists: remove linking to librt This is not required anymore. Quoting glibc 2.30 NEWS: > * The functions clock_gettime, clock_getres, clock_settime, > clock_getcpuclockid, clock_nanosleep were removed from the librt library > for new applications (on architectures which had them). Instead, the > definitions in libc will be used automatically, which have been available > since glibc 2.17. When building in a BitBake devshell as shared library and inspecting the resulting .so file with readelf reveals that librt.so is never linked to: 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x0000000000000001 (NEEDED) Shared library: [ld-linux-aarch64.so.1] 0x000000000000000e (SONAME) Library soname: [liblibnfc_nci.so] This will also fix do_package_qa: QA Issue: File /usr/lib/cmake/libnfc-nci/libnfc-nci-targets.cmake in package libnfc-nci-dev contains reference to TMPDIR [buildpaths] in yocto builds since it contained a full path to librt.so. Signed-off-by: Tafil Avdyli --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f6aea0..e432b1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ find_package(everest-cmake 0.1 REQUIRED PATHS ../everest-cmake ) find_package(Threads REQUIRED) -find_library(LIBRT rt) option(LIBNFCNCI_BUILD_EXAMPLES "enable building of examples" OFF) option(LIBNFCNCI_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT}) @@ -261,7 +260,6 @@ target_include_directories(libnfc_nci target_link_libraries(libnfc_nci PRIVATE Threads::Threads - ${LIBRT} ) #