[dpdk-dev] [PATCH v2 01/10] build: add an option to enable LTO build

Bruce Richardson bruce.richardson at intel.com
Mon Sep 23 18:13:26 CEST 2019


On Mon, Sep 23, 2019 at 03:02:25PM +0200, Andrzej Ostruszka wrote:
> On 9/23/19 2:06 PM, Bruce Richardson wrote:
> > On Mon, Sep 23, 2019 at 02:03:35PM +0200, Andrzej Ostruszka wrote:
> [...]
> >> So it is similar ~5x increase as Mattias has reported.  Have not
> >> measured it, but the lion share of that increase is due to linking of
> >> 'test' apps.
> >>
> > 
> > Interesting. Do we want to explicitly not use lto for the test app?
> 
> It is the linking of these apps where LTO really kicks in.  During
> compilation of objects compiler just additionally generates internal
> representation (in extra sections of ELF object).  Linking these objects
> into library does not do much - so the actual optimization is done when
> producing final executable.
> 
> It might be so that when using dedicated user app the penalty would be
> much smaller since the amount of code used would be much smaller - but
> FWIW all the warnings that I was fixing were produced by the linking of
> app/test* binaries.
> 
I wasn't suggesting removing it for testpmd test-acl etc., just for the
autotest "test" binary since it's the one with the most .o files.

However, testing on my system with the meson build, I'm getting lots of
link errors [See below]. Any suggestions?

/Bruce

/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans93.ltrans.o: in function `ena_stop':
<artificial>:(.text+0x9ed6): undefined reference to `rte_timer_stop'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans93.ltrans.o: in function `ena_start':
<artificial>:(.text+0xae23): undefined reference to `rte_timer_reset'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans93.ltrans.o: in function `eth_ena_dev_init.cold':
<artificial>:(.text.unlikely+0x224a): undefined reference to `rte_timer_subsystem_init'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans119.ltrans.o: in function `rte_distributor_flush_v1705':
<artificial>:(.text+0xa229): undefined reference to `rte_distributor_process'
/usr/bin/ld: <artificial>:(.text+0xa256): undefined reference to `rte_distributor_process'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans119.ltrans.o: in function `rte_distributor_get_pkt_v1705':
<artificial>:(.text+0xd24b): undefined reference to `rte_distributor_request_pkt'
/usr/bin/ld: <artificial>:(.text+0xd259): undefined reference to `rte_distributor_poll_pkt'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans122.ltrans.o: in function `rte_table_lpm_ipv6_lookup.lto_priv.0':
<artificial>:(.text+0x810c): undefined reference to `rte_lpm6_lookup'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans122.ltrans.o: in function `rte_table_lpm_ipv6_entry_delete.lto_priv.0':
<artificial>:(.text+0x81bb): undefined reference to `rte_lpm6_is_rule_present'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans122.ltrans.o: in function `rte_table_lpm_ipv6_entry_add.lto_priv.0':
<artificial>:(.text+0x8e13): undefined reference to `rte_lpm6_is_rule_present'
/usr/bin/ld: <artificial>:(.text+0x8e79): undefined reference to `rte_lpm6_add'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans122.ltrans.o: in function `rte_table_lpm_entry_delete.lto_priv.0':
<artificial>:(.text+0x9b15): undefined reference to `rte_lpm_is_rule_present'
/usr/bin/ld: <artificial>:(.text+0x9b4c): undefined reference to `rte_lpm_delete'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans122.ltrans.o: in function `rte_table_lpm_entry_add.lto_priv.0':
<artificial>:(.text+0x9c06): undefined reference to `rte_lpm_is_rule_present'
/usr/bin/ld: <artificial>:(.text+0x9c73): undefined reference to `rte_lpm_add'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans122.ltrans.o: in function `rte_table_lpm_free.lto_priv.0':
<artificial>:(.text+0x9d12): undefined reference to `rte_lpm_free'
/usr/bin/ld: /tmp/dpdk-testpmd.hncbtE.ltrans122.ltrans.o: in function `rte_table_lpm_create.lto_priv.0':
<artificial>:(.text+0x9e01): undefined reference to `rte_lpm_create'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.



More information about the dev mailing list