From patchwork Fri Sep 19 11:24:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4426 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6a92:b0:72f:f16c:e055 with SMTP id u18csp100585maw; Fri, 19 Sep 2025 04:24:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX6+xKXRFLL8P6lrnpEp6FSuZMzk9GQgnyggF1U2eii/4GH182eMMHir0CUmA0CSDQjEXh4+M7/cJM=@openvpn.net X-Google-Smtp-Source: AGHT+IHRGc+083X59twQfizU+sn+zGyodKAni8gNr7V4mULccarxUpAdSAHYhbKV5CHGM6n4/qCW X-Received: by 2002:a05:6820:770a:b0:623:55db:c0a2 with SMTP id 006d021491bc7-625ba0475cdmr3786601eaf.1.1758281083985; Fri, 19 Sep 2025 04:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1758281083; cv=none; d=google.com; s=arc-20240605; b=eHW1EF9wp/JgTrtfF1HAoD3q5EzIT8HQTvMEGhoAJLZzrRLVKQc3rjw9DUBrJgxwvR yA8RVv2/vwvqzxk19LYdN3Zvncb8rhiUmU2YyuSX6Dny4t57rb6USXipouXTnLMIYX8b wahwerQloSq/H9KU9lCud4xOqpCinMSTbKZE+yOfeUwNGjevopgctUQKL1dFDn+B5JS7 3hCy7wk9DPrV0zX/lhkKrDuFpOWDyjYFTE24tPdudI6BFQ5e2TG6KhKCM7w6w48W36dX x2Q5eFcdW5Fu4Q9WQ7D/vddINvWtWFldLBFyoPIR4yc5+k0JjyFLm2Xt16ETuNAs0xNd UaVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:dkim-signature; bh=h5EJyxNMdZrrsgimpH5cvRws7rWRZ2CKpfHf6GXQTCQ=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=BiQ2GGeWMg/Et9xPlw2JAGqbjO7aipCV5pmBWXg0gCO0TX7BiQe7yvu/+oHHQ+/+tw 6IAyOTiI7K1Esc+ARkgIdcQ8X7GyuTcxjM9Fa5orybv3MV0pET1XSm0GUevH+z/8nEHa 5yovZVlh303KI35N/IoxZoVdJMPrhk5TkCVLytcCZdtxXwhWvENb+KIa+2nge6Y/JLxI mWfSLvfIKT1K22F98sTZWw4SS2Lcqf1gLgzWyGjoH7cLGSlCsZ7v7lvkEqF7FfNDRIiW OgP/8al6u/Rt+DfObDZC3+5ghC5ciM2QS0/AO6Gm8lb9XSkGgIPcM4wmO8Sl2Xz/Sfyt nXDQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="g8I9J/VG"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=XlFViHpg; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="EIgXhi/E"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 006d021491bc7-625d8a0d984si1307048eaf.14.2025.09.19.04.24.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2025 04:24:43 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b="g8I9J/VG"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=XlFViHpg; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="EIgXhi/E"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=h5EJyxNMdZrrsgimpH5cvRws7rWRZ2CKpfHf6GXQTCQ=; b=g8I9J/VGOUwHo9vpOB6iWEALl0 5QRBqCffIo0WsnR74ygO7k8o4+hDDfB4x+UeTsSBEkrJlUwUDYBLnsKJeyL9TD0fZ93BKcoA38d1k ve1SIqGz14XXvw2yb7KQcyPOYbzPO46LfkeDql0kVofHNsT6RuqYkc8jjPnhv9uEXR4k=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uzZEG-0001Bk-35; Fri, 19 Sep 2025 11:24:40 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uzZEE-0001Bd-J9 for openvpn-devel@lists.sourceforge.net; Fri, 19 Sep 2025 11:24:38 +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=q4Q6iqe9S+HK1DYUhhqpYtAiZi/GUqfD8xAIcgHqwrE=; b=XlFViHpgLv9iOGIvy2LhMdWKzS Z1kTpVgso0N8cxlHiFU5AdsrMjg1RV1SfXLe9jt6GkV68+fZ4BrWPpglp2uhOCJ4DRJ1q35HX6GEt m2gqGOnzZiqCNiQnQ5TKtZcK2r5jmcTPqmlSofiHMCuUSdOiN12bvV7OrVuGKStPVPAc=; 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=q4Q6iqe9S+HK1DYUhhqpYtAiZi/GUqfD8xAIcgHqwrE=; b=EIgXhi/Ez3VbPVVOGVY4IJudEb Xb3UXRualSVm3B+0QUPSkxvqeR1QgF6PrBxc4Lu3ZgGHGqioZu2pOhdfzQSxXurPJiG1sxcpUz7AT JRe9ubdgWdsidj3+WMy//S0BYi6hE3eSxjoMwVk1CSnIZbN9vxYafqJ0ITPrn0zeuy00=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uzZEC-0001b5-TQ for openvpn-devel@lists.sourceforge.net; Fri, 19 Sep 2025 11:24:38 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 58JBOO51024747 for ; Fri, 19 Sep 2025 13:24:24 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 58JBOOT2024746 for openvpn-devel@lists.sourceforge.net; Fri, 19 Sep 2025 13:24:24 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 19 Sep 2025 13:24:19 +0200 Message-ID: <20250919112424.24728-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", 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: commit 06919a60ae61 introduces .mc files that need to be compiled to .h and .bin by the windows "mc.exe" tool, and from there into a new .dll. This worked for MSVC builds, did nothing for cmake/mingw [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1uzZEC-0001b5-TQ Subject: [Openvpn-devel] [PATCH v4] fix building of openvpnsrvmsg.dll from eventmsg.mc in mingw builds 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?1843691346258327982?= X-GMAIL-MSGID: =?utf-8?q?1843691346258327982?= commit 06919a60ae61 introduces .mc files that need to be compiled to .h and .bin by the windows "mc.exe" tool, and from there into a new .dll. This worked for MSVC builds, did nothing for cmake/mingw builds, and broke compilation on autoconf/mingw builds. This patch consists of two parts: 1. add building of openvpnsrvmsg.dll to autoconf/mingw builds Add logic to configure.ac to find the "windmc" binary in the linux or mingw variants, add rules to src/openvpnserv/Makefile.am so make knows what to do. Libtool is getting in the way when "openvpnsrvmsg.dll" is created as anything listed in ...BIN or ...LIB, so decare it as "DATA" and make the necessary rules explicit. 2. fix building of openvpnsrvmsg.dll on cmake/mingw builds Fix "find_program()" invocation to avoid using "midnight commander" binary (mc) on Linux (called "windmc" there). Change from "-Wl,--noentry" to linker invocation that works. See also: https://learn.microsoft.com/en-us/cpp/build/creating-a-resource-only-dll?view=msvc-170 Change-Id: I071e8190dac28f429257b8af1c6f9e68f8896bc0 Signed-off-by: Gert Doering Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1197 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1197 This mail reflects revision 4 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/configure.ac b/configure.ac index 7059871..38b14a1 100644 --- a/configure.ac +++ b/configure.ac @@ -441,6 +441,7 @@ AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool]) AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool]) AC_DEFINE_UNQUOTED([SYSTEMD_ASK_PASSWORD_PATH], ["$SYSTEMD_ASK_PASSWORD"], [Path to systemd-ask-password tool]) +AC_CHECK_TOOLS([WINDMC], [windmc mc.exe],[no]) # # man page generation - based on python-docutils diff --git a/src/openvpnserv/CMakeLists.txt b/src/openvpnserv/CMakeLists.txt index 82099f1..340b904 100644 --- a/src/openvpnserv/CMakeLists.txt +++ b/src/openvpnserv/CMakeLists.txt @@ -41,7 +41,7 @@ file(MAKE_DIRECTORY ${MC_GEN_DIR}) set(MC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/eventmsg.mc) -find_program(MC_COMPILER NAMES mc mc.exe x86_64-w64-mingw32-windmc i686-w64-mingw32-windmc windmc) +find_program(MC_COMPILER NAMES mc.exe x86_64-w64-mingw32-windmc i686-w64-mingw32-windmc windmc) if (NOT MC_COMPILER) message(FATAL_ERROR "No message compiler found.") @@ -58,12 +58,17 @@ add_custom_target(msg_mc_gen ALL DEPENDS ${MC_GEN_DIR}/eventmsg.rc ${MC_GEN_DIR}/eventmsg.h) add_library(openvpnservmsg SHARED ${MC_GEN_DIR}/eventmsg.rc) +add_dependencies(openvpnservmsg msg_mc_gen) if (MSVC) set_target_properties(openvpnservmsg PROPERTIES LINK_FLAGS "/NOENTRY") else() - target_link_options(openvpnservmsg PRIVATE "-Wl,--no-entry") + set_target_properties(openvpnservmsg PROPERTIES LINKER_LANGUAGE C OUTPUT_NAME "openvpnservmsg") + target_link_options(openvpnservmsg PRIVATE + -Wl,--entry=0 + -nostdlib + -nostartfiles + ) endif() -add_dependencies(openvpnservmsg msg_mc_gen) add_dependencies(openvpnserv msg_mc_gen) diff --git a/src/openvpnserv/Makefile.am b/src/openvpnserv/Makefile.am index ef5f3f3..a27fbbf 100644 --- a/src/openvpnserv/Makefile.am +++ b/src/openvpnserv/Makefile.am @@ -28,6 +28,10 @@ openvpnserv_LDADD = \ -ladvapi32 -luserenv -liphlpapi -lfwpuclnt -lrpcrt4 \ -lshlwapi -lnetapi32 -lws2_32 -lntdll -lole32 +noinst_DATA = \ + MSG00409.bin eventmsg.h eventmsg.rc openvpnservmsg.dll +BUILT_SOURCES = \ + eventmsg.h endif openvpnserv_SOURCES = \ @@ -37,3 +41,11 @@ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ openvpnserv_resources.rc + +openvpnservmsg.dll: eventmsg.o + $(CC) -shared -Wl,--entry=0 -nostdlib -nostartfiles -o $@ $< + +eventmsg.o: eventmsg.rc + +eventmsg.h: eventmsg.mc + $(WINDMC) -U $<