wasi-sdk icon indicating copy to clipboard operation
wasi-sdk copied to clipboard

-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY for compiler-rt

Open Ericson2314 opened this issue 6 years ago • 4 comments

Not sure how you all build compiler-rt now, but thanks to https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program I found this elegant way to avoid a dependency cycle stemming from cmake's default configure step.

Got here from fixing https://github.com/NixOS/nixpkgs/pull/56555#discussion_r275133192

Ericson2314 avatar Apr 17 '19 04:04 Ericson2314

It looks like -DCMAKE_C_COMPILER_WORKS is set here:

https://github.com/CraneStation/wasi-sdk/blob/master/wasi-sdk.cmake#L32

matthewbauer avatar Apr 17 '19 04:04 matthewbauer

Thanks for pointing that out -- -DCMAKE_C_COMPILER_WORDS is actually an old workaround for problems which have since been fixed properly. I submitted https://github.com/CraneStation/wasi-sdk/pull/20 to remove it.

sunfishcode avatar Apr 17 '19 13:04 sunfishcode

As a quick update, it turns out removing the -DCMAKE_C_COMPILER_WORDS did break things, because I was getting files from previous builds when I was testing it. I'll try using -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY instead.

sunfishcode avatar Apr 19 '19 00:04 sunfishcode

That appeared to have problems as well, that I didn't see in my local builds. See #20 for details.

sunfishcode avatar Apr 24 '19 21:04 sunfishcode

This was originally landed in #20 however as detailed in that issue, it caused various problems, so we backed it out. If anyone is interested in investigating, please reopen!

sunfishcode avatar Aug 08 '23 22:08 sunfishcode