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

Allow user to provide CC wrapper #255

Merged
merged 1 commit into from
Sep 22, 2021
Merged

Conversation

vlovich
Copy link
Contributor

@vlovich vlovich commented Sep 1, 2021

If using a custom toolchain not on the path, explicitly invoking
ccache/sccache is required (also easier to debug that the right compiler
is being invoked). Fixes #253 .

@sbc100
Copy link
Member

sbc100 commented Sep 1, 2021

I can see that this works, but I do wonder why we have to do this when other build systems such as automake (and indeed most hand-rolled) Makefiles's don't provide this and assume the user can include ccache in the CC/CXX variable itself.

@vlovich
Copy link
Contributor Author

vlovich commented Sep 2, 2021

I'm fine with that too. I just assumed that the motivation for quoting WASM_CC was to allow for spaces in which case this would be the only way to do that.

@sbc100
Copy link
Member

sbc100 commented Sep 2, 2021

I'm fine with that too. I just assumed that the motivation for quoting WASM_CC was to allow for spaces in which case this would be the only way to do that.

I think we can just get rid of the quotes then perhaps.

Looking at autoconf/automake it looks like spaces are OK in the CC variable.

When I run CC="ccache /usr/bin/gcc" ./configure the generated Makefile contains CC = ccache /usr/bin/gcc and it seems to work just fine.

@sbc100
Copy link
Member

sbc100 commented Sep 2, 2021

Actually checked with and actual space in the path to gcc and autoconf fails. Apparently its just not supported: https://stackoverflow.com/questions/16194124/autoconf-spaces-in-path.

I'm not sure we need to go out of our way to support spaces in the paths given than autoconf doesn't.

If using a custom toolchain not on the path, explicitly invoking
ccache/sccache is required (also easier to debug that the right compiler
is being invoked). Fixes WebAssembly#253.
@vlovich
Copy link
Contributor Author

vlovich commented Sep 8, 2021

Done. I had to tweak WASM_NM/WASM_AR so that they ignored ccache because they're invoked with quotes. This works if ccache/sccache is invoked existing on the PATH. If the caller is providing an absolute path to some kind of wrapper, they'll have to explicitly override WASM_NM/WASM_AR.

@vlovich
Copy link
Contributor Author

vlovich commented Sep 22, 2021

Is there anything else that needs to be done here to merge?

@sbc100 sbc100 merged commit 90a6236 into WebAssembly:main Sep 22, 2021
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.

Can't utilize ccache with a custom compiler
2 participants