From 742b66c3007c783d8b5ab2043dbbd07cdd6d2a4c Mon Sep 17 00:00:00 2001 From: Kamay Xutax Date: Sun, 5 Feb 2023 16:07:37 +0100 Subject: [PATCH] fix openwrt mips32 static build libunbound needs to link against libatomic because of openssl crypto (says EVP_sha256 missing otherwise in libunbound during build) --- cmake/StaticBuild.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake index 5f0ecf5c7..5663fa66d 100644 --- a/cmake/StaticBuild.cmake +++ b/cmake/StaticBuild.cmake @@ -242,6 +242,7 @@ set(openssl_system_env "") set(openssl_arch "") set(openssl_configure_command ./config) set(openssl_flags "CFLAGS=${deps_CFLAGS}") +set(unbound_ldflags "") if(CMAKE_CROSSCOMPILING) if(ARCH_TRIPLET STREQUAL x86_64-w64-mingw32) set(openssl_arch mingw64) @@ -258,6 +259,9 @@ if(CMAKE_CROSSCOMPILING) set(openssl_arch linux-mips64) elseif(ARCH_TRIPLET STREQUAL mips-linux-gnu) set(openssl_arch linux-mips32) + elseif(ARCH_TRIPLET STREQUAL mips-openwrt-linux) + set(unbound_ldflags "-latomic") + set(openssl_arch linux-mips32) elseif(ARCH_TRIPLET STREQUAL mipsel-linux-gnu) set(openssl_arch linux-mips) elseif(ARCH_TRIPLET STREQUAL aarch64-linux-gnu OR ARCH_TRIPLET STREQUAL aarch64-openwrt-linux-musl) @@ -319,7 +323,7 @@ build_external(unbound --enable-static --with-libunbound-only --with-pic --$,enable,disable>-flto --with-ssl=${DEPS_DESTDIR} --with-libexpat=${DEPS_DESTDIR} - "CC=${deps_cc}" "CFLAGS=${deps_CFLAGS}" + "CC=${deps_cc}" "CFLAGS=${deps_CFLAGS}" "LDFLAGS=${unbound_ldflags}" ) add_static_target(libunbound unbound_external libunbound.a) if(NOT WIN32)