All of lore.kernel.org
 help / color / mirror / Atom feed
* [DPDK/core Bug 1949] function versioning is incompatible with LTO
@ 2026-06-02 22:30 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2026-06-02 22:30 UTC (permalink / raw)
  To: dev

http://bugs.dpdk.org/show_bug.cgi?id=1949

            Bug ID: 1949
           Summary: function versioning is incompatible with LTO
           Product: DPDK
           Version: 25.07
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: Normal
         Component: core
          Assignee: dev@dpdk.org
          Reporter: stephen@networkplumber.org
  Target Milestone: ---

The default-version symver (@@) fails to assemble when build is using LTO.

Building a shared library with LTO fails when a function uses
RTE_DEFAULT_SYMBOL.
I introduces a new versioned symbol rte_eth_dev_get_name_by_port (ethdev).
This fails when doing LTO build with

invalid attempt to declare external version name as default
in symbol `rte_eth_dev_get_name_by_port@@DPDK_27'

Cause: the versioning macros emit a file-scope __asm__(".symver
…@@DPDK_<ver>"). Top-level asm is opaque to LTO, so GCC may place the directive
in a different ltrans partition than the _v<ver> definition. The implementation
symbol is then external in that partition, and gas rejects binding a default
version (@@) to an external symbol. Only the @@ (default) line fails; the
single-@ compat line is legal on an external symbol.

Fix: use the GCC symver function attribute (GCC ≥ 10) instead of top-level asm,
gated on __has_attribute(symver); retain the asm path as fallback. Clang lacks
the attribute and stays on the asm path (LTO + versioning remains unsupported
there).

Marking severity as minor since no current in-tree code uses versioned symbols.
But it is a trap waiting to happen.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-02 22:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 22:30 [DPDK/core Bug 1949] function versioning is incompatible with LTO bugzilla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.