DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, bluca@debian.org, david.marchand@redhat.com,
	ktraynor@redhat.com, bingz@mellanox.com
Subject: Re: [dpdk-dev] [PATCH 1/7] build: always link-whole DPDK static libraries
Date: Wed, 29 Apr 2020 12:49:34 +0200	[thread overview]
Message-ID: <5259911.3sPnXxR9tc@thomas> (raw)
In-Reply-To: <20200429104232.GC1907@bricha3-MOBL.ger.corp.intel.com>

29/04/2020 12:42, Bruce Richardson:
> On Wed, Apr 29, 2020 at 12:18:19PM +0200, Thomas Monjalon wrote:
> > 29/04/2020 12:08, Bruce Richardson:
> > > To ensure all constructors are included in static build, we need to pass
> > > the --whole-archive flag when linking, which is used with the
> > > "link_whole" meson option. Since we use link_whole for all libs, we no
> > > longer need to track the lib as part of the static dependency, just the
> > > path to the headers for compiling.
> > 
> > Please could you add the generated command line before/after?
> > 
> > I would like to make sure that the external dependencies are out of
> > the whole-archive option.
> > 
> > Thanks
> > 
> Sure,
> 
> the link args for the helloworld example from build.ninja are now (snipping
> out some .a's from the middle for brevity):
> 
>  LINK_ARGS = -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--whole-archive
> -Wl,--start-group lib/librte_telemetry.a lib/librte_bpf.a
> lib/librte_flow_classify.a lib/librte_pipeline.a lib/librte_table.a
> lib/librte_port.a lib/librte_fib.a lib/librte_ipsec.a lib/librte_vhost.a
> lib/librte_stack.a lib/librte_security.a lib/librte_sched.a
> lib/librte_reorder.a lib/librte_rib.a lib/librte_rawdev.a
> lib/librte_pdump.a lib/librte_power.a lib/librte_member.a lib/librte_lpm.a
> lib/librte_latencystats.a lib/librte_kni.a lib/librte_jobstats.a
> lib/librte_ip_frag.a lib/librte_gso.a lib/librte_gro.a
>   <snip> 
> drivers/librte_pmd_mlx5_vdpa.a drivers/librte_pmd_bbdev_null.a
> drivers/librte_pmd_bbdev_turbo_sw.a drivers/librte_pmd_bbdev_fpga_lte_fec.a
> drivers/librte_pmd_bbdev_fpga_5gnr_fec.a -Wl,--no-whole-archive
> -Wl,--no-as-needed -pthread -lm -ldl -lnuma -lpcap
> /usr/lib/x86_64-linux-gnu/libbsd.so /usr/lib/x86_64-linux-gnu/libjansson.so
> /usr/lib/x86_64-linux-gnu/libelf.so -lpcap -lpcap -lpcap -lpcap
> /usr/lib/x86_64-linux-gnu/libmlx5.so
> /usr/lib/x86_64-linux-gnu/libibverbs.so /usr/lib/x86_64-linux-gnu/libz.so
> /usr/lib/x86_64-linux-gnu/libmlx4.so -lpcap -lpcap -Wl,--end-group
> 
> The before case is below (again snipping some drivers):
> 
>  LINK_ARGS = -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--whole-archive
> -Wl,--start-group drivers/librte_common_cpt.a drivers/librte_common_dpaax.a
> drivers/librte_common_iavf.a drivers/librte_common_mlx5.a
> drivers/librte_common_octeontx.a drivers/librte_common_octeontx2.a
> drivers/librte_bus_dpaa.a drivers/librte_bus_fslmc.a
> drivers/librte_bus_ifpga.a drivers/librte_bus_pci.a
>   <snip>
> drivers/librte_pmd_octeontx_event.a drivers/librte_pmd_bbdev_null.a
> drivers/librte_pmd_bbdev_turbo_sw.a drivers/librte_pmd_bbdev_fpga_lte_fec.a
> drivers/librte_pmd_bbdev_fpga_5gnr_fec.a -Wl,--no-whole-archive
> -Wl,--no-as-needed -pthread -lm -ldl -lnuma lib/librte_eal.a
> lib/librte_kvargs.a lib/librte_mempool.a lib/librte_ring.a lib/librte_net.a
> lib/librte_mbuf.a lib/librte_ethdev.a lib/librte_meter.a
> lib/librte_cmdline.a lib/librte_pci.a lib/librte_cryptodev.a
> lib/librte_hash.a lib/librte_eventdev.a lib/librte_timer.a
> lib/librte_rawdev.a lib/librte_stack.a lib/librte_sched.a
> lib/librte_ip_frag.a lib/librte_security.a lib/librte_kni.a
> lib/librte_pipeline.a lib/librte_port.a lib/librte_table.a lib/librte_lpm.a
> lib/librte_acl.a lib/librte_gso.a lib/librte_vhost.a lib/librte_reorder.a
> lib/librte_compressdev.a lib/librte_bbdev.a -lpcap
> /usr/lib/x86_64-linux-gnu/libbsd.so /usr/lib/x86_64-linux-gnu/libmlx5.so
> /usr/lib/x86_64-linux-gnu/libibverbs.so /usr/lib/x86_64-linux-gnu/libz.so
> /usr/lib/x86_64-linux-gnu/libmlx4.so -lpcap -lpcap -lpcap -lpcap -lpcap
> -lIPSec_MB -lIPSec_MB /usr/lib/x86_64-linux-gnu/libcrypto.so
> /usr/lib/x86_64-linux-gnu/libisal.so -Wl,--end-group
> '-Wl,-rpath,$$ORIGIN/../lib' -Wl,-rpath-link,/home/bruce/dpdk.org/build/lib
> 
> These both come from builds with meson 0.54. I can also check that things
> look the same for 0.47 too.

That's fine, it looks good.
Please mention that you move DPDK libs inside but external dependencies
are still outside of whole-archive block.

Thanks




  reply	other threads:[~2020-04-29 10:49 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 10:08 [dpdk-dev] [PATCH 0/7] improve DPDK static builds with meson Bruce Richardson
2020-04-29 10:08 ` [dpdk-dev] [PATCH 1/7] build: always link-whole DPDK static libraries Bruce Richardson
2020-04-29 10:18   ` Thomas Monjalon
2020-04-29 10:42     ` Bruce Richardson
2020-04-29 10:49       ` Thomas Monjalon [this message]
2020-04-29 14:04   ` Andrzej Ostruszka [C]
2020-04-29 10:08 ` [dpdk-dev] [PATCH 2/7] build: remove unnecessary variable Bruce Richardson
2020-04-29 10:19   ` Thomas Monjalon
2020-04-29 10:29     ` Bruce Richardson
2020-04-29 10:08 ` [dpdk-dev] [PATCH 3/7] devtools/test-meson-builds.sh: add pkg-config static builds Bruce Richardson
2020-04-29 10:08 ` [dpdk-dev] [PATCH 4/7] build: move pkg-config creation to separate file Bruce Richardson
2020-04-29 10:08 ` [dpdk-dev] [PATCH 5/7] build/pkg-config: output driver libs first for static build Bruce Richardson
2020-04-29 10:30   ` Thomas Monjalon
2020-04-29 10:54     ` Bruce Richardson
2020-04-29 10:40   ` Luca Boccassi
2020-04-29 11:03     ` Bruce Richardson
2020-04-29 11:12       ` Luca Boccassi
2020-04-29 10:08 ` [dpdk-dev] [PATCH 6/7] build/pkg-config: improve static linking flags Bruce Richardson
2020-04-29 10:32   ` Thomas Monjalon
2020-04-29 10:56     ` Bruce Richardson
2020-04-29 10:57       ` Thomas Monjalon
2020-04-29 10:37   ` Luca Boccassi
2020-04-29 10:58     ` Bruce Richardson
2020-04-29 11:10       ` Luca Boccassi
2020-04-29 10:08 ` [dpdk-dev] [PATCH 7/7] build/pkg-config: prevent overlinking Bruce Richardson
2020-04-29 10:34   ` Thomas Monjalon
2020-04-29 11:00     ` Bruce Richardson
2020-05-01 13:53 ` [dpdk-dev] [PATCH v2 0/7] improve DPDK static builds with meson Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 1/7] build: always link-whole DPDK static libraries Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 2/7] build: remove unnecessary variable Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 3/7] devtools/test-meson-builds.sh: add pkg-config static builds Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 4/7] build: move pkg-config creation to separate file Bruce Richardson
2020-05-01 13:53   ` [dpdk-dev] [PATCH v2 5/7] build/pkg-config: output driver libs first for static build Bruce Richardson
2020-05-01 13:54   ` [dpdk-dev] [PATCH v2 6/7] build/pkg-config: improve static linking flags Bruce Richardson
2020-05-01 13:54   ` [dpdk-dev] [PATCH v2 7/7] build/pkg-config: prevent overlinking Bruce Richardson
2020-05-01 14:02   ` [dpdk-dev] [PATCH v2 0/7] improve DPDK static builds with meson Luca Boccassi
2020-06-30 13:25   ` Pai G, Sunil
2020-06-30 16:37     ` Stokes, Ian
2020-07-01 17:29       ` Thomas Monjalon
2020-07-02 10:46         ` Stokes, Ian
2020-06-30 14:14 ` [dpdk-dev] [PATCH v3 " Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 1/7] build: always link-whole DPDK static libraries Bruce Richardson
2020-07-01 14:19     ` Thomas Monjalon
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 2/7] build: remove unnecessary variable Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 3/7] devtools/test-meson-builds.sh: add pkg-config static builds Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 4/7] build: move pkg-config creation to separate file Bruce Richardson
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 5/7] build/pkg-config: output driver libs first for static build Bruce Richardson
2020-07-01  7:50     ` Thomas Monjalon
2020-07-01  8:43       ` Bruce Richardson
2020-07-01 14:42     ` Thomas Monjalon
2020-07-01 15:16       ` Bruce Richardson
2020-07-01 15:36         ` Thomas Monjalon
2020-07-01 15:45           ` Bruce Richardson
2020-07-01 16:04             ` Thomas Monjalon
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 6/7] build/pkg-config: improve static linking flags Bruce Richardson
2020-07-01 14:30     ` Thomas Monjalon
2020-07-01 14:33       ` Thomas Monjalon
2020-07-01 14:36         ` Bruce Richardson
2020-07-01 14:45           ` Thomas Monjalon
2020-06-30 14:14   ` [dpdk-dev] [PATCH v3 7/7] build/pkg-config: prevent overlinking Bruce Richardson
2020-07-01  7:56     ` Thomas Monjalon
2020-07-01  8:58       ` Bruce Richardson
2020-07-01 17:33   ` [dpdk-dev] [PATCH v3 0/7] improve DPDK static builds with meson Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5259911.3sPnXxR9tc@thomas \
    --to=thomas@monjalon.net \
    --cc=bingz@mellanox.com \
    --cc=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).