[dpdk-stable] patch 'build: propagate Windows system dependencies to pkg-config' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:28:47 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/91f3769c3fa08e7aaaa2098ebb80757f8aa2cf8f

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 91f3769c3fa08e7aaaa2098ebb80757f8aa2cf8f Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Date: Fri, 20 Aug 2021 02:14:46 +0300
Subject: [PATCH] build: propagate Windows system dependencies to pkg-config
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 5ffa86a2b4167276212c7f666a8f96fa4f46d3b3 ]

Windows EAL depends on some system libraries. They were linked using
add_project_link_arguments('-l<LIB>'), which prevented meson from adding
them to Libs.private of pkg-config file. As a result, applications using
pkg-config to find DPDK hit link errors, for example:

    librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved
    external symbol __imp_SymInitialize referenced in function
    rte_dump_stack

Reference required libraries in EAL using ext_deps meson variable.
bus/pci and net/pcap depend on lib/eal and will pull them automatically.
Drop advapi32 dependency, as MinGW locates VirtualAlloc2() dynamically.

Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")
Fixes: c91717eb75c8 ("eal/windows: support exit and panic")

Reported-by: William Tu <u9012063 at gmail.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Tested-by: William Tu <u9012063 at gmail.com>
---
 config/meson.build                 | 13 ++-----------
 lib/librte_eal/windows/meson.build | 10 ++++++++++
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index b2734fc0cf..d909d064c2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -278,7 +278,8 @@ if is_freebsd
 endif
 
 if is_windows
-	# VirtualAlloc2() is available since Windows 10 / Server 2016.
+	# VirtualAlloc2() is available since Windows 10 / Server 2019.
+	# It's essential for EAL, so we don't support older versions.
 	add_project_arguments('-D_WIN32_WINNT=0x0A00', language: 'c')
 
 	# Use MinGW-w64 stdio, because DPDK assumes ANSI-compliant formatting.
@@ -286,16 +287,6 @@ if is_windows
 		add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c')
 	endif
 
-	add_project_link_arguments('-lws2_32', language: 'c')
-
-	# Contrary to docs, VirtualAlloc2() is exported by mincore.lib
-	# in Windows SDK, while MinGW exports it by advapi32.a.
-	if is_ms_linker
-		add_project_link_arguments('-lmincore', language: 'c')
-	endif
-
-	add_project_link_arguments('-ladvapi32', '-lsetupapi', language: 'c')
-	add_project_link_arguments('-ldbghelp', language: 'c')
 endif
 
 if get_option('b_lto')
diff --git a/lib/librte_eal/windows/meson.build b/lib/librte_eal/windows/meson.build
index 3b2faf29eb..557e3c04a5 100644
--- a/lib/librte_eal/windows/meson.build
+++ b/lib/librte_eal/windows/meson.build
@@ -22,3 +22,13 @@ sources += files(
 )
 
 dpdk_conf.set10('RTE_EAL_NUMA_AWARE_HUGEPAGES', true)
+
+ext_deps += [
+	cc.find_library('dbghelp'),
+	cc.find_library('setupapi'),
+	cc.find_library('ws2_32'),
+]
+if is_ms_linker
+	# Contrary to docs, VirtualAlloc2() is exported by mincore.lib.
+	ext_deps += cc.find_library('mincore')
+endif
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:04.034409827 +0800
+++ 0043-build-propagate-Windows-system-dependencies-to-pkg-c.patch	2021-11-10 14:17:01.797413358 +0800
@@ -1 +1 @@
-From 5ffa86a2b4167276212c7f666a8f96fa4f46d3b3 Mon Sep 17 00:00:00 2001
+From 91f3769c3fa08e7aaaa2098ebb80757f8aa2cf8f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 5ffa86a2b4167276212c7f666a8f96fa4f46d3b3 ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -27,3 +29,3 @@
- config/meson.build          | 14 ++------------
- lib/eal/windows/meson.build | 10 ++++++++++
- 2 files changed, 12 insertions(+), 12 deletions(-)
+ config/meson.build                 | 13 ++-----------
+ lib/librte_eal/windows/meson.build | 10 ++++++++++
+ 2 files changed, 12 insertions(+), 11 deletions(-)
@@ -32 +34 @@
-index 3b5966ec2f..0b8359404b 100644
+index b2734fc0cf..d909d064c2 100644
@@ -35 +37 @@
-@@ -340,7 +340,8 @@ if is_freebsd
+@@ -278,7 +278,8 @@ if is_freebsd
@@ -39,4 +41,4 @@
--    # VirtualAlloc2() is available since Windows 10 / Server 2016.
-+    # VirtualAlloc2() is available since Windows 10 / Server 2019.
-+    # It's essential for EAL, so we don't support older versions.
-     add_project_arguments('-D_WIN32_WINNT=0x0A00', language: 'c')
+-	# VirtualAlloc2() is available since Windows 10 / Server 2016.
++	# VirtualAlloc2() is available since Windows 10 / Server 2019.
++	# It's essential for EAL, so we don't support older versions.
+ 	add_project_arguments('-D_WIN32_WINNT=0x0A00', language: 'c')
@@ -44,7 +46,6 @@
-     # Use MinGW-w64 stdio, because DPDK assumes ANSI-compliant formatting.
-@@ -352,17 +353,6 @@ if is_windows
-     if cc.get_id() == 'clang'
-         add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c')
-     endif
--
--    add_project_link_arguments('-lws2_32', language: 'c')
+ 	# Use MinGW-w64 stdio, because DPDK assumes ANSI-compliant formatting.
+@@ -286,16 +287,6 @@ if is_windows
+ 		add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c')
+ 	endif
+ 
+-	add_project_link_arguments('-lws2_32', language: 'c')
@@ -52,5 +53,5 @@
--    # Contrary to docs, VirtualAlloc2() is exported by mincore.lib
--    # in Windows SDK, while MinGW exports it by advapi32.a.
--    if is_ms_linker
--        add_project_link_arguments('-lmincore', language: 'c')
--    endif
+-	# Contrary to docs, VirtualAlloc2() is exported by mincore.lib
+-	# in Windows SDK, while MinGW exports it by advapi32.a.
+-	if is_ms_linker
+-		add_project_link_arguments('-lmincore', language: 'c')
+-	endif
@@ -58,2 +59,2 @@
--    add_project_link_arguments('-ladvapi32', '-lsetupapi', language: 'c')
--    add_project_link_arguments('-ldbghelp', language: 'c')
+-	add_project_link_arguments('-ladvapi32', '-lsetupapi', language: 'c')
+-	add_project_link_arguments('-ldbghelp', language: 'c')
@@ -63,5 +64,5 @@
-diff --git a/lib/eal/windows/meson.build b/lib/eal/windows/meson.build
-index fc12fefd0d..845e406ca1 100644
---- a/lib/eal/windows/meson.build
-+++ b/lib/eal/windows/meson.build
-@@ -24,3 +24,13 @@ sources += files(
+diff --git a/lib/librte_eal/windows/meson.build b/lib/librte_eal/windows/meson.build
+index 3b2faf29eb..557e3c04a5 100644
+--- a/lib/librte_eal/windows/meson.build
++++ b/lib/librte_eal/windows/meson.build
+@@ -22,3 +22,13 @@ sources += files(
@@ -73,3 +74,3 @@
-+        cc.find_library('dbghelp'),
-+        cc.find_library('setupapi'),
-+        cc.find_library('ws2_32'),
++	cc.find_library('dbghelp'),
++	cc.find_library('setupapi'),
++	cc.find_library('ws2_32'),
@@ -78,2 +79,2 @@
-+        # Contrary to docs, VirtualAlloc2() is exported by mincore.lib.
-+        ext_deps += cc.find_library('mincore')
++	# Contrary to docs, VirtualAlloc2() is exported by mincore.lib.
++	ext_deps += cc.find_library('mincore')


More information about the stable mailing list