From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8CF21A0613 for ; Tue, 24 Sep 2019 13:52:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD5B01DBC; Tue, 24 Sep 2019 13:52:31 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 2FB281DB9 for ; Tue, 24 Sep 2019 13:52:31 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id a3so1177783pgm.13 for ; Tue, 24 Sep 2019 04:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=F08nW+gA4JPOKtj6javuvjgtTFdxKiyyhVsFgOaYFXw=; b=Ws9BRZHx2rCAbCCd+SoC+IQ3J5HiBwpy+mjm68hlTr/69cN7/LTLF4uTUxqcYndKhu dRapWlZRastfx9TTxcbB07Dgx6EzsW+ChkXtwoyCt5y6PNWOW7hEnhb+lFQdJ42Q4i0V W/AA/aAZZrS5KALMB/Ixv45ZZfhXYxHjc7oGt7BY2VNXP1aOLQhLtWW7FM9jvc6zL1jW WU9b+ephyKjUoMhArT/KqMjidGwPylw9jafoI6068ESBc+F4U/tIimvOgj6fnD8s3pX6 8jnaqRNyHxzJ1rsJdAZf4UtpWWKOjwkFM9vg8ubG7h0yD1U0Ciuh7k53uIq88GtN+9a2 fUiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F08nW+gA4JPOKtj6javuvjgtTFdxKiyyhVsFgOaYFXw=; b=h/qU9RmEHd/8PQh0KiGe+cz970AAg0pFvHqxrU92XDV2XP+TQVrAOEVmIF5jH+1d0n x8oaEf4o/6ILRVIke5583WEoUxYi8IFspHrsq6Dd4SxsVznmowOHMM5CGsyl4GrjiEF+ yfZRejV5lEMcKo+GcVy/j5WRhu2kUarwJgDJYCM0cxrxKujtyUZswtiaI3jfkjwtPOHP kAOkqo+s15ziREcwyFuA9TIZihudfe5eXidnSA2dRIiANsUtis1ndmvwtKhFJqQK2SKS j0J5oWMkM25fkFO5Iksnyts8UR5IqAxUK1RQAOJsm2BrP3QPQW7htT4Brve6fYqXKBG4 8wWg== X-Gm-Message-State: APjAAAXb3rmgPswY30guHDtOnf5ISgAPGoB5/temSWm/xMcNZAIBDRIJ wDeTW0f/G3lVh4qjE46cAaR3Xg== X-Google-Smtp-Source: APXvYqxYMZ+LokoUoxZgREERbZOSKuaK8ujmO+M6NT2rtsuT6WrQgW6NwYbAWdYpB3ki+A+9c1xW8Q== X-Received: by 2002:a63:5952:: with SMTP id j18mr2802759pgm.204.1569325950230; Tue, 24 Sep 2019 04:52:30 -0700 (PDT) Received: from [10.95.130.59] ([199.233.58.37]) by smtp.gmail.com with ESMTPSA id c11sm4144641pfj.114.2019.09.24.04.52.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2019 04:52:29 -0700 (PDT) To: Bruce Richardson Cc: Thomas Monjalon , Ray Kinsella , dev@dpdk.org, Aaron Conole , Michael Santana , John McNamara , Marko Kovacevic , David Hunt , Vladimir Medvedkin , Robert Sanford , Erik Gabriel Carrillo , mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka , nhorman@tuxdriver.com References: <20190917075754.8310-1-amo@semihalf.com> <20190919151624.GA1999@bricha3-MOBL.ger.corp.intel.com> <1873473.QF300kEeir@xps> <20190923120658.GA2003@bricha3-MOBL.ger.corp.intel.com> <20190923161326.GB2003@bricha3-MOBL.ger.corp.intel.com> <42bc3e03-768f-b90c-5f81-5a1cb525bb2f@semihalf.com> <20190924102534.GA2021@bricha3-MOBL.ger.corp.intel.com> From: Andrzej Ostruszka Message-ID: <936ad1c2-ad0d-7026-9597-f45e35ad4133@semihalf.com> Date: Tue, 24 Sep 2019 13:52:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190924102534.GA2021@bricha3-MOBL.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 01/10] build: add an option to enable LTO build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On 9/24/19 12:25 PM, Bruce Richardson wrote: > On Tue, Sep 24, 2019 at 08:46:25AM +0200, Andrzej Ostruszka wrote: [...] >> PS. IMHO this SHARED_LIB define should be removed from the rte_config.h >> and meson.build should be updated to detect 'default_library' and add it >> as needed. Don't know exactly how meson behaves if 'default_library' is >> 'both' - the docs say that it reuses objects from static build, so we >> might have to work around it for LTO & 'both'. > > That proposal won't work either as we build both static and shared > libraries in all cases - the default_library value only affects whether the > test apps are linked against the .a or .so files. > > The real issue seems to be that the compat.h header has different > compilation paths for static and shared libraries, which means that any C > file including it can't have a .o file that can be used for both a .a and a > .so simultaneously. Having it default to the shared library path seems to > work fine thus far, but with LTO it seems broken as you say. Adding Neil as > the original file author of this in case he has any suggestions here. I'd > really rather not have to go back to building .a's and .so's separately. I thought about this already a bit and I see two ways out. The one which depends on meson's 'default_library' - for "static"/"shared" the case would be easy (along the lines I've mentioned). The "both" would be tricky if we want to rely on meson built-in behaviour. The other is that we use 'default_library' as we do today (as an indicator which library should be used when linking apps). In that case all is good apart from building static libs out of object files. That would require additional step. That is each object, for which source uses BIND_DEFAULT_SYMBOL/MAP_STATIC_SYMBOL, would need to be processed with "objcopy --add-symbol" adding correct alias before being used to create static lib. Just my 2 cents. Regards Andrzej