From patchwork Wed Jul 12 09:55:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 3285 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:1496:b0:d7:3b0f:3938 with SMTP id b22csp4253168dyh; Wed, 12 Jul 2023 02:56:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlHzdGQoZxeKEH2ufs9a1va1zrF6rtPOmqStaE5JEeld7mZvH7POgnOyhrMB9awWH2ZqWU/l X-Received: by 2002:a17:903:11cc:b0:1b8:2537:542c with SMTP id q12-20020a17090311cc00b001b82537542cmr16519066plh.43.1689155788242; Wed, 12 Jul 2023 02:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689155788; cv=none; d=google.com; s=arc-20160816; b=MSGRz/A1paI3jG8FfUlURi//qv9B4TgHhHn7SKfm7ztqxY7lBlnRi7j7z7cdmiRRPb mJYh3o63k5QprkfHW777ogF8vGKJQV3Yov34ivJcz2+IpMYLCJEUbEPjbaZkoVeiRLIi ELPS7yKTNusAEpNxHVkvHPJltM4zl4LUB+otirkuZ/ByZNKd0QwrgKm/Bxgcv3a6JvZG FJ6Pu8kpZCmZS2cEuadT4VZManilKpKAHQKlUv3FqW4uI0IOH6UygptfIlwNAhDpK0RY SbJcdmzodq78HjFf5MqMvB+3cgeSb84H0IG5+s/hOFakE96X9A8UaN07RbfiAeqdm5vP cJkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=+QIXUlspAU5bWrQtc4PCVFdmWB37dFcCtgmxSHMpzZY=; fh=upowIstEaPvyXBxHFaCeSfbprOF7d6h3Rt41IfheAVg=; b=PC24Od5basNRJ6eLacUf9QcALezcloEY1c/UKI6B+tff/N3DMJeZDyH9MeyxI0zPOT xiJxpQB89778qQJqUCvyvPivZdYVPAAUU6F4McWSMhevbh17j/Vr9YCYWt006CmrpmiI eVGPoKrJ0jt/uTsd04mcwmZE9rgq+RgRo1LXXHgrOAL56Qs7yfrQwt97ag++j/HmzQWW vlUQ4kNJGMfLxJljMddRaqzLUP+E7GHuBYNqVMhDLlEE2HWevdZfemCkXpIphFGG2eEh +Scz5W/26dhhyNRrhUoJCTRMix6R24jOrboePmd4mG2zqVh8+ro55N98WlFX4zqbZdmu /ELg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HLtcQz06; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=mwUOIpa2; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id j13-20020a170902da8d00b001b88ff83e45si3241141plx.571.2023.07.12.02.56.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 02:56:28 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HLtcQz06; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=mwUOIpa2; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qJWZN-0002S7-CO; Wed, 12 Jul 2023 09:55:38 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qJWZL-0002S0-2W for openvpn-devel@lists.sourceforge.net; Wed, 12 Jul 2023 09:55:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2tYbJMaSpIXdxI9OZ9ATF7dox+PJ/ZLdFWBKZlPqsx8=; b=HLtcQz06e65DwtXC/2ZBha+NXN BeV05ID5T9FQ9dhZm9HTfPCq6AT7Je1YexvmwplLSOmO584B/aNZWDv0SJDAmgi4iCvzo9j6e3nAu m0GrDEPSEYGUht7scKuzt+xkndFSkbgIrs59rUPjImdAIcAxOpAmOfGOpEm7DPtJNNTo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2tYbJMaSpIXdxI9OZ9ATF7dox+PJ/ZLdFWBKZlPqsx8=; b=mwUOIpa2taZx3sS2Xj3p4X3xiV R6zPblwSj8wc0CtW9Yjmanuw+8XgP+4ClJNUPVkAyQYfolV2djSQgLhZKB42zWJCYbDFu/0/hD13G /F4/XFVedTAMN34W+fSX6vo4ax/ViPjPg1sp8xFtG8Q2dAfGuEx8WDQC7br/zIXvjM/Y=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qJWZL-005M3L-Il for openvpn-devel@lists.sourceforge.net; Wed, 12 Jul 2023 09:55:36 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1qJWZF-000Pt3-40 for openvpn-devel@lists.sourceforge.net; Wed, 12 Jul 2023 11:55:29 +0200 Received: (nullmailer pid 570352 invoked by uid 10006); Wed, 12 Jul 2023 09:55:29 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 12 Jul 2023 11:55:29 +0200 Message-Id: <20230712095529.570306-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230629215611.3292788-1-arne@rfc2549.org> References: <20230629215611.3292788-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This avoids build errors on macOS. Also the test_tls_crypt command works just fine on FreeBSD with its linkers, so do not make that test Linux only. Patch v2: allow running with old cmake version (cmake 3 on RHEL7 with EPEL is only 3.17) Patch v3: add OPTIONAL keyword to Incldue required by some cmake versions Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 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-Headers-End: 1qJWZL-005M3L-Il Subject: [Openvpn-devel] [PATCH v3 3/4] Check if the -wrap argument is actually supported by the platform's ld X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1770075776015255584?= X-GMAIL-MSGID: =?utf-8?q?1771208219598384647?= This avoids build errors on macOS. Also the test_tls_crypt command works just fine on FreeBSD with its linkers, so do not make that test Linux only. Patch v2: allow running with old cmake version (cmake 3 on RHEL7 with EPEL is only 3.17) Patch v3: add OPTIONAL keyword to Incldue required by some cmake versions Change-Id: Id26676bdc576c7d3d6726afa43fe6c7a397c579b Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld --- CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d0cd5dd0..7dae6655d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ find_package(PkgConfig REQUIRED) include(CheckSymbolExists) include(CheckIncludeFiles) include(CheckCCompilerFlag) +include(CheckLinkerFlag OPTIONAL) include(CheckTypeSize) include(CheckStructHasMember) include(CTest) @@ -564,18 +565,24 @@ if (BUILD_TESTING) ) endif () - if (NOT MSVC) - # MSVC does not support --wrap + # MSVC and Apple's LLVM ld do not support --wrap + # This test requires cmake >= 3.18, so check if check_linker_flag is + # available + if (COMMAND check_linker_flag) + check_linker_flag(C -Wl,--wrap=parse_line LD_SUPPORTS_WRAP) + endif() + + if (${LD_SUPPORTS_WRAP}) list(APPEND unit_tests "test_argv" + "test_tls_crypt" ) endif () - # These tests work on only on Linux since they depend on special linker features + # These tests work on only on Linux since they depend on special Linux features if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") list(APPEND unit_tests "test_networking" - "test_tls_crypt" ) endif ()