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 8A1A5A0562; Tue, 23 Mar 2021 14:35:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 135844069E; Tue, 23 Mar 2021 14:35:58 +0100 (CET) Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by mails.dpdk.org (Postfix) with ESMTP id A32BF40689 for ; Tue, 23 Mar 2021 14:35:56 +0100 (CET) Received: by mail-ej1-f68.google.com with SMTP id ce10so27127500ejb.6 for ; Tue, 23 Mar 2021 06:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mayadata-io.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=x2mJqFRPnjoFRppaMfFky0rkpJyo2EPLDh6GRvzUNuA=; b=07UvOe1KC1wXJ24/iwKnG3ve11QYqeNpcflfL0i6CpSeDucwPxrSsueOB16T0g8fI9 bOuEhxFuQIAdDImAgKPnaKsEjqj8I8ov728iE+7yUxmM/8pEOoeYTVfq0OEtm2kuqZcp lD8MuBlqbrM/VY7ebn1O7gMJfuuMBZ6x7ojs1211BajUWf5cr6obqvNUKIoi+prVcELB 9g3aoNUOyqCfJpsMGbujXRzpiYkX6OKwuxn8HuoRVX1MWDSCHWFMMyRqvZhR9YrDuwl9 zgaTOMo9xvrnft60tzSkhrNNJqDv0CFnsTM0VB6+ri/yJ6BGZQx1HyMbDyXWx5JAD6bs 5fTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=x2mJqFRPnjoFRppaMfFky0rkpJyo2EPLDh6GRvzUNuA=; b=GwCgyRBnoSPhCsJ5JT4GawG8Tx5jLak8rkJumUKD1qK74zzYb3dcrX/xQ1mk55LJG6 VyvxLNsFTS9eITL2+xh3GaBtzgA+5FQ6vwheEQY69RWcy4zwbdlNKTPJJkkbjpzC5/Qg MZXmx9qiqSv2V3A/K4drDxqElRCRFygDVrjQRddU/OomWU1CQkAHFJjInXujItH7U6zD yHwr+kE20k9QZ8fzJLQsbWZsYf/ILCJTrwMdIUrl5JmPeKm3L8AoWzRckpbzjrBkf4If nxwrfpDstae+NVhfjfmDZfqrRcYIG5WsHt3OvsSGkd7bzal+yymgJSJKmOHoQdofhnSt S+LQ== X-Gm-Message-State: AOAM533Z/LkXavTPz79+LLcHPUpSnxtWRNpBBgKXlGiM3xKqt5CJ8Ar5 YaVyaIf0Vyrj9vvPXCwQgQOSnA== X-Google-Smtp-Source: ABdhPJz4tkxf0AKeNTmP62Fre8vv8Qhx3D7HBFomT7I1AAWhskh/XyppyxQCvh7Y01Mpq4jfyUPJSA== X-Received: by 2002:a17:907:10c1:: with SMTP id rv1mr5043545ejb.5.1616506556305; Tue, 23 Mar 2021 06:35:56 -0700 (PDT) Received: from [192.168.0.33] (cpc98320-croy25-2-0-cust77.19-2.cable.virginm.net. [80.235.134.78]) by smtp.gmail.com with ESMTPSA id fi11sm11015859ejb.73.2021.03.23.06.35.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Mar 2021 06:35:55 -0700 (PDT) From: Nick Connolly X-Google-Original-From: Nick Connolly To: Dmitry Kozlyuk Cc: Gabriel Ganne , Bruce Richardson , Kevin Laatz , dev@dpdk.org, olivier.matz@6wind.com, thierry.herbelot@6wind.com, "Dmitry Malloy (MESHCHANINOV)" , tal Shnaiderman , "Menon, Ranjit" , Thomas Monjalon , Tyler Retzlaff References: <20210322140757.7888-1-gabriel.ganne@6wind.com> <20210323011800.2a50fde8@sovereign> Message-ID: <7f3f5e7c-6731-1062-49ef-52e071a076d1@mayadata.io> Date: Tue, 23 Mar 2021 13:35:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210323011800.2a50fde8@sovereign> Content-Language: en-GB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH v2 2/3] meson: use threads dependency as provided by meson 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" > Threads is a dummy dependency for Clang. For MinGW without pthread it still > adds -pthread switch (and it comes to libdpdk.pc), but executable doesn't > require pthread library to run. I can imagine DPDK built by MinGW without > pthread be linked via pkg-config to an app built by MinGW with pthread, then > -pthread switch will be added from libdpdk.pc. Do you think it's an issue? Hi Dmitry, I've done some experimenting with this change and agree that for Clang, -lpthread isn't used when linking and it doesn't appear in libdpdk.pc.  It is added to the compile line, as -pthread, but this doesn't seem to cause any issues. Having said that, my test results above are with Meson 0.55.3. When I installed 0.49.0 to test it out, Meson was unable to complete the configuration, failing with: > meson -Dexamples=helloworld > ... > Compiler for C supports arguments -D_XOPEN_SOURCE=600: YES > Traceback (most recent call last): >   File "mesonbuild\mesonmain.py", line 111, in run > ... >   File "mesonbuild\mesonlib.py", line 1222, in relpath >   File "C:\python\lib\ntpath.py", line 560, in relpath > TypeError: expected str, bytes or os.PathLike object, not NoneType Unfortunately, I don't have time to pursue this further at the moment due to other commitments, so I've reverted back to 0.55.3. With MinGW, -pthread is added to compilation which doesn't seem to cause any issues. In addition, -pthread is added to link and -lpthread appears in libdpdk.pc. My concerns with this are: 1. Adding -pthread to linking is an unnecessary dependency, even though it's relatively benign. 2. Adding -lpthread to libdpdk.pc is more problematic. The application is almost certain to be using a threads library. If this is a 3rd party library, then the link command will potentially include two libraries defining the same exports. Which one takes precedence will depend upon the ordering in the application's build system which seems somewhat arbitrary given that the DPDK introduced dependency is not required. I'd still advocate for: if not is_windows     threads_dep = dependency('threads') endif Regards, Nick