From patchwork Tue Oct 13 13:36:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1381587 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=c5gdRCrg; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 ozlabs.org (Postfix) with ESMTPS id 4C9c7d1kXFz9sVH for ; Wed, 14 Oct 2020 00:38:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aSkOKFSHOI7KUjhN64ZprSFkML07SRDgjrCSpNf91dM=; b=c5gdRCrgMMW1hFBXw0QOd+3va RK33mT+7/7lo6jJqVTnozEB9+K8APl/PoHYI8PPAukthIWiuaEb2gD3S+t4m0D/tTlhYIQRwBznbp 10cnm3/nkPy4PBCkDGjQT8+jro2OOEJN03UGDrhbfHulWu7/QDtAmi4gbUR4ZY8j32YuEFl3OSwnT wcUHG+hViiUliMAoZ5Hng21IIrhhOIgj8IxPeN3QAIct8rASasjEd309d/LxJ8JDfGZgmnHPf0cu5 tHSAfjnLnB38BjdorLoBnR5BbkC+3wy9p1luH8IQ8q9jzigPb9uB4Xc/J9HkSDfyUgJzDiOBczfA0 Bd0wyHzng==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSKU3-0006GR-OQ; Tue, 13 Oct 2020 13:36:55 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSKTj-00069p-1E for openwrt-devel@lists.openwrt.org; Tue, 13 Oct 2020 13:36:37 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 12CA71870C; Tue, 13 Oct 2020 15:36:27 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id e0952281; Tue, 13 Oct 2020 15:36:11 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH mdnsd 08/10] cmake: tests: provide umdns-san binary Date: Tue, 13 Oct 2020 15:36:19 +0200 Message-Id: <20201013133621.27088-9-ynezz@true.cz> In-Reply-To: <20201013133621.27088-1-ynezz@true.cz> References: <20201013133621.27088-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201013_093635_219120_1993A54C X-CRM114-Status: GOOD ( 14.78 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Which is compiled with clang UB, address and leak sanitizers which is handy for example with fuzzing directly over network. Signed-off-by: Petr Štetiar --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80d1cf5be352..f1bc8f0e9dfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,19 @@ TARGET_LINK_LIBRARIES(umdns umdns-lib) IF(UNIT_TESTING) ENABLE_TESTING() ADD_SUBDIRECTORY(tests) + + IF(CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_LIBRARY(umdns-lib-san STATIC ${SOURCES}) + TARGET_COMPILE_OPTIONS(umdns-lib-san PRIVATE -g -fno-omit-frame-pointer -fsanitize=undefined,address,leak -fno-sanitize-recover=all) + TARGET_LINK_OPTIONS(umdns-lib-san PRIVATE -fsanitize=undefined,address,leak) + TARGET_LINK_LIBRARIES(umdns-lib-san ${LIBS}) + + ADD_EXECUTABLE(umdns-san main.c ${SOURCES}) + TARGET_COMPILE_OPTIONS(umdns-san PRIVATE -g -fno-omit-frame-pointer -fsanitize=undefined,address,leak -fno-sanitize-recover=all) + TARGET_LINK_OPTIONS(umdns-san PRIVATE -fsanitize=undefined,address,leak) + TARGET_LINK_LIBRARIES(umdns-san umdns-lib-san) + ENDIF() + ENDIF() INSTALL(TARGETS umdns