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

-Xarch Clang compiler option not supported #2090

Open
cgytrus opened this issue Feb 13, 2024 · 5 comments · May be fixed by #2265
Open

-Xarch Clang compiler option not supported #2090

cgytrus opened this issue Feb 13, 2024 · 5 comments · May be fixed by #2265

Comments

@cgytrus
Copy link

cgytrus commented Feb 13, 2024

I'm not sure what the exact conditions are, but CMake (sometimes?) generates -Xarch_<arch> before architecture-specific PCH includes with (both LLVM and Apple) Clang on macOS. The option's syntax is kind of weird (-Xarch_<arg1> <arg2> Clang CLI ref) and it not being properly supported results in arguments getting reordered weirdly causing the following errors:

/usr/local/bin/sccache /usr/local/opt/llvm/bin/clang++ <...> -arch x86_64 <...> -Winvalid-pch -Xarch_x86_64 -include/Users/runner/work/geode/geode/build/loader/CMakeFiles/geode-loader.dir/cmake_pch_x86_64.hxx <...>
clang++: error: no such file or directory: 'x86_64'
clang++: error: invalid Xarch argument: '-Xarch_x86_64 -arch', options requiring arguments are unsupported
[2024-02-13T11:50:19Z DEBUG sccache::compiler::gcc] cmd after -arch rewrite: Some(<...> "/usr/local/opt/llvm/bin/clang++" <...> "-include" "/Users/runner/work/geode/geode/build/loader/CMakeFiles/geode-loader.dir/cmake_pch_x86_64.hxx" <...> "-Winvalid-pch" "-Xarch_x86_64" "-arch" "x86_64" <...>)

I managed to work around the issue for my specific use case in this commit, but obviously this isn't sustainable long-term, since it should actually parse 2 arguments from the option (arg1 and arg2) which doesn't seem to be possible right now.

@Noxybot
Copy link

Noxybot commented May 1, 2024

Same for me... Is there a resolution for this?

tomconder added a commit to tomconder/maze that referenced this issue Jun 17, 2024
- workaround for sccache issue: mozilla/sccache#2090
@tomconder
Copy link

+1. I also am facing this issue with sccache on Mac OS X.

@sylvestre
Copy link
Collaborator

Don't hesitate to propose a patch for this. AFAIK, we (Mozilla) aren't impacted by this.

@pauliesnug
Copy link

Don't hesitate to propose a patch for this. AFAIK, we (Mozilla) aren't impacted by this.

I believe a patch wasn't proposed due to the issue mentioned, "obviously this isn't sustainable long-term, since it should actually parse 2 arguments from the option (arg1 and arg2) which doesn't seem to be possible right now."

torarnv added a commit to torarnv/sccache that referenced this issue Oct 1, 2024
A new ArgDisposition is introduces that combines the Concatenated
and Separated behaviors, but produces results similar to a plain
Separated argument with the full original -Xarch_<arch> argument.

Fixes mozilla#2090
@torarnv torarnv linked a pull request Oct 1, 2024 that will close this issue
@torarnv
Copy link

torarnv commented Oct 1, 2024

I made a stab at a more generic fix in #2265

@sylvestre please have a look, thanks!

torarnv added a commit to torarnv/sccache that referenced this issue Oct 1, 2024
A new ArgDisposition is introduces that combines the Concatenated
and Separated behaviors, but produces results similar to a plain
Separated argument with the full original -Xarch_<arch> argument.

Fixes mozilla#2090
torarnv added a commit to torarnv/sccache that referenced this issue Oct 1, 2024
A new ArgDisposition is introduces that combines the Concatenated
and Separated behaviors, but produces results similar to a plain
Separated argument with the full original -Xarch_<arch> argument.

Fixes mozilla#2090
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 a pull request may close this issue.

6 participants