From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9027A0C4C for ; Fri, 20 Aug 2021 01:15:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7CDF41228; Fri, 20 Aug 2021 01:15:10 +0200 (CEST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mails.dpdk.org (Postfix) with ESMTP id 6BDB84003D; Fri, 20 Aug 2021 01:15:08 +0200 (CEST) Received: by mail-lf1-f48.google.com with SMTP id f10so1573854lfv.6; Thu, 19 Aug 2021 16:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8UjCoeywOYQ666Hn3NT13CCohim7y7rztb4JyjTH9rE=; b=VIvYh9aYhYIpQUjtgF4wfc1qQ0qdV+St3Kx2naRoWxEWCDJLgkvQwq0ddgOne4/uLg HJMZy6bVszdfjoQIjj5lDvqQPg7JX3fUnc788TaFXCsD0U9yOeGb6tBrMCPlBNn17DlV 0lhokDglNV4BDR3NTWwxY312Ksw8aer3veSjOKr/Mvt5WJaa+n07iCKCIsuSBKStw2vi oUbTWf9jmLtnnbkfwA2tpWbxdxGSq0ytrJrX9hYYgbpWi4Z30OswDRdDlKGuCSDf/og4 EsDMAI88gorgdbX9/VH0UbEe6zPp6pt0n/4wbv66E8Vb1O2/lI9MYWHLZDbg7bY2/gb9 hlug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8UjCoeywOYQ666Hn3NT13CCohim7y7rztb4JyjTH9rE=; b=SdQXal+tar5XdhNa2hH0qswykkQ824T9GKbCflZv+edFjiT4orhehCdNF1IZxTw/wu iSX8xvD7CMEOpztaYb1EWTSK4/9GXH2Df4ITqsXn8Mx33xLwHZBKTueG3qA3DDeB6SJ3 dVu53jG6BcURNkCiSNMjXBaX92fshiNaczSL6CQGMh7xhyGxfP/+5zMICHPJeXxDeQUF iyRdrXttdrZPrWhWzaJUKdK3QVLQORbQQwWj1AHm7nyNGjQl33TJ0v6nSDRHE35hH9tn Uv0m7qXwxhqNxHkSEsiMaAA3ZxMAQNQS/qpODZ6xvJnZKs249KbJpqGIq3qladz70RZx 5iyg== X-Gm-Message-State: AOAM532+vebqSIAL43bc5QJLKMAePAHVFRMfpekRpsUXBZgqQ9SuQOeo 30wDoPp9wMazBW5MqVkUzcZ1HDcvjZM= X-Google-Smtp-Source: ABdhPJxVuC054XVfBvj53wD2gA/L96IYRdBOR29AHI8MnSJgjlUbEjIdrtRoK00czerXUTXxMBaOeg== X-Received: by 2002:a05:6512:456:: with SMTP id y22mr12164631lfk.647.1629414907408; Thu, 19 Aug 2021 16:15:07 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id h4sm388127ljk.4.2021.08.19.16.15.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 16:15:06 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , talshn@nvidia.com, stable@dpdk.org, William Tu , Bruce Richardson , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Tal Shnaiderman Date: Fri, 20 Aug 2021 02:14:46 +0300 Message-Id: <20210819231446.810897-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] build: propagate Windows system dependencies to pkg-config X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Windows EAL depends on some system libraries. They were linked using add_project_link_arguments('-l'), 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") Cc: talshn@nvidia.com Cc: stable@dpdk.org Reported-by: William Tu Signed-off-by: Dmitry Kozlyuk --- config/meson.build | 14 ++------------ lib/eal/windows/meson.build | 10 ++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/meson.build b/config/meson.build index e80421003b..3d5e1e33e7 100644 --- a/config/meson.build +++ b/config/meson.build @@ -339,7 +339,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. @@ -351,17 +352,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') - - # 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/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( ) 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.29.3