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 92A2B41E93; Tue, 14 Mar 2023 19:32:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 213BD40F18; Tue, 14 Mar 2023 19:32:37 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 2614840A7E for ; Tue, 14 Mar 2023 19:32:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678818755; x=1710354755; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=zk2Nthz6318+peahfkzchfZUPt/qM8VJifwVi+6je/U=; b=kDYkWfhv3pUREweLq0DT0YJ+rPkwiuowHAPvtJr/Cl1eBvqJL2hgOhQB vT51s3VFuPM/33sndnm6XUlkzYnrnImZ/pA4KC0hXCwr7DkeEPusJby6H g3JFeW9pWS9Nq313a+miQV4cr8itcHPuOzUHSEs5oW7V2P3PbxgZTK2XL eRTPX4cXilrYPZulaES2KkpILuSRRacVZYEvSF/bSUF5ZLlR6tcJWzKmr 456qZ1Hg11sezdvwJu3f7VRjqu8fC47mQw3s2sznWnPR7ZmVQ77HVdla/ bYi5yLmcJg0PlIp+5gnLSdAOnTR1cCoiPkh/hyow+7pzYzbl4KPcI3qxT w==; X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="365181718" X-IronPort-AV: E=Sophos;i="5.98,260,1673942400"; d="scan'208";a="365181718" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 11:31:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="802970202" X-IronPort-AV: E=Sophos;i="5.98,260,1673942400"; d="scan'208";a="802970202" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP; 14 Mar 2023 11:31:50 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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.2507.21; Tue, 14 Mar 2023 11:31:50 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2507.21 via Frontend Transport; Tue, 14 Mar 2023 11:31:50 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.108) 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.2507.21; Tue, 14 Mar 2023 11:31:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HBbmVj8T+Cq7fdiA0PTXBHsbjreGUiS4qL52hN6eKexwOPMTkASTQcEg9fjXTIr8uYrX7qXAuSHaMVm2xpSG5HybxCGoIKM3CoeoApPywzUeClqpP7R3kMAOCsb3/eKXvyHKKzeGTowSe+zia4cd43pqL6iAIZkyAYsiVKufhTkZnr02g4WpC8kyjRRPiBLc3PuuQyKChaFGR/mb/jsH8Ct7oyykj/Kn5TWi10urcdYIJccpOCOWuqAdcoesmF7Z8ooePj2lCQ41OwIpyQNXBgz/xG9jUlmg5Q7iX0l7c2saCQtI5hsrZTIuUF2vtzZ2c7wCyg/JGfQ3OgQe+qZqyQ== 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=EcJe6v/NHgHd9N66JPhlRsh0ZpnSoNfmTByYUugQGK8=; b=mWQaD/dBsYu5ytQhupOtVw5mSTkuhEJv0ZbA6kCzFY53JvtBYVuEupSHZN1rcRr3zPXPFcf39ydrbAKPIAH8p5uJc9/XKPYZny1cMd8pkDp26Tk/7oLe3xiUcBCu9QH0wZ2nLj2ClhswokKJjIwwZlH36vYxz2sv6Eyanl8unZmxIILbXCR88dxd+r3hym0Wbj5dpB05cscszvKhAr0m41N/GH3L7Ov+d/1AvcNtoSlWQ0oKBHxxQOhbiR40dn5xW7X1hRsJdVhkUUZufqtXcRQRhq5NStB9AAr61d73k+rQRXC6y1SfPnqDMgZW1+q9hSWpsQoVptiuDqMqhjDJkw== 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 DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DS0PR11MB7409.namprd11.prod.outlook.com (2603:10b6:8:153::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Tue, 14 Mar 2023 18:31:47 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c%5]) with mapi id 15.20.6178.024; Tue, 14 Mar 2023 18:31:46 +0000 Date: Tue, 14 Mar 2023 18:31:41 +0000 From: Bruce Richardson To: Mattias =?iso-8859-1?Q?R=F6nnblom?= CC: "dev@dpdk.org" , Mattias =?iso-8859-1?Q?R=F6nnblom?= Subject: Re: PIE static library builds Message-ID: References: <075645fc-f40d-82c6-52d5-ce8b23f3cdeb@lysator.liu.se> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <075645fc-f40d-82c6-52d5-ce8b23f3cdeb@lysator.liu.se> X-ClientProxiedBy: LO4P265CA0242.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:350::16) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DS0PR11MB7409:EE_ X-MS-Office365-Filtering-Correlation-Id: aed7fce4-3475-415e-ac0f-08db24ba5e1d 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: kw7E7wpMJFsRYe434fW2A9EYyxlsU1TPD1Eq9A2ssPVsnD++Ke7xGsPMl8IF/Ta6ZMies6/BaYYJ4NxGsI+JA/oNwxlwnjPuSAtGdLxRBNeDnuzpyOtQtkenbOpOTPdQ89DMZ2LFr8sVTjVpUnq9fPmLQ7oolofno7a1xBQtem5Ac9gNqbTjkno4n4SgY1Fe0BIKsr3Om9aaaSthE3ilD/ZR0UiAxuZXWVDwszWPgduTRFnxHkcUeZBkkF61FPEqsTSVEqRkEljY3csQiXc4nrycSZpWj29S6zkknYf/2UQE3bSjpYnQwh5K44BzhG5pvErLc++lrV5Y2pxPSyIguwG1oT7gUEzERGNNQqKsZggfq+3YqcZ+lc0EuYfyHNf0xINaqS9kYwjfn00QwuTF4tiouzGJv7xEaSN1KnU/79V9leSatUd0GgtfIMJa8ka66C/F1FcwddIMhVfgv1fSW5dF1ky93wAYmtwuVN+mcQC1UEOpD8nNBF9X8uSni7segTtiyi9lbKfeZBpXHE4Jzcg50gsnvG76A3im4jrUwwhAhp7s+z8/76mMqNjTUC9z4pqnmzhgFEKckmAttRXifoyLJoCeQl0MZ9BKwRacafZPTQmfdagJQkdllJL1UJAD0FzfatBV0hUZ0sjZoeavHw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(376002)(366004)(136003)(396003)(39860400002)(451199018)(8936002)(5660300002)(41300700001)(44832011)(2906002)(3480700007)(86362001)(38100700002)(82960400001)(66556008)(8676002)(6666004)(66476007)(6486002)(66946007)(54906003)(478600001)(6916009)(4326008)(6506007)(316002)(296002)(66574015)(186003)(26005)(6512007)(53546011)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?zOhN0xT02UpUSCXBZXd2WW6TcAW+CaUoS06FOzDuoyphXSYNS391qnryAt?= =?iso-8859-1?Q?pVic+t8fXY01mEqVOktGag9GNAWV+0IvgfwSFsfuhuMxlsvh+ISG8kEmsK?= =?iso-8859-1?Q?MnZ6a+Hmf7Ze4Q1skLEdxCwfQKNxSuNBFkWB318U+Wcfi4nLZ35j/ACu6d?= =?iso-8859-1?Q?H0JW7Lve5W/EMCDKLpcPW8fQfK8YI+u1J++z6CSyWKjWgJBqOrGkDcYUIT?= =?iso-8859-1?Q?2MBmJCu7IqoM2caUC16FoaPsXxhOwFOrRBCX1I8q1uJTNGjnKx9gkl7oZE?= =?iso-8859-1?Q?ckadGxnjLqrZNZXQmQURfSXF/QdPpc9UFI8DjUvx1YVRhHUoF08yTAW/np?= =?iso-8859-1?Q?0EvDI+zKZy6mcIF9qr66t1ttfVK81SRdyyLUObljqdAldt3gw+QU+z5A51?= =?iso-8859-1?Q?IGZO+plbFZWgp4zFEoL8BHMdfnkPpeS2009dBVBHnaLRqsXsRcSNlm5ksr?= =?iso-8859-1?Q?iqhRGlsU21DOwOKqN5Qkep6JpqrS/Q38HddLrSrAe3B1yxqG7ki3hhZV0l?= =?iso-8859-1?Q?6vrng75Z4znqEe52mmEgwYXaq+pI/fg8YoJupmR2zY3/K03CkJQQIg6WsI?= =?iso-8859-1?Q?NX3oPltAqsewlJh7YA30GP7bWqcbmpCjn0EaP7FAdSpZwW5L2zyPCIDkwT?= =?iso-8859-1?Q?h5d4bAWkghC9UMjHjKAV0N7c/kLODNvEgl6tgnLL0R9w8KYTSDARsx5Dg/?= =?iso-8859-1?Q?p454Blgogo2nSu1JqTEf6Kif6le10G364gBLNPB9+GkoQBS8b2dX5i5Hlf?= =?iso-8859-1?Q?CEBQauxP+/+A25V75D0Hdc01VBvmG3DHLM74LjMuETeGFjwXdOiab3Whey?= =?iso-8859-1?Q?1sOJe4utDveXJ39x3ELFxopN6WFi911jttMYpSODSfkpxeOfdiznkvYIud?= =?iso-8859-1?Q?tyAZ2y/gDYbkYJbmnhXvN7LFpudrtTnBRf+QtOAODurTCwYLucU+vfV6TA?= =?iso-8859-1?Q?u177UIwNy2+bxZ1dE15KShS2kX8HsrM1ooNOnujiol2DXlCEe6m7XFc/9/?= =?iso-8859-1?Q?9TlHBL35Lw2v1ChLn3jwpNJ/rEvFRDRyj1+BJCWw6D2W/5xXTPr2P6nz/v?= =?iso-8859-1?Q?gViMeP4ZOH4muBHafMS1nPfj30dgfo/F8Dengw04FHMbrNwZumllACFYm/?= =?iso-8859-1?Q?BtfXQoo9KTlmlzmS45lWVGUqYhxAF24nR7ihmcVGNaHn8Ot+4Qcuo8oJ0U?= =?iso-8859-1?Q?uVROsDRR/aTb4JcIRAqnYQUfHboZwqsh0wctzthMewmgmW3apXax2NEEaQ?= =?iso-8859-1?Q?MqKmt//QVcfplDyBZss189ixW2BB3CdW0X91+jeBEG8845vUvAgUVagFOl?= =?iso-8859-1?Q?0ic8hgiHQGQiCAnm89uRZ0fbnSo3QZ6U4ynNJnoTDkfuQh5TAHZE127Zhy?= =?iso-8859-1?Q?/M3Dj1ELVY7ejhs/PbHdbi1hW4dlWZXpihg9cKBsa1i+SReL3iVhrKVx8F?= =?iso-8859-1?Q?DHqQ5TjLmD/2y3XSghXt0L4Idco5c6ULa1U5oP60V5cO9ZyEQSiaXsyCMB?= =?iso-8859-1?Q?GG09UgxF6IXmG2t7KyWX0NSCXFZqzBhVIqwpuMhkdJcjk+X3BkKRvo0mDh?= =?iso-8859-1?Q?3rLpnZtLLTishkojJ/Xg4V/z5Fd8SS6T/uWQfa5liJMDN8LW7vCPCI6fKW?= =?iso-8859-1?Q?PdG4Qux9VbKwxi9yI1Vd5Ph9U4CaoB2tIKeGTOJvXymmYXFWd9wYrEyA?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: aed7fce4-3475-415e-ac0f-08db24ba5e1d X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 18:31:46.6296 (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: AHS1dd2mEl1YgEb+iGJB2OgBbn80zXvfk5piFIabIE33zq3GJHFB5kv9Tlmk0ULpRF2tg6eBOZj3NdC1RcfJlBfBeRzVP8gJdhonA8q+3rw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7409 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 Tue, Mar 14, 2023 at 07:04:19PM +0100, Mattias Rönnblom wrote: > On 2023-03-14 17:29, Bruce Richardson wrote: > > On Tue, Mar 14, 2023 at 05:22:02PM +0100, Mattias Rönnblom wrote: > > > Hi. > > > > > > Is the "b_staticpic" meson build option supposed to work with DPDK? > > > > > > Setting it to "false" (default is "true") causes link failures on Ubuntu > > > 22.04, with GCC 9 and 11, on v23.03rc1 and v22.11: > > > > > > /usr/bin/ld: lib/librte_eal.a.p/eal_common_eal_common_errno.c.o: relocation > > > R_X86_64_TPOFF32 against `per_lcore_retval.1' can not be used when making a > > > shared object; recompile with -fPIC > > > /usr/bin/ld: failed to set dynamic section sizes: bad value > > > collect2: error: ld returned 1 exit status > > > > > > Does something per-lcore/TLS-related require PIC builds, even for static > > > libraries? > > > > > I don't think that is the issue. The "issue" is that DPDK always does both > > static and shared builds from the same object files, so without -fPIC the > > shared library parts of the build fails. To support not using staticpic, > > we'd have to disable building the .so's in those cases, or each C file > > built twice. > > > > With "default_library" set to "static", shouldn't the shared objects be > skipped? I can see now, they are not. > Yep, they aren't skipped. The reasons for this are partially historical, and partially due to meson limitations around linking (which may now also be historical). When we originally switched over to meson, IIRC there was no "both_libraries" option, but we still had a situation where: * we wanted to use and link staticly by default * we had *lots* of issues with patches breaking builds as submitters had forgotten about shared libs e.g. updating the version map Therefore, from the earliest versions of the meson builds we had DPDK always build both libraries - using our own logic. [This did have the desired effect of mostly eliminating version map issues once everyone whiched over, which was nice!] As things moved on, meson did add support for "both_libraries", and I did investigate using it in DPDK to have proper static-only, shared-only and both-library builds. Unfortunately, the assumption in meson was that if both libraries were built, the apps would link against the shared versions. Therefore, any change to use "both_library" support in DPDK would unfortunately lead to a change in default behaviour as our builds would all be shared, rather than static. [I have not checked recently to see if this can be overcome.] This is why things as where they are right now. :-) /Bruce