mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
413c68d120
Update CMake to 3.15.1 Refresh patches Remove inofficial fossies.org and replace with GitHub (link on official site) Remove 150-C-feature-checks-Match-warnings-more-strictly.patch as it's a no longer needed backport from upstream. Disable ccache if GCC is 4.8, 4.9 or 5.X to avoid build failures. Reference: https://github.com/openwrt/openwrt/pull/1929 Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
38 lines
1.4 KiB
Diff
38 lines
1.4 KiB
Diff
From: Jo-Philipp Wich <jo@mein.io>
|
|
Date: Wed, 11 Jan 2017 03:36:04 +0100
|
|
Subject: [PATCH] cmcurl: link librt
|
|
|
|
When cmake is linked against LibreSSL, there might be an indirect
|
|
dependency on librt on certain systems if LibreSSL's libcrypto uses
|
|
clock_gettime() from librt:
|
|
|
|
[ 28%] Linking C executable LIBCURL
|
|
.../lib/libcrypto.a(getentropy_linux.o): In function `getentropy_fallback':
|
|
getentropy_linux.c:(.text+0x16d): undefined reference to `clock_gettime'
|
|
getentropy_linux.c:(.text+0x412): undefined reference to `clock_gettime'
|
|
collect2: error: ld returned 1 exit status
|
|
make[5]: *** [Utilities/cmcurl/LIBCURL] Error 1
|
|
|
|
Modify the cmcurl CMakeLists.txt to check for clock_gettime() in librt
|
|
and unconditionally link the rt library when the symbol is found.
|
|
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
---
|
|
--- a/Utilities/cmcurl/CMakeLists.txt
|
|
+++ b/Utilities/cmcurl/CMakeLists.txt
|
|
@@ -453,6 +453,14 @@ if(CMAKE_USE_OPENSSL)
|
|
set(USE_OPENSSL ON)
|
|
set(HAVE_LIBCRYPTO ON)
|
|
set(HAVE_LIBSSL ON)
|
|
+ check_library_exists("rt" clock_gettime "" HAVE_LIBRT)
|
|
+ if(HAVE_LIBRT)
|
|
+ list(APPEND OPENSSL_LIBRARIES rt)
|
|
+ endif()
|
|
+ check_library_exists("pthread" pthread_once "" HAVE_PTHREAD)
|
|
+ if(HAVE_PTHREAD)
|
|
+ list(APPEND OPENSSL_LIBRARIES pthread)
|
|
+ endif()
|
|
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
|
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
|
|