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 35F46A00C2; Mon, 22 Aug 2022 13:23:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE49A40DFD; Mon, 22 Aug 2022 13:23:22 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 802D840694 for ; Mon, 22 Aug 2022 13:23:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661167401; x=1692703401; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=RFHho/ijBrFNflvAARugyBbP5w66WLlRwg8K2NqPbMg=; b=eijlyKOY7gUCv/uU6AnuvjbNLJQhDR4XlqwsesRCyuena0887PYRJs8N P0/BJv2f0XbaYj5Ni6VtRRMHWYwjScdJfRvVNYitsMX4ZkffYYmiWiYN9 mnCZFHBmLRqCmk1/Khpig66h3omA+rxLPotJhWrKicAN5fc/gagnQ7NEU WaSUbuYhAEcFdjb5s7hvZsRruhOGGFvpR4bJtKqD9nFpWUfohK2Y377On D/uaRAz8RGP+ubfs1BtLpYH1BUGd+5EP08z8ajHQHp9dHz1myMs2NL4AL BWjbmRORZKrV7GtKac3wMspHjijJ1RpKulB6vpXItWX9TIaoSAjlsBeL8 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10446"; a="273775340" X-IronPort-AV: E=Sophos;i="5.93,254,1654585200"; d="scan'208";a="273775340" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 04:23:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,254,1654585200"; d="scan'208";a="612015828" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP; 22 Aug 2022 04:23:20 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 22 Aug 2022 04:23:20 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 22 Aug 2022 04:23:19 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 22 Aug 2022 04:23:19 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 22 Aug 2022 04:23:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V+EjP5jDNQIH+4wP85csPKfs1C9H2nQm5FY0aGjLvxSN0k1lAHagWZm+veP/lDBG3ekbTIafI0otWKd6exmdrsYgcg/CV7lbrgAnlz+YqGf693Tn50BfpwQbKQrgx9mE0CzpE2MHRqIZK1SnaAbmzfROizEcU9Vamup3g7/scMa2YzyMtdYzMSbZNj2Hbm7HccYVVH25p3EPQUs9NzOEy+G4C99b3ubWkkivhh+VM+2ubzYW5K+9porVQhRei/Sho7BZxWrE/o5XbBtlkhwmy5vxVH/+3OnceLlODvZG01sd+Fe+fMT8oGsl4If3Bs1ZXy90RUlJiQSisPSLmVd7ew== 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=hu/dVoJyLOMgr/HFuPenEiIsm6h3yEEgAtxi25aoi5A=; b=MKUe6YCicvknoeIiB1jJR1bs3blIBqfnGcFZjqOCot5iEn8dNK30OLzIRlz7RF+9QWOC+CsWts4rhuOsr6KwvvVtqu0ak0hbeAELeJMHA8S6cfSh65u/wgzcRcrXOtHeGFpH4uKWXjwMx9yViQQxUZboIYNelyNpj5JY0+WxgiaVjW2xEQkRkRDBPqHeI7usPylibkY5GJEXg27PrvVCDupWGAw+T8XYQEDClmuABzD8qkGqznJ64roqJNxV4HhUJ1xx653RP+y35xoC2kJUXEHzQvNzpMZ2eiqnZkhpRg6tN2G17ZI9E7IlUaOz8fc9J6pDoVRHC1Ol9LNyGuvoJg== 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 MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by BN8PR11MB3777.namprd11.prod.outlook.com (2603:10b6:408:8e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Mon, 22 Aug 2022 11:23:17 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::45e7:a552:2663:5f0e]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::45e7:a552:2663:5f0e%9]) with mapi id 15.20.5546.022; Mon, 22 Aug 2022 11:23:17 +0000 Date: Mon, 22 Aug 2022 12:23:09 +0100 From: Bruce Richardson To: Jianshen Liu CC: Subject: Re: Reason to alway to build both static and shared libs Message-ID: References: Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DB6PR1001CA0018.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b7::28) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0dc957e-b34f-4bf1-9ae0-08da8430b595 X-MS-TrafficTypeDiagnostic: BN8PR11MB3777:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g+jsIvOw3wIwwUYwkpnNGN2xRbZxA2hABmuMeG/V3FXnWX6rM18GMerskRNPBxB56D5ae3wz6KxVJzfpRqt9hihlCDeWBeyW2GxZpq9vaIVZio+0GDHuJuoqqaTMEU/Ci1NCaVi8icpCdmy+NZ6yXUnla+Jfkp4UaCdlc3mm3/OwszHpQxMG/LSEnl5ecd4YUT6bXyuAu8L1dFKglDFvCwAgXXs1gvjXaterG18G2h7XpYVM36h5bIgcOkuo2QJHcCweYl7A1/L7qThhOiC2ZTOPUOXI3oh408X02NENRRXZccwW+vMIp5hc/LkZdg+jqr6jYOtLLs5AifgpyGOBmziDpKYzNhfqRXWq7LLvd6Z2gJ8j6U+WX5lHXkfo1pSqzUJMklbeC8tcuScODU/DWLifWOJQMsI59wZFlwa4eVItcOzSxQ2szSxhEwbik2N+2CHE3SZ/KghVW5cfns7URl9gjJzA62uYUd1tQFtD7JEBoeO0RK/hhHr40AWJ4OobpNHQkIVXWPDjCnmfLtAGNlXhxgjyRDo3K/vLWcdem3HJs0aQUXD0P2zd1lZg0K8hppWK5qNQn9DM+DTVGmDXUR8g2YGgbBMiAK4pks4JF3EB/+MfZcQ0E8wDgXMRR3iuKFOxvdBVXcFE7i/SUFEDjjpSY2GsdYIEEZH3nUaPQwLL0T7e9jWdf7XSNcovOpdrZhjhCH3wVM6A3kt6ZaOqTA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(396003)(39860400002)(136003)(346002)(376002)(83380400001)(2906002)(44832011)(8936002)(4326008)(8676002)(66476007)(66556008)(66946007)(5660300002)(6512007)(41300700001)(6506007)(26005)(6666004)(186003)(6486002)(478600001)(82960400001)(86362001)(316002)(6916009)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ty45wvF355FcKYK0ph6d/dh245EZ2Qc9X7TKV1Iffue3Z5YwQiTOuz5oT2p9?= =?us-ascii?Q?YZBx8g3/1gM8XAgjjUSLQG2xehLSRFKJpC1/0ErWw38MR0IRKiWfKUjcT1eI?= =?us-ascii?Q?g/8YJWZnZtoAkEE0isIFCcQ34FZDiNYyqixn0nRuYGMkINTlsImKaYQDROfL?= =?us-ascii?Q?pxGNQ8k9jWzQPqZ3F+7kOyC3aMKgXeocnEa0+C1iFK3aS8POoULju/DsIqua?= =?us-ascii?Q?h4GiwFbDz2kmYQ/tlHoM2779WCSBGczWvI1poqsVzO8J++LgFM4t9ofEHDif?= =?us-ascii?Q?9I5WWumK05lMJdlmPYgR+7oln2FkRQatXZQ1ydyZSUDoyQwnCy1xoSUa0+3x?= =?us-ascii?Q?I1IC7a2MHlD2RtOFx3sl+rckh+sub6kadOXrqaS4jjlK25HzhflX6d+TbTXF?= =?us-ascii?Q?Rvir9jWX0jTkp6jfbHEUWSPq3ZosAfAZ0mmy+Q6EkQgbFqRYt10KaR1mhSa1?= =?us-ascii?Q?q4fyX0Med+dVBVjvCwpZymD7iyqhjp7q1kO0MsbYxuyYd7L66tD3vbMMYTpl?= =?us-ascii?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sXitOla1qiNtpOeH?= =?us-ascii?Q?fMs6bpExQBuAf6+ZYkyu0DUq5QlmvHobspasK1z/bUJotK+FevNTywyRaioe?= =?us-ascii?Q?IAytCLZG4Y0FJbmQQrsbuCM8plf+N15swEXMZs3EAdxb7PQwmta8uNihlngG?= =?us-ascii?Q?CeBy7jKujDFFUTp0ZxbXwpif0dK5VG+JSeQG2oaqYgilfaB9zzjlZdWExxns?= =?us-ascii?Q?zQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: f0dc957e-b34f-4bf1-9ae0-08da8430b595 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2022 11:23:16.8779 (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: 5GnZmrPvXxJ4JZAiZ2BOpPrlK1izJ0l2QOzl/JYAQMuTInXx/8qDkMI3p54VSGODLfcKJXgxc6i9/Vu0JqwSnG5hmVXE/TyFwZ+tDnNIrdk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3777 X-OriginatorOrg: intel.com 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 On Wed, Aug 03, 2022 at 10:13:24PM -0700, Jianshen Liu wrote: > Hi all, Could I know the reason for always building both static and > shared libs of DPDK? I can find the [1]patch to enable this behavior, > but it seems that it didn't mention the reason behind it. Also, if I > propose a change to use "both" as the default for default_library in > meson's config file and still allow users to choose either static or > shared as they want, is there any reason against that change? Thanks, > Jianshen > When DPDK moved to use the meson build system, there was no "both" option for static and shared libs, so that is the primary reason why it is not used as the default. As for why even without that both libraries are always built, the main reasons we do so are: * traditionally DPDK has been built and linked into applications as a static library, and when moving build systems from make to meson we wanted to keep that as the default, since the transition was already confusing enough for users. * with the older make build system when users submitted patches to DPDK there was many, many cases where the patches did not include changes to the version.map files, leading to shared lib build failures. By ensuring that shared libs are always built, this whole class of patch errors are caught before users push their patches to the mailing list. Therefore by always building both shared and static we can keep consistency and ensure higher quality patches to the mailing list. I have looked a little into this in the past and from that investigation some other considerations are: * We can't actually use the built-in "both_libraries" option in DPDK directly since - due to ABI versioning - some files actually need to be compiled with different flags for static libraries (which don't have function versions) and shared libs (which do). This means that even if we do use "both_library" function, or "library" function with a default of "both" we will still need to maintain the code path fallback for building static and shared separately. * The built-in option for building static and/or shared libraries only controls what libraries get built - it does not control what way things get linked. Right now, the default in DPDK is to build both libraries but link the applications like testpmd or examples, using the static libs. If we use the defaults in meson for "both" the shared library versions will be used for linking in preference to the static ones. This means that if we switch to using the default_library option for building only static/shared/both we also need a separate flag for indicating whether to link apps statically or dynamically in the "both" case. I'm also a bit curious as to how much benefit you would expect to come from this change. Since in 99% of cases the C files are only ever built once and then put into the static and shared libs, I would not expect there to be a large build-time improvement from disabling one of the library types. However, having never tested it, I may be wrong on this and there may be a boost from disabling the shared libs - though that in turn means fewer build-time checks for the version.map files, for example. Let me know if you do try it and see a big benefit. Hope this input helps. Regards, /Bruce