-
Notifications
You must be signed in to change notification settings - Fork 62
meson: fix build with lld on linux #183
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,15 @@ elif build_machine.system() == 'freebsd' | |
| else | ||
| # Linux and other systems | ||
| version_script_flags = '-Wl,--version-script=' + meson.current_source_dir() + '/libjose.map' | ||
| if not cc.links(code, args: version_script_flags, name: '-Wl,--version-script=...') | ||
| if cc.get_linker_id() != 'ld.lld' and not cc.links( | ||
| code, | ||
| args: version_script_flags, | ||
| name: '-Wl,--version-script=...', | ||
| ) or not cc.links( | ||
| code, | ||
| args: version_script_flags + ',--undefined-version', | ||
| name: '-Wl,--version-script=...', | ||
| ) | ||
|
Comment on lines
+20
to
+28
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Meson, The second clause applies to all linkers, not just lld. Since Would it be better to split this into nested if cc.get_linker_id() == 'ld.lld'
if not cc.links(code, args: version_script_flags + ',--undefined-version',
name: '-Wl,--version-script=... (lld)')
flags = ['-export-symbols-regex=^jose_.*']
else
flags = [version_script_flags]
endif
else
if not cc.links(code, args: version_script_flags,
name: '-Wl,--version-script=...')
flags = ['-export-symbols-regex=^jose_.*']
else
flags = [version_script_flags]
endif
endif |
||
| flags = [ '-export-symbols-regex=^jose_.*' ] | ||
| else | ||
| flags = [version_script_flags] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both
cc.links()calls use the samename: '-Wl,--version-script=...', so Meson's configure output doesn't distinguish which probe passed or failed. Maybe use different names like'-Wl,--version-script=... (plain)'and'-Wl,--version-script=... (--undefined-version)'to make build logs easier to read.