From patchwork Thu Feb 21 20:27:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergio Prado X-Patchwork-Id: 1046448 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.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=e-labworks.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=e-labworks-com.20150623.gappssmtp.com header.i=@e-labworks-com.20150623.gappssmtp.com header.b="am0sBdDt"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4455rj4qCvz9s70 for ; Fri, 22 Feb 2019 07:37:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 180A8227E1; Thu, 21 Feb 2019 20:37:55 +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 xrnTFnzHXUKn; Thu, 21 Feb 2019 20:37:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1E5892E0DA; Thu, 21 Feb 2019 20:37:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id F19551BF3AF for ; Thu, 21 Feb 2019 20:37:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EED25860B2 for ; Thu, 21 Feb 2019 20:37:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eUUJuM4CcZ6D for ; Thu, 21 Feb 2019 20:37:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 3336686099 for ; Thu, 21 Feb 2019 20:37:51 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id s1so6991120qte.5 for ; Thu, 21 Feb 2019 12:37:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e-labworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HHy1MKeipBAv8rIrxraqC8pMX6KLrZAVEvy1NRuuyaU=; b=am0sBdDt8KP1neC7V9lO6gfa31bnrmSNYk/vt5qKJoFFOKHQLaGWueStA5fXu2JpWF nuj1hF8rqKLBl5zgnDsWUNiNtlJFs3OjqfpCWbPjEadUuB7OLxlFq3RbiDYqYVvTPsKG YZRYW4vcs/k8yRehoeA2cT1jceG7wqEuxLjMjjKvgCDtFRfz/0aWobTZKIfRZMLPz8GL u2exmz+wXfWoCz78lK0HD2LTNE6XV7Q3QbRpeZ9Zx4S6TguGGxgW4PieGKry4H0t+8DM keW9V+Bghw1KZY5fgt8yv2Czp8fLQhTB4LDoLomKv/dKzI+G3ibuDvi4nr3qx4UKOzdZ RpTg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HHy1MKeipBAv8rIrxraqC8pMX6KLrZAVEvy1NRuuyaU=; b=Uu68hnCDAryYrrVyisVq82X+bWz8ZhmLMK+atSuCMks2Z6UFlJx/tykjgtWu1gBd7E VJGdynKS/xkYG0NGRiK8/WvoJRL796KhrPaiLiUIz5MHph3D6k8losKM++gmiyFSDYPn fpc9KXLPDPi+8XC54xWQ7eybk3DIn0YzPXNbuPOhMYy4BqqdV2OQ2oGwvrGhXJDsuXN/ LzAyLmpKACnUUfUnRs0y+a5RuIMWNX7FBt16PKwvzva9RNNQZ8lIUXHTsCgM7+rlOzND zMVRs1zCY9Qr2M5gnHwfy0KwsQpcxqN0FedPpr93XUHBF1xzX9hR0r6w2l6k0xjYae/K O2bw== X-Gm-Message-State: AHQUAubtxOHnyrA0LtwG79sPOcZD4Slnx4EDdkgDoSSlJJK0C0PtJDZh S6wu+eofcHlU6hQvPPbQxFaDXnNL0ps= X-Google-Smtp-Source: AHgI3Ia1n0XUZcDKNTmqO9WUgbn8yRXiV8M4Fqp6SXQE8eZwZMDOYMyfuaRf2RDsFKHK1T3MbOHSDw== X-Received: by 2002:ac8:1c0e:: with SMTP id a14mr203458qtk.259.1550780972382; Thu, 21 Feb 2019 12:29:32 -0800 (PST) Received: from localhost.localdomain ([2804:18:1047:354e:450f:9b0a:4b4:f7c9]) by smtp.gmail.com with ESMTPSA id o65sm14787658qkl.11.2019.02.21.12.29.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Feb 2019 12:29:31 -0800 (PST) From: Sergio Prado To: buildroot@buildroot.org Date: Thu, 21 Feb 2019 17:27:26 -0300 Message-Id: <1550780846-7463-3-git-send-email-sergio.prado@e-labworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550780846-7463-1-git-send-email-sergio.prado@e-labworks.com> References: <1550780846-7463-1-git-send-email-sergio.prado@e-labworks.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] package/snort: build with OpenAppID support if luajit/openssl is enabled 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: Sergio Prado Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Since version 2.9.12, OpenAppID [1] is enabled by default. OpenAppID depends on luajit and openssl. If we leave it enabled by default, snort would require luajit. Since luajit is not available on all architectures, that would limit the usage of the snort package. Since not all users will need/use OpenAppID, let's leave it disabled by default. To build with OpenAppID support, the user will need to enable luajit and libssl. Also, it is necessary to apply a patch to fix a compile error when building OpenAppID with uclibc and musl. The build fails when dereferencing the rpcent structure because rpc.h is not been included. [1] https://www.snort.org/downloads/openappid/9553 Signed-off-by: Sergio Prado --- ...-error-when-building-against-uclibc-or-mu.patch | 34 ++++++++++++++++++++++ package/snort/snort.mk | 9 ++++++ 2 files changed, 43 insertions(+) create mode 100644 package/snort/0006-Fix-compile-error-when-building-against-uclibc-or-mu.patch diff --git a/package/snort/0006-Fix-compile-error-when-building-against-uclibc-or-mu.patch b/package/snort/0006-Fix-compile-error-when-building-against-uclibc-or-mu.patch new file mode 100644 index 000000000000..ce9d5526c841 --- /dev/null +++ b/package/snort/0006-Fix-compile-error-when-building-against-uclibc-or-mu.patch @@ -0,0 +1,34 @@ +From dc2f54097da3cd493b8f4d06a14ef40be484d24f Mon Sep 17 00:00:00 2001 +From: Sergio Prado +Date: Thu, 21 Feb 2019 15:02:08 -0300 +Subject: [PATCH] Fix compile error when building against uclibc or musl + +The build fails when dereferencing the rpcent structure with uclibc or musl C libraries. + +../../../src/dynamic-preprocessors/appid/service_plugins/service_rpc.c:241:20: +error: dereferencing pointer to incomplete type ‘struct rpcent’ + if (rpc->r_name) + +That's because rpc.h should be included when using these C libraries. + +Signed-off-by: Sergio Prado +--- + src/dynamic-preprocessors/appid/service_plugins/service_rpc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dynamic-preprocessors/appid/service_plugins/service_rpc.c b/src/dynamic-preprocessors/appid/service_plugins/service_rpc.c +index 81bc8a5db8ab..2e45246083a8 100644 +--- a/src/dynamic-preprocessors/appid/service_plugins/service_rpc.c ++++ b/src/dynamic-preprocessors/appid/service_plugins/service_rpc.c +@@ -32,7 +32,7 @@ + #include "flow.h" + #include "service_api.h" + +-#if defined(FREEBSD) || defined(OPENBSD) ++#if defined(FREEBSD) || defined(OPENBSD) || (defined(LINUX) && defined(__UCLIBC__) && !defined(__UCLIBC_HAS_RPC__) || !defined(__GLIBC__)) + #include "rpc/rpc.h" + #endif + +-- +2.7.4 + diff --git a/package/snort/snort.mk b/package/snort/snort.mk index 30de02b3a8b1..c767d7c5458a 100644 --- a/package/snort/snort.mk +++ b/package/snort/snort.mk @@ -26,6 +26,15 @@ SNORT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc` SNORT_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc` endif +# luajit and openssl should be enabled to build with +# OpenAppID support +ifeq ($(BR2_PACKAGE_LUAJIT)$(BR2_PACKAGE_OPENSSL),yy) +SNORT_DEPENDENCIES += luajit openssl +SNORT_CONF_OPTS += --enable-open-appid +else +SNORT_CONF_OPTS += --disable-open-appid +endif + SNORT_CONF_ENV = \ CFLAGS="$(TARGET_CFLAGS) $(SNORT_CFLAGS)" \ LIBS="$(SNORT_LIBS)" \