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

clike compiler args: ignore -Xclang it and whatever comes after it #13232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aleden
Copy link

@aleden aleden commented May 19, 2024

I wanted to build QEMU under clang with a custom plugin (for the compiler itself). Via --extra-cflags, I shuttled the following into the CFLAGS:

-Xclang -load -Xclang /usr/local/lib/carbon-collect.so -Xclang -add-plugin -Xclang carbon-collect -Xclang -plugin-arg-carbon-collect -Xclang "$(pwd)" -Xclang -plugin-arg-carbon-collect -Xclang "$(pwd)"

This did not build, meson threw an error, because it bungled the arguments given to the compiler, see #11184 for more details.

I believe that when meson goes about figuring out '-Wl,--start-group' and '-Wl,--end-group', it assumes that /usr/local/lib/carbon-collect.so is a DSO in the build, when it is in fact a plugin to the compiler itself (which happens to be a shared library).

It seems to me that anything could come after an '-Xclang'. Do other compilers out there have an analogous command-line option? Does this need to be configurable?

…ince it could be anything (and purposed for who knows what)
@aleden aleden requested a review from dcbaker as a code owner May 19, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant