From patchwork Mon Jun 24 19:29:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20376 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D6468BD87C for ; Mon, 24 Jun 2024 19:30:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4254A654BC; Mon, 24 Jun 2024 21:30:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UlZwKVqf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 27729654AF for ; Mon, 24 Jun 2024 21:30:16 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 185B818D7; Mon, 24 Jun 2024 21:29:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257394; bh=MLJQcwfndfHJYzzUbAmcbbUv6ZRcW1lyfHCSN7X2JW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UlZwKVqf78+mEp6pDwN7QsBR08YSwSUBwY5Zg/tkIs4yj+qL5aelvSDXu630kSM4D JfUN2u6g4+JpuQ7qQSYBb4OrodIZOO1w/Ewd7k6ifM+Q6655chDTHj71N7y8i3k/32 VlBq+zzKTz1p7eBYxhmAHZm5CTSHWVBwQVGeBRig= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 09/10] test: gstreamer: Include missing sanitizer/asan_interface.h header Date: Mon, 24 Jun 2024 22:29:40 +0300 Message-ID: <20240624192941.22943-10-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The GStreamet tests define a __asan_default_options() function to influence the behaviour of ASan. The function is declared in sanitizer/asan_interface.h, but we don't include the header. This will cause missing declaration warnings when we enable the -Wmissing-declarations option. Include the header to fix the issue. It can't be done unconditionally as not all toolchains provide ASan, so check for its availability at configuration time. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- test/gstreamer/gstreamer_test.cpp | 6 ++++++ test/gstreamer/meson.build | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp index e8119b853e7e..a15fef0e0c07 100644 --- a/test/gstreamer/gstreamer_test.cpp +++ b/test/gstreamer/gstreamer_test.cpp @@ -9,12 +9,17 @@ #include +#if HAVE_ASAN +#include +#endif + #include "gstreamer_test.h" #include "test.h" using namespace std; +#if HAVE_ASAN extern "C" { const char *__asan_default_options() { @@ -26,6 +31,7 @@ const char *__asan_default_options() return "detect_leaks=false"; } } +#endif GstreamerTest::GstreamerTest(unsigned int numStreams) : pipeline_(nullptr), libcameraSrc_(nullptr) diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build index f3ba5a23dfba..37ad125ef3fd 100644 --- a/test/gstreamer/meson.build +++ b/test/gstreamer/meson.build @@ -11,8 +11,15 @@ gstreamer_tests = [ ] gstreamer_dep = dependency('gstreamer-1.0', required : true) +gstreamer_test_args = [] + +if asan_enabled + gstreamer_test_args += ['-D', 'HAVE_ASAN=1'] +endif + foreach test : gstreamer_tests exe = executable(test['name'], test['sources'], 'gstreamer_test.cpp', + cpp_args : gstreamer_test_args, dependencies : [libcamera_private, gstreamer_dep], link_with : test_libraries, include_directories : test_includes_internal)