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 81DBB431E2 for ; Mon, 23 Oct 2023 15:06:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F83A40275; Mon, 23 Oct 2023 15:06:54 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id BD8B540270; Mon, 23 Oct 2023 15:06:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698066414; x=1729602414; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=anpNYSLytXfkmXrfj05QH68rgvfFtTfsU+zLvC/mdVA=; b=O+1kNuPtj1J1m4NArf/oOM8Q2T8cvnZf+Atz6JPaa81C3y3h+7KSg6tw pP9KF4BDhEulvhIh5Bv+dKVeBrZL6CuCkhzEJNGgPvOWveNAhv1wPKESy 0AzFm87S7kapuNNVu3D6gimdG+0L+go96HuBnkhBIVuK7M/jIUrbdVCm0 ay8uFQNqlQ9huGB5YfsW5esPOtlbfSzlbzuI+9YeoeTdyrWmMEYQVSzwy Efxl6kJabCsqUGYrEuOuGe6g9rP+qT/q0sCxCm9qWkpyxWDmrg/0hGk/B v7T6fdn6DeRaye8J8PUkBQEyk5TTfsgBOTruS+F5NieYqfbfM+25Q4WxL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="5459978" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208";a="5459978" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2023 06:06:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="823952901" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208";a="823952901" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 23 Oct 2023 06:06:35 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 23 Oct 2023 06:06:35 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Mon, 23 Oct 2023 06:06:35 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Mon, 23 Oct 2023 06:06:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d15cOIo/KmWQJL2XfCl0k3X9k/BVrk0IxEdsFRSxdb1effr7anvH1S7E5omiwWVarNNnzFSfEuScmxgUUvXJn0+cYVOU4x/8U+kYQ3+mAu0RZOVAzWpx0wDyLZmNus9L8dOm1kxmt+wi9MsGEnBzJQrQvY6lu3ftxk05+QRE7lRb8zRUe71UOjLyW1DgOKhyZBO/iYyi+qwnmj6tFDhBXTarHgCvRsp5muvNuwARIkvfV9So232Xydm89Z6jveSLW1RG15HoSa4mzHcQmosj/W0cvWHaKrNR19akPpFtWHqlFDjmPtpf12cg4uQ3X2OY6fBg41+GaKFawmycYaNZIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ojbOZFbaSAB7VPiFz42zBrrTYuGo+28669Yj5smW7CQ=; b=g2p3Sfdu+3E+VPbYcnxxu4OKJBATCGH+SgDs31BsEDLCR/7gvtP5BMos8xPUV7DACUcMb6QklDOSfkDWkiFLYafUG4sqHNZOjtP25nMUK+UcQ4ALvG1OYhR2xIt7MawzgS2aQo9H3RHbw7mSXQseq+0CxPWWeCbAkNTobqgf1yIEILDjYvFZHL9Tid6Qq7zwdt/nRw5hP+140gnUDhtdXFdp/+d5NeVW25lqixQmILsvXeTi36JI1Oo8XG4gK8o9iDxAMcut4a5p3zIFrg3kk4fFHfvNhxVfE7GDH5uBxFEmVdPYMgJjs1+IO3hLgudq831BNgz7+83VooWlrRUqVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CY8PR11MB7290.namprd11.prod.outlook.com (2603:10b6:930:9a::6) by SA3PR11MB7485.namprd11.prod.outlook.com (2603:10b6:806:31c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Mon, 23 Oct 2023 13:06:32 +0000 Received: from CY8PR11MB7290.namprd11.prod.outlook.com ([fe80::4f61:d541:87b4:e935]) by CY8PR11MB7290.namprd11.prod.outlook.com ([fe80::4f61:d541:87b4:e935%4]) with mapi id 15.20.6907.030; Mon, 23 Oct 2023 13:06:31 +0000 Date: Mon, 23 Oct 2023 14:06:27 +0100 From: Bruce Richardson To: Srikanth Yalavarthi CC: "dmitry.kozliuk@gmail.com" , Aaron Conole , Igor Russkikh , David Marchand , "dev@dpdk.org" , "Shivah Shankar Shankar Narayan Rao" , Jerin Jacob Kollanukkaran , "stable@dpdk.org" Subject: Re: [EXT] Re: [PATCH 1/1] build: update link args and includes for libarchive Message-ID: References: <20231020170135.18319-1-syalavarthi@marvell.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DU2PR04CA0028.eurprd04.prod.outlook.com (2603:10a6:10:3b::33) To CY8PR11MB7290.namprd11.prod.outlook.com (2603:10b6:930:9a::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR11MB7290:EE_|SA3PR11MB7485:EE_ X-MS-Office365-Filtering-Correlation-Id: c992419f-f933-438b-9ae4-08dbd3c8e08f X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HB95QDkthpvaYtgNDCvEA1NiE8+mN6SrIAecFqvGqLqgKuCRa3d5iU9jatVGpJ4dn0MJAdManXWYBzyGgo7yEkcn3J/Gi7M12vFq5YvyvWkaQia3UIDJ+6O+1mEvXCfk96zTWyDdeodqrJNEPAAbv9FNb/0dFoXs33dDHyaqSozL1+7D20xBltVeuF0Syix5sAue7Y5bxHp2Z8G/5oz+yLzkIUfYgtEqO7277SC5DhQINFUzYSt94e4EWj2sGVaJKwKk5B6YIesZqkVwhA6NAyKptCvq2C6YcASBTNda1miNCtbMCjaYEJIzluHbgRkEmFRYGWn6l/+8puurzGtMfJUO59gz1CcTBITrMlLcgR6mQskKMLOwU5mwoz9taXWk6yuch+0jwiUiir87CFR+rG/X56pDeQ03sw7Sotlxmb422ESTyA6nroXfKcXLVc+1Zuw7Ueavg2fpApEgCxeNKnhMx/bpgkTFhfFgzVuj4m6ZYOm1n0w4O+aY/QCOWg1clH/nuAP7fgy8pQTon+iyfnhrQiqrLIDp6hgvS5x4Zes= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY8PR11MB7290.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(366004)(376002)(136003)(39860400002)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(2906002)(38100700002)(41300700001)(316002)(66556008)(54906003)(66476007)(6916009)(66946007)(82960400001)(6506007)(6666004)(478600001)(966005)(6486002)(6512007)(53546011)(83380400001)(44832011)(86362001)(5660300002)(15650500001)(4326008)(8936002)(8676002)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zudylHNXMnByIN11uky/fbzOFhSFAksa63LMoRvPFJNGHWSSec9fyGtvTfxp?= =?us-ascii?Q?U4Fur6Z5BDSOcn8ZCeONhUxrzixbJCBmjS2RabPrZyN5fhxzEEdAiyl9LbP/?= =?us-ascii?Q?hhjueDqKyciy88lpGrBkgki6HBt5rmSaiAXHHnCh9dV2KiTmV4YKWUJ1UVkw?= =?us-ascii?Q?ao3JFDse/N4ENhBFRYAyMUJyDApHu3g9PKScn4wyA4OUqHenZf4c0+C17IwP?= =?us-ascii?Q?ntZuRs9RaDC3EeZXgx29kZejs5rbAlQxN8wHNKvnpNJXuFqBdCR12Tcbnvx9?= =?us-ascii?Q?RMNrpWMOjnJI0mFpH1pffjP5APaWWM9hqve86JX6QspOcmyx9zqDMJzmqfz6?= =?us-ascii?Q?zbti4eOLPcT8lfuXEcmx99wZOns2G0XH/AmvwEuMeSseitkvkfHRB3doySi+?= =?us-ascii?Q?vRAhQIjFPEG4i0C3zb0ZoGXxKvYHZcq6eAKp/EKYA1iVTTXd+PtaVoMIEO9m?= =?us-ascii?Q?pvoDj7uW2NwhaSX/QN/lObSJhbTvpEJApX113Yi45NVzUn+2ZUccBHMTQb8D?= =?us-ascii?Q?N+Bcs2fQXthN3xQ/d8qp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OQwzWw?= =?us-ascii?Q?xQsGXDzUViMsFk30iqt+AcNI60O9MCwR5XxCcMO6yIDCFxcSIcDRUKRvqidQ?= =?us-ascii?Q?y/Czq3ovBByNj68L5zH0CeA3XsJYCzkh6JWX5cqxCfYVBLWKJ5/WbsNc6f2u?= =?us-ascii?Q?fIC/Zu8e5LdF+awW4ajd78iHmh/i7iSBxQEuh0kFBp7tbk3ksl4alIEf2swU?= =?us-ascii?Q?pw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c992419f-f933-438b-9ae4-08dbd3c8e08f X-MS-Exchange-CrossTenant-AuthSource: CY8PR11MB7290.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 13:06:31.8846 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MxXXyXFM3smW0wemM6+7CxMUlINWUHD2xxzLp57AGtegsNoyZSwm2pbLUX5XyH6NnBfasWbs9mSLml3R5G79YB0v1a73awQsRBN4g/BdiSE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR11MB7485 X-OriginatorOrg: intel.com 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 On Mon, Oct 23, 2023 at 02:00:33PM +0100, Bruce Richardson wrote: > On Mon, Oct 23, 2023 at 12:46:59PM +0000, Srikanth Yalavarthi wrote: > > > -----Original Message----- > > > From: Bruce Richardson > > > Sent: 23 October 2023 17:24 > > > To: Srikanth Yalavarthi > > > Cc: Aaron Conole ; Igor Russkikh > > > ; David Marchand ; > > > dev@dpdk.org; Shivah Shankar Shankar Narayan Rao > > > ; Jerin Jacob Kollanukkaran > > > ; stable@dpdk.org > > > Subject: Re: [EXT] Re: [PATCH 1/1] build: update link args and includes for > > > libarchive > > > > > > On Mon, Oct 23, 2023 at 11:40:14AM +0000, Srikanth Yalavarthi wrote: > > > > > -----Original Message----- > > > > > From: Bruce Richardson > > > > > Sent: 23 October 2023 14:56 > > > > > To: Srikanth Yalavarthi > > > > > Cc: Aaron Conole ; Igor Russkikh > > > > > ; David Marchand > > > ; > > > > > dev@dpdk.org; Shivah Shankar Shankar Narayan Rao > > > > > ; Jerin Jacob Kollanukkaran > > > > > ; stable@dpdk.org > > > > > Subject: [EXT] Re: [PATCH 1/1] build: update link args and includes > > > > > for libarchive > > > > > > > > > > External Email > > > > > > > > > > -------------------------------------------------------------------- > > > > > -- On Fri, Oct 20, 2023 at 10:01:35AM -0700, Srikanth Yalavarthi > > > > > wrote: > > > > > > In order to avoid linking with all libraries listed as > > > > > > Libs.private in libarchive.pc, libarchive is not added to ext_deps during > > > meson setup. > > > > > > > > > > > > Since libarchive is not added to ext_deps, cross-compilation or > > > > > > native compilation with libarchive installed in non-standard > > > > > > location fails with errors related to "cannot find -larchive" > > > > > > or "archive.h: No such file or directory". In order to fix the > > > > > > build failures, user is required to define the 'c_args' and 'c_link_args' > > > > > > with '-I' and '-L'. > > > > > > > > > > > > This patch updates meson build files to add libarchive's > > > > > > includedir and libdir to compiler flags and would not require > > > > > > setting c_args and c_link_args externally. > > > > > > > > > > > > Fixes: 40edb9c0d36b ("eal: handle compressed firmware") > > > > > > Cc: stable@dpdk.org > > > > > > > > > > > > Signed-off-by: Srikanth Yalavarthi > > > > > > --- > > > > > > > > > > Checking back through the mail archives I'm still a little unclear > > > > > as to what breaks when we try using libarchive as any other package > > > > > with a pkg-config file? I would have thought the best solution was > > > > > just to add libarchive as an external dependency, found using > > > > > pkg-config, to EAL. When we add it as a dependency, rather than > > > > > using c/ldflags, we should get all this path fixup for free? > > > > > Can you clarify what breaks when we add libarchive as a libeal > > > > > dependency only? > > > > > > > > Below is my observation. > > > > > > > > In current implementation, we are looking for libarchive's availability > > > through pkg-config. > > > > When found, we are setting RTE_HAS_LIBARCHIVE=1 and adding '-larchive' > > > to ldflags. > > > > > > > > Since, we are not adding libarchive to ext_deps (to avoid linking with > > > > deps.private), the > > > > > > This is the bit I'm a bit stuck on. What is the issues with adding libarchive to > > > ext_deps? For other libs, when doing static builds we have to link with > > > deps.private and it's the correct behaviour AFAIK. Not doing so would surely > > > lead to problematic builds, no? > > > > I agree on adding to ext_deps as it's the correct behaviour. > > > > However, there was a discussion in mail archives regarding this. > > https://inbox.dpdk.org/dev/20210605004024.660267a1@sovereign/ > > > > Adding Dmitry Kozlyuk for comments. > > > Testing it out myself, the sample applications don't build statically due > to missing dependencies. The libarchive-dev package on Ubuntu, doesn't seem > to install all dependent packages for static builds. > I had to manually install liblz4-dev and libacl1-dev packages, and then > test-meson-builds ran successfully. > > Personally, it looks to me like a packaging issue, in that I would expect > the -dev package to install all required dependent dev packages. I also > think using the pkgconfig as a regular dependency is the way we should look > to go, and if necessary, document the list of extra dependencies needed for > libarchive in our docs. > For reference, here is the diff I tested with on Ubuntu 23.04: diff --git a/config/meson.build b/config/meson.build index d56b0f9bce..4ff101767e 100644 --- a/config/meson.build +++ b/config/meson.build @@ -236,11 +236,6 @@ dpdk_conf.set('RTE_BACKTRACE', cc.has_header('execinfo.h') or is_windows) libarchive = dependency('libarchive', required: false, method: 'pkg-config') if libarchive.found() dpdk_conf.set('RTE_HAS_LIBARCHIVE', 1) - # Push libarchive link dependency at the project level to support - # statically linking dpdk apps. Details at: - # https://inbox.dpdk.org/dev/20210605004024.660267a1@sovereign/ - add_project_link_arguments('-larchive', language: 'c') - dpdk_extra_ldflags += '-larchive' endif # check for libbsd diff --git a/lib/eal/meson.build b/lib/eal/meson.build index 9942104386..e1d6c4cf17 100644 --- a/lib/eal/meson.build +++ b/lib/eal/meson.build @@ -21,6 +21,9 @@ endif if dpdk_conf.has('RTE_USE_LIBBSD') ext_deps += libbsd endif +if dpdk_conf.has('RTE_HAS_LIBARCHIVE') + ext_deps += libarchive +endif if cc.has_function('getentropy', prefix : '#include ') cflags += '-DRTE_LIBEAL_USE_GETENTROPY' endif