diff --git a/cmake/platforms/LinuxAArch64.cmake b/cmake/platforms/LinuxAArch64.cmake --- a/cmake/platforms/LinuxAArch64.cmake +++ b/cmake/platforms/LinuxAArch64.cmake @@ -9,7 +9,10 @@ # Target environment on the build host system # Set 1st to directory with the cross compiler's C/C++ headers/libs -set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}") +set(CMAKE_FIND_ROOT_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}" + "/usr/${TOOLCHAIN_PREFIX}" +) # We also may have built dependencies for the native platform. set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}/native") diff --git a/cmake/platforms/LinuxARM.cmake b/cmake/platforms/LinuxARM.cmake --- a/cmake/platforms/LinuxARM.cmake +++ b/cmake/platforms/LinuxARM.cmake @@ -9,7 +9,10 @@ # Target environment on the build host system # Set 1st to directory with the cross compiler's C/C++ headers/libs -set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}") +set(CMAKE_FIND_ROOT_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}" + "/usr/${TOOLCHAIN_PREFIX}" +) # We also may have built dependencies for the native platform. set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/${TOOLCHAIN_PREFIX}/native") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -222,7 +222,7 @@ if(ENABLE_GLIBC_BACK_COMPAT) # glibc absorbed clock_gettime in 2.17. librt (its previous location) is # safe to link in anyway for back-compat. - find_library(RT_LIBRARY rt) + find_library(RT_LIBRARY rt CMAKE_FIND_ROOT_PATH_BOTH) target_link_libraries(util ${RT_LIBRARY}) #__fdelt_chk's params and return type have changed from long unsigned int to