Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Check for --undefined-version support #491

Merged

Conversation

wismill
Copy link
Member

@wismill wismill commented Jul 12, 2024

Gate the use of --undefined-version in the linker because it breaks on older GNU ld: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58272.

Fixes #481

@glechapelain @eli-schwartz

@wismill wismill added bug Indicates an unexpected problem or unintended behavior build system labels Jul 12, 2024
meson.build Outdated
have_version_script = cc.links(
'int main(){}',
args: '-Wl,--undefined-version,--version-script=' + meson.current_source_dir()/'xkbcommon.map',
args: '-Wl,--version-script=' + meson.current_source_dir()/'xkbcommon.map' + extra_linker_args,
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw, meson has for quite a while supported f-strings so this may be easier as:

Suggested change
args: '-Wl,--version-script=' + meson.current_source_dir()/'xkbcommon.map' + extra_linker_args,
args: f'-Wl,--version-script=@map@@extra_linker_args@',

with an extra

map = meson.current_source_dir()/'xkbcommon.map

above somewhere

Copy link
Member Author

@wismill wismill Jul 16, 2024

Choose a reason for hiding this comment

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

@whot Good idea. I raised minimal meson version from 0.52 (October 2019) to 0.58 (May 2021) to enable f-strings.

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that #313 updated to a meson version of barely one year old at that time, I guess 3 years old is OK here.

@wismill wismill force-pushed the meson/check-linker-arg-undefined-version branch from 7d4649e to 7e3244d Compare July 16, 2024 05:22
wismill added 2 commits July 16, 2024 07:27
This will enable f-strings and allow us to simplify the build file.
Gate the use of `--undefined-version` in the linker because it breaks on
older GNU `ld`: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58272.
@wismill wismill force-pushed the meson/check-linker-arg-undefined-version branch from 7e3244d to d0b7108 Compare July 16, 2024 05:35
@wismill wismill merged commit 1d8a25d into xkbcommon:master Jul 16, 2024
4 checks passed
@wismill wismill deleted the meson/check-linker-arg-undefined-version branch July 16, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

meson.build script broke detection of --version-script support in GNU ld, as NetBSD uses
3 participants