From patchwork Sat Jul 1 20:24:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 3268 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:3c07:b0:d9:b492:11d6 with SMTP id ki7csp3407806dyb; Sat, 1 Jul 2023 13:25:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7f0vPOMk+O6LANEkjyjb93qB6vbxzM9IvpB+vV5JA4487FcJmqHBg4Imq4R7LzlDjVKtJ X-Received: by 2002:a17:902:c94d:b0:1b2:4852:9a5f with SMTP id i13-20020a170902c94d00b001b248529a5fmr4553557pla.54.1688243150385; Sat, 01 Jul 2023 13:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688243150; cv=none; d=google.com; s=arc-20160816; b=cPYLY1TDwJ6MnOJUFPY2C/0SlNvMhBgCBbPe5UuCOcHoLxuWdww4Un5EIKQFmRWpu0 1sTDxjqaGvgiVVdKvX8NlcoUoTiz+UBJkj8ImkQDtYl/YoqSr+FTMA7cY53Z7E1d9Vn8 RoPncTgsxDSjkjv3W4aCT/nc7AfHd9MWxYmrMTZ3XZKS2aUUV3WlZzwy8Kqa9RDlKlZU ABTOqJ4IlEuZh+qnq1Jhayd8r/77SKoKV6Wt5Jj3wbQrRW+jiLg7YMN80OTLdjA38BB9 IXMWLvxDJxqopZA6H07bEtS0xLThe0yp8rQV2/+9kfRIj1OH/Y9h8z+oGHAC3H0mjirW eFSQ== 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=t6L0KSAFcbHdvclbE/K+6oaflbKx1eEJfZnebRbw8hU=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=w4L3Wzhyv5olkX6eSgKlw4bTIl2u8zmuWfKMzDkegCSV7OroXM9P2S/6FsWplLtdhR PQIGGHMkMOfvSnW8H+aaBr39Gnf/HJUIqRyyPVtxMfZ8E6AmD9zTAMaQCc6UVD3SlRqh JUJdcadzI16mE2DJRcQ35RoHWyxjRlYks/EbvdRkO3dg5p7d2nWOJ2KubbGKBYLcu1mL xN2O7gTbnJ0YpxN9EnRDoyHIveZy6fbl76YNwY3DemUyPnYG0s97Wiw3sTjODSZossgG F9pFkQJ/nTFuDLvdWqzKRFHRVBLOxHfzxhLVmbh1QKaAXB/MpZmCYs8/bFx0YMlcQroo An/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=NwBuMI8r; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kzRE7sj2; 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 y190-20020a638ac7000000b0055b89e6b24fsi776887pgd.373.2023.07.01.13.25.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Jul 2023 13:25:50 -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=NwBuMI8r; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kzRE7sj2; 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 1qFh9T-0006dD-Na; Sat, 01 Jul 2023 20:25:04 +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 1qFh9S-0006d7-Gk for openvpn-devel@lists.sourceforge.net; Sat, 01 Jul 2023 20:25:03 +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=KaSobSWhcQO4ypGKMzWd6+vuPHkCuq9j/nF6KksmP24=; b=NwBuMI8rKKzgZWMmj0iYm3+66U UO2LciOFCN8CbyzKtgIuUp83EtUGYG2kJ876hVBkuQk3K9tv0xpCOfk8cUSjaIV+TI2A0cYaVR0/6 THLsu5yH8eYU3BG5zcm17Y2AG+wrh6z3t0qUSZhLvRTqkWWf/kqZfYm+JOi+Dv0yiPd8=; 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=KaSobSWhcQO4ypGKMzWd6+vuPHkCuq9j/nF6KksmP24=; b=kzRE7sj2ObELvEC/66usUZcefV UeRu4rW3VW7QwYEUTSw2K0jVuWPll01OenPljuB004VbbkOxKqVwAjP4yKd+TuQkZsev+7G7XtNFh kOADoG9FIKfNI4Ih7dRbGjKke91g5WrY5zRwHiPjrqB8o4oiP82rLw42oMYJlGn2DAcA=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qFh9S-0000Q8-PL for openvpn-devel@lists.sourceforge.net; Sat, 01 Jul 2023 20:25:03 +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 1qFh9J-000PvC-1q for openvpn-devel@lists.sourceforge.net; Sat, 01 Jul 2023 22:24:53 +0200 Received: (nullmailer pid 3517868 invoked by uid 10006); Sat, 01 Jul 2023 20:24:53 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Sat, 1 Jul 2023 22:24:52 +0200 Message-Id: <20230701202453.3517822-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) 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_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1qFh9S-0000Q8-PL Subject: [Openvpn-devel] [PATCH v2 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?1770251249900270664?= 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) Change-Id: Id26676bdc576c7d3d6726afa43fe6c7a397c579b Signed-off-by: Arne Schwabe --- CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acebbb73c..a982c478a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ find_package(PkgConfig REQUIRED) include(CheckSymbolExists) include(CheckIncludeFiles) include(CheckCCompilerFlag) +include(CheckLinkerFlag) include(CheckTypeSize) include(CheckStructHasMember) include(CTest) @@ -560,18 +561,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 >= 1.17, 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 ()