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 DD62FA0579; Fri, 9 Apr 2021 10:31:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6192E1413E2; Fri, 9 Apr 2021 10:31:13 +0200 (CEST) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mails.dpdk.org (Postfix) with ESMTP id B40451413DE for ; Fri, 9 Apr 2021 10:31:11 +0200 (CEST) Received: by mail-ed1-f54.google.com with SMTP id 18so5577175edx.3 for ; Fri, 09 Apr 2021 01:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mqUEugTN3OHQCTsPaUvdVTWmfm/GQFeGThx/6Nz1LmI=; b=Q8ldblGod4MTEfemi+UnNz8sU3o/Y+I/Ux1iQD7ZJkCNHg5Cbq5N9sY1aAsvVdvjhk moh7z6ksr5NDdy73zPFCIpw+OD6bYQNQ39PqUxFRx9u6E9+JEf9kqLirPsRQ1s9YcYtb MQFNr1CAJiUVEDLJlo6GDaH4/sCQ0LCAk4huMIMw4O0m81XSukBI6qpP2KAxbicXwyB6 HD2suLG5OGcjJHCaYBes8JN6/RV0V+1862d71lvxk5MFb4q3FnB29m5Os6VfJrPIcSOX ppQqNO3JGDbm9uOEwAMM2Lrfzjhucdi8gsIX79qLUAe2FlYh1bEviE5GvHC2U00nBvZa mL6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mqUEugTN3OHQCTsPaUvdVTWmfm/GQFeGThx/6Nz1LmI=; b=r6e5458WgaEx2z85Rnn8J/fxXNTryNVbIiVz0qtFziKDY/LL6yM8Y6K3QHFyvGAd8f 6/7unMTD+4S7i//0TpFlJaiAFwjtFnUBkmaREEjOmmBZd9yqxZNbO1DdyLv3l84S91A+ XcrSYlhhv8UWHiORCbTupWPy7cC+aTMTlx1G/AasjjWUBP111XY142cSsJQGrIWAUrgl pXvfc4JN1jgyfSbVgeOd1EFFOTcsNnzBUXXQKUm76Tf+R0VOLZX/LfYPO4G7Nejih/ND TwzDHmY9AvW3gbe+jOsM4isqy+pd9xYQOJOGg3xi1FMrhcLYzz5GyzbxsQVpmrwoKAHI qJPA== X-Gm-Message-State: AOAM531AHkvbybRR+YQYWwbhu6aJaZeM902AeofTcVFUUm1vaewj4cNa q+ReWEp6UAPw1Ca8h53tRsWiWHFlwsO1ATgfdmfyug== X-Google-Smtp-Source: ABdhPJwlrCkda04Kbtsx36CbjQlvx5nqdUYWqrqdzzuGfBmPSzgyJFBZ0Ox35JF3mK3Lb6EUxl4QhLwihdlfsz3eED0= X-Received: by 2002:a05:6402:27d4:: with SMTP id c20mr16458390ede.271.1617957071450; Fri, 09 Apr 2021 01:31:11 -0700 (PDT) MIME-Version: 1.0 References: <20210326082223.1398-1-gabriel.ganne@6wind.com> <13049033.jPmt81Ii10@thomas> In-Reply-To: <13049033.jPmt81Ii10@thomas> From: Gabriel Ganne Date: Fri, 9 Apr 2021 10:31:01 +0200 Message-ID: To: Thomas Monjalon Cc: Bruce Richardson , Thierry Herbelot , dev@dpdk.org, Olivier Matz , david.marchand@redhat.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH v3] meson: remove unnecessary explicit link to libpcap X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Thomas, Thanks for the review. The use case that made me see this is that I configured the dpdk using meson option "-- default_library=static" in conjunction with buildroot which is patching meson to prefer static libraries in this case. This causes the link line generated from the dependency() directive to result in an expanded "/path/to/libpcap.a". The dpdk_extra_ldflags += '-lpcap' is a direct (manual) addition to the link line that cannot be changed in the same way. In this specific setup, the change is the following: Before: -lpcap /path/to/libpcap.a After: /path/to/libpcap.a I admit this is quite the corner case (and probably not a great idea). I will replace that confusing second paragraph with the comment you made regarding " ext_deps += pcap_dep". Best regards, On Fri, Apr 9, 2021 at 12:39 AM Thomas Monjalon wrote: > Thank you, the fix looks good. > I would like to improve the explanation. > > If I understand the issue, the title should be > "build: remove redundant libpcap link" > > 26/03/2021 09:22, Gabriel Ganne: > > libpcap is already found and registered as a dependency by meson, and > > the dependency is already correctly used in librte_port. This line is > > just unnecessary. > > To be precise, the pcap PMD and the librte_port both declare their > dependency to libpcap with a line "ext_deps += pcap_dep" > and meson automatically adds this dependency to the pkg-config file > in the private section for static builds. > That's why it is not needed to add the dependency explicitly > in dpdk_extra_ldflags (involved in static build with pkg-config). > > > It also has the side effect of messing with the meson link line: dpdk > > Which "link line"? > > > link will be declared twice: manually and then through pkg-config. If > > What is "manually"? > > > you configure meson to prefer static linking over dynamic, this will > > No need to configure meson for that. Static linking can be tested with > make in an example. Please avoid messing with meson explanation > for application linking, it is already complicate enough :) > > > cause the build to fail on librte_port, since the pcap deps are not yet > > seen by the linker. > > Sorry it is not clear to me. > I think it would help to see a before/after effect on the link command. > Something like: > > before: > Libs.private: -lpcap > Requires.private: libpcap > after: > Libs.private: > Requires.private: libpcap > > [...] > > - dpdk_extra_ldflags += '-lpcap' > > > > -- Gabriel Ganne