[Openvpn-devel,v3,3/4] Check if the -wrap argument is actually supported by the platform's ld
| Message ID | 20230712095529.570306-1-arne@rfc2549.org |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
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 <openvpn-devel-bounces@lists.sourceforge.net>)
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 <arne@kamera.blinkt.de>) 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 <arne@kamera.blinkt.de>) 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 <arne@rfc2549.org>
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: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
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?=
|
| Series |
None
|
|
Commit Message
Arne Schwabe
July 12, 2023, 9:55 a.m. UTC
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 <arne@rfc2549.org>
---
CMakeLists.txt | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
Comments
On Wed, Jul 12, 2023 at 11:55:29AM +0200, Arne Schwabe wrote: > 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 Yeah, I also have no idea why you didn't need that for your CMake. Anyway, it is correct according to the documentation. And it is definitely required on Ubuntu 20.04. Tested on Ubuntu 20.04 (cmake 3.16.3), Ubuntu 22.04 (cmake 3.22.1), and checked build results for GHA. Acked-by: Frank Lichtenheld <frank@lichtenheld.com> > Change-Id: Id26676bdc576c7d3d6726afa43fe6c7a397c579b > Signed-off-by: Arne Schwabe <arne@rfc2549.org> > --- > CMakeLists.txt | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-)
On Wed, Jul 12, 2023 at 01:10:53PM +0200, Frank Lichtenheld wrote: > On Wed, Jul 12, 2023 at 11:55:29AM +0200, Arne Schwabe wrote: > > 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 > > Yeah, I also have no idea why you didn't need that for your CMake. Anyway, > it is correct according to the documentation. And it is definitely required > on Ubuntu 20.04. > > Tested on Ubuntu 20.04 (cmake 3.16.3), Ubuntu 22.04 (cmake 3.22.1), and > checked build results for GHA. > > Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Note: please merge after "Mock openvpn_exece on win32 also for test_tls_crypt" to avoid broken MinGW builds. Regards,
Tested with GHA mingw/msvc builds, and the resulting unit test runs - all
looks green.
(As a side note, we *build* test_tls_crypt on Windows now, but the GHA
"mingw unittests" runs do not seem to run it yet -> patch to build.yaml
missing?)
Your patch has been applied to the master branch.
commit 4ef76f0ee4e122dcd616e1b1e2d652562ab10756
Author: Arne Schwabe
Date: Wed Jul 12 11:55:29 2023 +0200
Check if the -wrap argument is actually supported by the platform's ld
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20230712095529.570306-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26850.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
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 ()