Skip to content

RFE: add versioned symbol support#484

Open
gordonmessmer wants to merge 1 commit intoseccomp:mainfrom
gordonmessmer:versioned-symbols
Open

RFE: add versioned symbol support#484
gordonmessmer wants to merge 1 commit intoseccomp:mainfrom
gordonmessmer:versioned-symbols

Conversation

@gordonmessmer
Copy link
Copy Markdown

In order to improve reliable dependency resolution, I would like to add versioned symbols to the libraries that do not include them today.

This change is intended to support Fedora's recommendation that shared libraries provide versioned symbols: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/#_versioned_symbols

Please double-check the symbol files. If any symbols have been added very recently, they might not be in the symbol maps I've generated.

@pcmoore pcmoore changed the title Add versioned symbol support RFE: add versioned symbol support Apr 8, 2026
@pcmoore
Copy link
Copy Markdown
Member

pcmoore commented Apr 8, 2026

Hi @gordonmessmer, thanks for the patch! Considering the patch, it would be helpful to provide a description of the work in the patch's description. We also generally expect a subject prefix, e.g. "build: add versioned symbol support" for patches so it is easier to filter through patches when looking at the output from git log.

# FIXME: The test below returns a false positive for mingw
# cross-compiles, 'local:' statements does not reduce number of
# exported symbols in a DLL. Use --disable-ld-version-script to work
# around the problem.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a fix for this, or is this a known problem that is expected to have a solution at some later date?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment is 17 years old: https://github.com/coreutils/gnulib/blame/master/m4/ld-version-script.m4

I don't really work with mingw, so I don't know if that was a defect in its ld, or if it's a limitation imposed by the target format.

I can research the question further if it's important.


# gl_LD_VERSION_SCRIPT
# --------------------
# Check if LD supports linker scripts, and define automake conditional
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any (modern) versions of LD that don't support linker scripts?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, they are supported by GNU ld, LLVM's lld, mold, and wild.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we think all (modern) versions of LD support linker scripts, do we even need this *.m4 file? I work on another upstream project, libcgroup, and we've used linker scripts for years. We don't have any checks for versions of LD that don't support linker scripts. No one has complained yet :)

Among other uses, versioned symbols function as a kind of append-only
API changelog, offering a hint to human users and to package managers
indicating the minimum version of a library needed to run an executable

Signed-off-by: Gordon Messmer <gmessmer@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants