From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id A21901C00 for ; Wed, 13 Dec 2017 13:10:55 +0100 (CET) Received: by mail-wr0-f196.google.com with SMTP id z18so1891280wrb.8 for ; Wed, 13 Dec 2017 04:10:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=YYK1Lqy4vxcOCqUFl097GStBCnZKcHlU2tBeRL5lGGU=; b=tISMwfPhUVO3z1/qgtUJnbd35iMhtQfGdy3U94Y40GOe/f5NWFJzp9w8fY9Ed1phYb S68wmcsaVsW6CLmMGhNsyc2lSfMSql6g0eOn1ofG6R/DGmnPs9rql3ZXxvpC2/D8SaKz gloYIJWAx+hyG5hgbutf6oBGik6YvPgmSUTb2ocsje3PmGEfuqyefxDgq1Uv0CKxpSfa z7L+rDM1XU63rPbevGkh2/wH/jacj89ZEJDzahkKrD/YOFqRnV3Ai0NgGNbHVIq/0Wew 1OCy4LLo9KuaqunP6ZTHIZmZ2H1Vd0iy7bi9+7lQq6s2uyUTMF8ixIF2qUb8wZDPYLCR sN1A== X-Gm-Message-State: AKGB3mK/otiXbN+pilRB/ZgPvopMNi8FlGejDD4y5m6DUkjtFPMLk6zN jGHt1jWmluOz8DTGRwNZgC4= X-Google-Smtp-Source: ACJfBouVLs22Hp4eoABSdU+FrTEXWss0DBhP6CxN2xLyPgyO4tUrlmKZTM04KL848YgCLo7K0gVwUA== X-Received: by 10.223.175.223 with SMTP id y31mr2207052wrd.106.1513167054986; Wed, 13 Dec 2017 04:10:54 -0800 (PST) Received: from localhost ([213.251.34.146]) by smtp.gmail.com with ESMTPSA id h7sm1215236wrb.35.2017.12.13.04.10.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2017 04:10:53 -0800 (PST) Message-ID: <1513167052.15861.26.camel@debian.org> From: Luca Boccassi To: Bruce Richardson , dev@dpdk.org Cc: aconole@redhat.com Date: Wed, 13 Dec 2017 12:10:52 +0000 In-Reply-To: <20171212171401.GA14780@bricha3-MOBL3.ger.corp.intel.com> References: <20171212165940.272969-1-bruce.richardson@intel.com> <20171212171401.GA14780@bricha3-MOBL3.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 0/6] next-build: create both static and shared libs 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: , X-List-Received-Date: Wed, 13 Dec 2017 12:10:55 -0000 On Tue, 2017-12-12 at 17:14 +0000, Bruce Richardson wrote: > On Tue, Dec 12, 2017 at 04:59:34PM +0000, Bruce Richardson wrote: > > This patchset changes the meson+ninja build system to always create > > both > > static and shared libraries when doing a build. The applications > > compiled > > as part of a build use either the shared or static libraries > > depending on > > what the default_library build setting is. > >=20 > > NOTE: > > The main difficulty with this change is adjusting the pkgconfig > > file so > > that external apps, like the examples, can be built using either > > the static > > or shared libraries. One of the key issues was the fact that > > running > > "pkg-config --static --libs libdpdk" outputs first the normal libs, > > and > > then the extra static ones. This is a problem because the driver > > libs are > > for static only builds, but need to come before, not after the > > standard > > DDPK libraries.=C2=A0=C2=A0It also procludes adding in the -Wl,-Bstatic= flag > > into the output for the standard libraries to link them statically. > >=20 > > There were two options considered for mananging the pkg-config > > settings. > > 1. Creating a separate .pc file for static builds with exactly the > > flags > > needed. > > 2. Modifying the single .pc file so that it was "good enough" to > > enable > > static builds without too much work. > >=20 > > For this version of this set, I took option #2. To link using > > dynamic libs, > > all is as normal, to use static libs, the user needs to prepend > > "-Wl,-Bstatic" before the "pkgconfig --static" library output. This > > can be > > seen in the changes to the example application makefiles, which now > > support > > building the examples using shared or static DPDK libs. > >=20 >=20 > Just to emphasise that I'm looking for input into whether I took the > right choice here. Option #1 has some advantages in that we can tune > the > output specifically for the static build case, but I wasn't sure > whether > it would be the done thing to have two different .pc files for a > single > package. Feedback from packagers welcome! >=20 > /Bruce I don't link #1 too much - too "special". I think an additional flag is more friendly. A good solution would be a Cflags.private feature, sadly that is not supported by pkgconfig despite many requests for it. A possible way to sugar-coat it could be to add a custom variable, and then instruct the users to do something like: $(shell pkg-config --variable=3Dldflags.static libdpdk) $(shell=C2=A0pkg- config --static --libs libdpdk) Unfortunately, again, --variable cannot be used together with --libs in the same call. --=20 Kind regards, Luca Boccassi