From patchwork Mon Jan 28 07:29:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 1031732 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OVTFC/ZD"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43p1Vd65yxz9s6w for ; Mon, 28 Jan 2019 18:30:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DB7008650F; Mon, 28 Jan 2019 07:29:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5V7xjM8XY73h; Mon, 28 Jan 2019 07:29:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id DBEE685F38; Mon, 28 Jan 2019 07:29:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 98DA01BF342 for ; Mon, 28 Jan 2019 07:29:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 94979226FC for ; Mon, 28 Jan 2019 07:29:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XG2R7XSODDWk for ; Mon, 28 Jan 2019 07:29:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by silver.osuosl.org (Postfix) with ESMTPS id 215BA226B2 for ; Mon, 28 Jan 2019 07:29:50 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id gn14so7357951plb.10 for ; Sun, 27 Jan 2019 23:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hF4xuO3Sq9hfWuE3y+zbjxkEh3joOzRnTxViskqD44M=; b=OVTFC/ZDW4ci5hxzcmNxbr1HMamCQif8EDwsaCbTLsteIWUAD6mQfyH2rgRkRFgOb9 CCR5lkhxVBzy0dp807zNewYNfQT2R3oLS31P7dgSH3Trzc7WKRdaCQScW1nMy5bQSlr7 SW7y3NBLPiPiI1IIjNGq3czzhNnk2W2rf/mmxGHM/go5lmQt2zt7fBdqVFLZ6+XYTeNX Z4uv7eVeahsLQ35SIWTlCKt31ZWs0GvmCd3Arxo9cKH7E+XiI/VR/sUfCIEjs/pQRtEc OErKx6/xVllt3hSVvaeylp47JcqQt87e3imZjnaEUTTYT9aojiJXpmyTmX4QMhZNIsWq 0EAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hF4xuO3Sq9hfWuE3y+zbjxkEh3joOzRnTxViskqD44M=; b=DU/koJrV2SZ8Kx/NAlsyx/tvqgtL/RGEllbc05QkVFBS7XHsnUVRP2yAUIwz47P+Tl xAXN0QzPB7JxCS9z52Chkp9IxJ6JI+eFhDaqfdDVtND7E0OSJZL7HZU72OrHuUNzr5aK SP5PeRH1eMSam/uwc0XSWC3QR1qyBDmOwooRHbMdeV7bC5kzcy+EWmnowyUyLc4oNEak va3uyvq3sWGAwrFKr4RL+8L2mtBbBx/yX8Yzav8clmD7NUFjSqUYE/5OSUGyBG6oXsoM Am7ka05k1l0yYuIqj3l7mq8OpN+CMFUspdg6agZ2zxymcjWvT2cqRGrgd2Bku+TK27+3 DGbQ== X-Gm-Message-State: AJcUukdg9PbY7YbbQZ6lkdkOLuGehBkpgSTFlT3YFpyJVEKPrji8cybs i4Qgg1Xhd/QH1gk1HcvBr8wteoFRUEA= X-Google-Smtp-Source: ALg8bN75DcQvMpk0VpJ96q9z4YG5AjZKX7B7OIdxG53TZn7MC0IaIFKLLZdlpdQ13awLaYHvdH/myg== X-Received: by 2002:a17:902:74cc:: with SMTP id f12mr20901934plt.134.1548660589248; Sun, 27 Jan 2019 23:29:49 -0800 (PST) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id r187sm103776348pfc.63.2019.01.27.23.29.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 27 Jan 2019 23:29:48 -0800 (PST) From: Chris Packham To: buildroot@buildroot.org Date: Mon, 28 Jan 2019 20:29:34 +1300 Message-Id: <20190128072934.12788-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3] syslog-ng: fix builds with static libc X-BeenThere: buildroot@busybox.net 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 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Bring in an upstream patch to fix builds for targets which lack dlfcn.h and revert "package/syslog-ng: depend on !BR2_STATIC_LIBS". This reverts commit 44dbd2907c5995b0b0c56cb2274dc60415205dd8. Now that upstream has different fix for the build issues with a static libc we can re-enable syslog-ng on these systems. Fixes: - http://autobuild.buildroot.net/results/c0bca852e053cd0e021205b3a949e750ae602333 Signed-off-by: Chris Packham --- Changes in v3: - download patch and store in package/syslog-ng/ Changes in v2: - squash revert and upstream fix into single patch - include URL of build failure this fixes .../0002-build-make-dlsym-optional.patch | 160 ++++++++++++++++++ package/syslog-ng/Config.in | 6 +- 2 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 package/syslog-ng/0002-build-make-dlsym-optional.patch diff --git a/package/syslog-ng/0002-build-make-dlsym-optional.patch b/package/syslog-ng/0002-build-make-dlsym-optional.patch new file mode 100644 index 0000000000..bb29e1ed7c --- /dev/null +++ b/package/syslog-ng/0002-build-make-dlsym-optional.patch @@ -0,0 +1,160 @@ +From d85121c0dc700cad4bd9735b0ee1dab9addf9dd7 Mon Sep 17 00:00:00 2001 +From: Kokan +Date: Thu, 17 Jan 2019 18:44:41 +0100 +Subject: [PATCH] build: make dlsym optional + +In case of static uClibc-ng lib, the does not exists. + +The signal-handler.c solves an issue in case of program src/dst +and Java destination. That combination is really rare if not impossible. + +This patch simply disables own sigaction if is not present. + +Signed-off-by: Kokan + +Downloaded from upstream commit +https://github.com/balabit/syslog-ng/commit/d85121c0dc700cad4bd9735b0ee1dab9addf9dd7 + +Signed-off-by: Chris Packham +--- + CMakeLists.txt | 1 + + configure.ac | 1 + + lib/CMakeLists.txt | 1 - + lib/Makefile.am | 1 - + lib/signal-handler.c | 8 ++++---- + lib/signal-handler.h | 31 ------------------------------- + syslog-ng-config.h.in | 1 + + 7 files changed, 7 insertions(+), 37 deletions(-) + delete mode 100644 lib/signal-handler.h + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c847a547b..dee691388 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,6 +106,7 @@ check_symbol_exists("getrandom" "sys/random.h" SYSLOG_NG_HAVE_GETRANDOM) + + check_include_files(utmp.h SYSLOG_NG_HAVE_UTMP_H) + check_include_files(utmpx.h SYSLOG_NG_HAVE_UTMPX_H) ++check_include_files(dlfcn.h SYSLOG_NG_HAVE_DLFCN_H) + + check_struct_has_member("struct utmpx" "ut_type" "utmpx.h" UTMPX_HAS_UT_TYPE LANGUAGE C) + check_struct_has_member("struct utmp" "ut_type" "utmp.h" UTMP_HAS_UT_TYPE LANGUAGE C) +diff --git a/configure.ac b/configure.ac +index 6bdd8d252..6ef0ad2b4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -627,6 +627,7 @@ dnl *************************************************************************** + + AC_HEADER_STDC + AC_CHECK_HEADER(dmalloc.h) ++AC_CHECK_HEADER(dlfcn.h) + AC_CHECK_HEADERS(strings.h \ + getopt.h \ + stropts.h \ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index be2da32a4..5268712e9 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -91,7 +91,6 @@ set (LIB_HEADERS + logthrdestdrv.h + logwriter.h + mainloop.h +- signal-handler.h + mainloop-call.h + mainloop-worker.h + mainloop-io-worker.h +diff --git a/lib/Makefile.am b/lib/Makefile.am +index ec1928795..5f9e93d79 100644 +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -129,7 +129,6 @@ pkginclude_HEADERS += \ + lib/logthrdestdrv.h \ + lib/logwriter.h \ + lib/mainloop.h \ +- lib/signal-handler.h \ + lib/mainloop-call.h \ + lib/mainloop-worker.h \ + lib/mainloop-io-worker.h \ +diff --git a/lib/signal-handler.c b/lib/signal-handler.c +index 5657ba182..8f52f675b 100644 +--- a/lib/signal-handler.c ++++ b/lib/signal-handler.c +@@ -21,14 +21,15 @@ + * COPYING for details. + * + */ +-#include "signal-handler.h" + + #include "syslog-ng.h" + #include "children.h" + +-#ifndef _WIN32 ++#include ++ ++#if SYSLOG_NG_HAVE_DLFCN_H ++ + #include +-#endif + + static const struct sigaction *sgchld_handler; + +@@ -41,7 +42,6 @@ trigger_sigchld_handler_chain(int signum) + } + } + +-#ifndef _WIN32 + static int + call_original_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) + { +diff --git a/lib/signal-handler.h b/lib/signal-handler.h +deleted file mode 100644 +index 36e5ac293..000000000 +--- a/lib/signal-handler.h ++++ /dev/null +@@ -1,31 +0,0 @@ +-/* +- * Copyright (c) 2018 Balabit +- * Copyright (c) 2018 Kokan +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +- * +- * As an additional exemption you are allowed to compile & link against the +- * OpenSSL libraries as published by the OpenSSL project. See the file +- * COPYING for details. +- * +- */ +-#ifndef SIGNAL_HANDLER_H_INCLUDED +-#define SIGNAL_HANDLER_H_INCLUDED +- +-#include +- +-void trigger_sigchld_handler_chain(int); +- +-#endif +diff --git a/syslog-ng-config.h.in b/syslog-ng-config.h.in +index 9e372f103..d8208eedd 100644 +--- a/syslog-ng-config.h.in ++++ b/syslog-ng-config.h.in +@@ -38,6 +38,7 @@ + #cmakedefine SYSLOG_NG_PATH_XSDDIR "@SYSLOG_NG_PATH_XSDDIR@" + #cmakedefine SYSLOG_NG_HAVE_GETUTENT @SYSLOG_NG_HAVE_GETUTENT@ + #cmakedefine SYSLOG_NG_HAVE_GETUTXENT @SYSLOG_NG_HAVE_GETUTXENT@ ++#cmakedefine SYSLOG_NG_HAVE_DLFCN_H @SYSLOG_NG_HAVE_DLFCN_H@ + #cmakedefine SYSLOG_NG_HAVE_UTMPX_H @SYSLOG_NG_HAVE_UTMPX_H@ + #cmakedefine SYSLOG_NG_HAVE_UTMP_H @SYSLOG_NG_HAVE_UTMP_H@ + #cmakedefine SYSLOG_NG_HAVE_MODERN_UTMP @SYSLOG_NG_HAVE_MODERN_UTMP@ +-- +2.20.1 + diff --git a/package/syslog-ng/Config.in b/package/syslog-ng/Config.in index 6407645974..fbc236221a 100644 --- a/package/syslog-ng/Config.in +++ b/package/syslog-ng/Config.in @@ -3,7 +3,6 @@ config BR2_PACKAGE_SYSLOG_NG depends on BR2_USE_WCHAR # glib2 depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # fork() - depends on !BR2_STATIC_LIBS # dlfcn.h depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS select BR2_PACKAGE_EVENTLOG select BR2_PACKAGE_LIBGLIB2 @@ -16,8 +15,7 @@ config BR2_PACKAGE_SYSLOG_NG https://syslog-ng.org/ -comment "syslog-ng needs a toolchain w/ dynamic library, wchar, threads" +comment "syslog-ng needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU - depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ - BR2_STATIC_LIBS + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS