All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/core Bug 1949] function versioning is incompatible with LTO
Date: Tue, 02 Jun 2026 22:30:27 +0000	[thread overview]
Message-ID: <bug-1949-3@http.bugs.dpdk.org/> (raw)

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.

                 reply	other threads:[~2026-06-02 22:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-1949-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /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 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.