From patchwork Tue Oct 26 19:53:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1546614 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XHqndhSs; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hf2cS0p1qz9sRN for ; Wed, 27 Oct 2021 06:55:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4FE6540533; Tue, 26 Oct 2021 19:55:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9l5fqxgN7439; Tue, 26 Oct 2021 19:55:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 594B740535; Tue, 26 Oct 2021 19:55:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 970A61BF3CD for ; Tue, 26 Oct 2021 19:55:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 86040606AF for ; Tue, 26 Oct 2021 19:55:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AtzI85HH4TqO for ; Tue, 26 Oct 2021 19:55:28 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by smtp3.osuosl.org (Postfix) with ESMTPS id 33C6560680 for ; Tue, 26 Oct 2021 19:55:28 +0000 (UTC) Received: by mail-wr1-x436.google.com with SMTP id e12so233270wra.4 for ; Tue, 26 Oct 2021 12:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Cg/M26l0U8NejXoPnKX9INbg/ULhgrODEUyIxfQDTZo=; b=XHqndhSsBVMiAPJzOourzOkv5uZB3cYV5EjagwCr+NMxvaFa1ba6HU5r48E/3h+cbv 9azrQQCOhW07pne2xL6fUCfole31Q5OPux8QMxtMFLDatkngSKnXX8OfOgS5R50G5ya7 06L7RshRlPdNcD2ZQVmz2Mvzz+Bwe8NE9y5WYIFkynJMtNpDOUBPVonlmGgMUMgNHPsV 0GukK0vm5AIelXUrgj9f0+/GFCtuqwuL5b1IZb4j4DF2n5AUbcR+LWWSPh92502VfZu6 KTBg5QhDPjTuA7yUmad84tZpar+jAQQJUXAYa9YN6XfThtgiQnX2Ac5Utg2wQEUL0Eq4 MGZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Cg/M26l0U8NejXoPnKX9INbg/ULhgrODEUyIxfQDTZo=; b=HR6vcpjxEbprXftMMVIIiCg1dB2Gp0+LT0o+JYJ8fkm+oOq0w61njkupIZfbamFgPC X3F7YUH+U9gdqZNM6jJM9LoRFhgZ29MA4Ln4Zg5ZDWGm98ELhkQU0Ev1AgRgzUHyqryY l8RXlupKEUkMaaWH3CEiWU63S2gpcReMzuJmBP+sisudP/E3vmIYPsyGIL71QzhJmKpr 7eZxtX7kmTgA8E7SAZd2jiTxR2vX+0z3WY03dTvwACJFmqcsjq4wocFM9GRECjtmBuXB Bw9Q4/QB9Fy/SGJQW8vcb0g+5P4LUUH1NfOXVnDQiGQSjoVtq6+zvcgHaRRDGpkCUvmx mi7A== X-Gm-Message-State: AOAM530bKlizFgG7cWAjd4EmsMOjBII+yP4SxsT2ltNAPlu3aPcawO/I pB/M5J9ht4UwLNz6oxPJvMTaZ0OeNUU= X-Google-Smtp-Source: ABdhPJznSgIyWG2lCinAehISl0IdA5f4Ix2Kx1DKxSZzt/BMbzYjorfmUruw0UNMRdwRwmwoYlqQHg== X-Received: by 2002:a5d:6c65:: with SMTP id r5mr34412148wrz.26.1635278126129; Tue, 26 Oct 2021 12:55:26 -0700 (PDT) Received: from kali.home (lfbn-ren-1-1732-95.w86-253.abo.wanadoo.fr. [86.253.44.95]) by smtp.gmail.com with ESMTPSA id j20sm1344404wmp.27.2021.10.26.12.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 12:55:25 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Tue, 26 Oct 2021 21:53:53 +0200 Message-Id: <20211026195353.4055090-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/log4cxx: needs boost or C++17 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" log4cxx needs boost or C++17 since bump to version 0.12.0 in commit 83a0e8dea203dc37c6c207a36b3f46160578dcc2 (see https://github.com/apache/logging-log4cxx/commit/2ab3b78b9aa36524287764a129fa6ad96e89ca02): In file included from /home/buildroot/autobuild/instance-3/output-1/build/log4cxx-0.12.0/src/main/cpp/action.cpp:18:0: /home/buildroot/autobuild/instance-3/output-1/build/log4cxx-0.12.0/src/main/include/log4cxx/rolling/action.h:51:8: error: 'mutex' in namespace 'std' does not name a type std::mutex mutex; ^ Fixes: - http://autobuild.buildroot.org/results/71e/71eb8c4f69a2505242b3224bd79f4a96eb3b68a4/build-end.log Signed-off-by: Fabrice Fontaine --- package/log4cxx/0001-LOGCXX-528.patch | 189 ++++++++++++++++++++++++++ package/log4cxx/Config.in | 14 ++ package/log4cxx/log4cxx.mk | 4 + 3 files changed, 207 insertions(+) create mode 100644 package/log4cxx/0001-LOGCXX-528.patch diff --git a/package/log4cxx/0001-LOGCXX-528.patch b/package/log4cxx/0001-LOGCXX-528.patch new file mode 100644 index 0000000000..d1d3189024 --- /dev/null +++ b/package/log4cxx/0001-LOGCXX-528.patch @@ -0,0 +1,189 @@ +From 249dd85494a430d95fd69d89f42b02fd950cda51 Mon Sep 17 00:00:00 2001 +From: Robert Middleton +Date: Thu, 22 Jul 2021 15:27:50 -0700 +Subject: [PATCH] LOGCXX-528 (#66) + +Fixes for checking that C++11 is available. Fix for older compilers. + +[Retrieved from: +https://github.com/apache/logging-log4cxx/commit/249dd85494a430d95fd69d89f42b02fd950cda51] +Signed-off-by: Fabrice Fontaine +--- + CMakeLists.txt | 10 +++++++++ + src/cmake/boost-fallback/boost-fallback.cmake | 21 ++++++++++--------- + src/main/cpp/hierarchy.cpp | 4 ++-- + src/main/include/CMakeLists.txt | 2 +- + .../log4cxx/helpers/appenderattachableimpl.h | 1 + + .../include/log4cxx/helpers/aprinitializer.h | 1 + + src/main/include/log4cxx/helpers/loglog.h | 1 + + .../include/log4cxx/helpers/serversocket.h | 1 + + src/main/include/log4cxx/level.h | 1 + + src/main/include/log4cxx/rolling/action.h | 1 + + 10 files changed, 30 insertions(+), 13 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e5b44ef1a..9c6e63902 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,6 +41,9 @@ if( NOT "${CMAKE_CXX_STANDARD}") + set(CMAKE_CXX_STANDARD 17) + endif() + ++# Don't allow for compiler-specific extensions ++set(CMAKE_CXX_EXTENSIONS OFF) ++ + # Building + add_subdirectory(src) + +@@ -185,6 +188,13 @@ if(APACHE_MAINTAINER) + ) + endif() + ++# ++# Check for any fatal configuration errors ++# ++if( "${SHARED_MUTEX_IMPL}" STREQUAL "NONE" ) ++ message( FATAL_ERROR "No shared_mutex implementation found. Requires Boost or C++17" ) ++endif() ++ + # + # Output configuration information + # Similar to APR CMake configuration +diff --git a/src/cmake/boost-fallback/boost-fallback.cmake b/src/cmake/boost-fallback/boost-fallback.cmake +index a8d7d441b..8285b0b99 100644 +--- a/src/cmake/boost-fallback/boost-fallback.cmake ++++ b/src/cmake/boost-fallback/boost-fallback.cmake +@@ -56,16 +56,17 @@ try_compile(STD_ATOMIC_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" + "${CMAKE_CURRENT_LIST_DIR}/test-stdatomic.cpp") + + find_package(Boost COMPONENTS thread) +-try_compile(Boost_SHARED_PTR_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" +- "${CMAKE_CURRENT_LIST_DIR}/test-boostsharedptr.cpp") +-try_compile(Boost_MUTEX_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" +- "${CMAKE_CURRENT_LIST_DIR}/test-boostmutex.cpp") +-try_compile(Boost_SHARED_MUTEX_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" +- "${CMAKE_CURRENT_LIST_DIR}/test-boostsharedmutex.cpp" +- LINK_LIBRARIES Threads::Threads +-) +-try_compile(Boost_ATOMIC_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" +- "${CMAKE_CURRENT_LIST_DIR}/test-boostatomic.cpp") ++if( ${Boost_FOUND} ) ++ try_compile(Boost_SHARED_PTR_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" ++ "${CMAKE_CURRENT_LIST_DIR}/test-boostsharedptr.cpp") ++ try_compile(Boost_MUTEX_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" ++ "${CMAKE_CURRENT_LIST_DIR}/test-boostmutex.cpp") ++ try_compile(Boost_SHARED_MUTEX_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" ++ "${CMAKE_CURRENT_LIST_DIR}/test-boostsharedmutex.cpp" ++ LINK_LIBRARIES Threads::Threads Boost::thread) ++ try_compile(Boost_ATOMIC_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests" ++ "${CMAKE_CURRENT_LIST_DIR}/test-boostatomic.cpp") ++endif( ${Boost_FOUND} ) + + # Link the target with the appropriate boost libraries(if required) + function(boostfallback_link target) +diff --git a/src/main/cpp/hierarchy.cpp b/src/main/cpp/hierarchy.cpp +index 4f5174448..c70d39dbb 100644 +--- a/src/main/cpp/hierarchy.cpp ++++ b/src/main/cpp/hierarchy.cpp +@@ -223,7 +223,7 @@ LoggerPtr Hierarchy::getLogger(const LogString& name, + else + { + LoggerPtr logger(factory->makeNewLoggerInstance(pool, name)); +- logger->setHierarchy(weak_from_this()); ++ logger->setHierarchy(shared_from_this()); + loggers->insert(LoggerMap::value_type(name, logger)); + + ProvisionNodeMap::iterator it2 = provisionNodes->find(name); +@@ -423,6 +423,6 @@ void Hierarchy::configureRoot(){ + // LOGCXX-322 we need to turn the repositroy into a weak_ptr, and we + // can't use weak_from_this() in the constructor. + if( !root->getLoggerRepository().lock() ){ +- root->setHierarchy(weak_from_this()); ++ root->setHierarchy(shared_from_this()); + } + } +diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt +index 8183660a5..584941c97 100644 +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -133,7 +133,7 @@ if( ${STD_SHARED_MUTEX_FOUND} ) + elseif( ${Boost_SHARED_MUTEX_FOUND} ) + set( SHARED_MUTEX_IMPL "boost::shared_mutex" ) + else() +- set( SMART_PTR_IMPL "NONE" ) ++ set( SHARED_MUTEX_IMPL "NONE" ) + endif() + + if( ${STD_ATOMIC_FOUND} ) +diff --git a/src/main/include/log4cxx/helpers/appenderattachableimpl.h b/src/main/include/log4cxx/helpers/appenderattachableimpl.h +index 40e77d93c..b80b5aade 100644 +--- a/src/main/include/log4cxx/helpers/appenderattachableimpl.h ++++ b/src/main/include/log4cxx/helpers/appenderattachableimpl.h +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + namespace log4cxx + { +diff --git a/src/main/include/log4cxx/helpers/aprinitializer.h b/src/main/include/log4cxx/helpers/aprinitializer.h +index 6f3f55070..fccd18e0f 100644 +--- a/src/main/include/log4cxx/helpers/aprinitializer.h ++++ b/src/main/include/log4cxx/helpers/aprinitializer.h +@@ -30,6 +30,7 @@ extern "C" { + } + + #include ++#include + + namespace log4cxx + { +diff --git a/src/main/include/log4cxx/helpers/loglog.h b/src/main/include/log4cxx/helpers/loglog.h +index d54785ddc..a4c92416a 100644 +--- a/src/main/include/log4cxx/helpers/loglog.h ++++ b/src/main/include/log4cxx/helpers/loglog.h +@@ -20,6 +20,7 @@ + + #include + #include ++#include + + namespace log4cxx + { +diff --git a/src/main/include/log4cxx/helpers/serversocket.h b/src/main/include/log4cxx/helpers/serversocket.h +index e6e6d475e..7da75b969 100644 +--- a/src/main/include/log4cxx/helpers/serversocket.h ++++ b/src/main/include/log4cxx/helpers/serversocket.h +@@ -19,6 +19,7 @@ + #define _LOG4CXX_HELPERS_SERVER_SOCKET_H + + #include ++#include + + namespace log4cxx + { +diff --git a/src/main/include/log4cxx/level.h b/src/main/include/log4cxx/level.h +index 4ca4bf28c..7848c902a 100644 +--- a/src/main/include/log4cxx/level.h ++++ b/src/main/include/log4cxx/level.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #if defined(_MSC_VER) + #pragma warning ( push ) +diff --git a/src/main/include/log4cxx/rolling/action.h b/src/main/include/log4cxx/rolling/action.h +index 0e8d55f36..fc4497813 100644 +--- a/src/main/include/log4cxx/rolling/action.h ++++ b/src/main/include/log4cxx/rolling/action.h +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + namespace log4cxx + { diff --git a/package/log4cxx/Config.in b/package/log4cxx/Config.in index bf739a43ca..6f1956f829 100644 --- a/package/log4cxx/Config.in +++ b/package/log4cxx/Config.in @@ -5,8 +5,14 @@ config BR2_PACKAGE_LOG4CXX depends on BR2_INSTALL_LIBSTDCPP depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # apr + depends on BR2_USE_WCHAR || BR2_TOOLCHAIN_GCC_AT_LEAST_7 # boost + depends on BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS || BR2_TOOLCHAIN_GCC_AT_LEAST_7 # boost-thread + depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 || BR2_TOOLCHAIN_GCC_AT_LEAST_7 # boost-thread select BR2_PACKAGE_APR select BR2_PACKAGE_APR_UTIL + select BR2_PACKAGE_BOOST if !BR2_TOOLCHAIN_GCC_AT_LEAST_7 + select BR2_PACKAGE_BOOST_ATOMIC if !BR2_TOOLCHAIN_GCC_AT_LEAST_7 + select BR2_PACKAGE_BOOST_THREAD if !BR2_TOOLCHAIN_GCC_AT_LEAST_7 help Apache log4cxx is a logging framework for C++ patterned after Apache log4j. @@ -17,3 +23,11 @@ comment "log4cxx needs a toolchain w/ C++, threads, dynamic library" depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \ BR2_STATIC_LIBS depends on BR2_USE_MMU + +comment "log4cxx needs a toolchain w/ wchar or gcc >= 7" + depends on !(BR2_USE_WCHAR || BR2_TOOLCHAIN_GCC_AT_LEAST_7) + depends on BR2_USE_MMU + +comment "log4cxx needs a toolchain not affected by GCC bug 64735" + depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7 + depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735 diff --git a/package/log4cxx/log4cxx.mk b/package/log4cxx/log4cxx.mk index 8a7ca8ef17..e799b0fb16 100644 --- a/package/log4cxx/log4cxx.mk +++ b/package/log4cxx/log4cxx.mk @@ -17,6 +17,10 @@ LOG4CXX_CONF_OPTS = \ LOG4CXX_DEPENDENCIES = apr apr-util +ifeq ($(BR2_PACKAGE_BOOST),y) +LOG4CXX_DEPENDENCIES += boost +endif + ifeq ($(BR2_PACKAGE_LIBESMTP),y) LOG4CXX_DEPENDENCIES += libesmtp endif