-
Notifications
You must be signed in to change notification settings - Fork 128
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
ci: Add WASI SDK build #175
Conversation
set(CMAKE_SYSROOT ${WASI_SDK_PREFIX}/share/wasi-sysroot) | ||
endif() | ||
|
||
include(${WASI_SDK_PREFIX}/share/cmake/wasi-sdk.cmake) |
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.
The reason the upstream toolchain did not work for me, is because it uses Platform/wasi
which is non-existent.
However the bigger problem is, in that case it falls back to the host settings and on macOS it will not work. The macOS platform file adds some linker flags:
$ cmake -DTOOLCHAIN=wasm32-wasi -DETHASH_BUILD_TESTS=NO -DETHASH_BUILD_GLOBAL_CONTEXT=NO -DWASI_SDK_PREFIX=/Users/alex/Projects/evmone/wasi-sdk-12.0 ..
-- [cable ] Cable 0.4.1 initialized
-- [cable ] Build type: Release
-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Check for working C compiler: /Users/alex/Project/evmone/wasi-sdk-12.0/bin/clang
-- Check for working C compiler: /Users/alex/Projects/evmone/wasi-sdk-12.0/bin/clang - broken
CMake Error at /usr/local/Cellar/cmake/3.19.2/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/Users/alex/Projects/evmone/wasi-sdk-12.0/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/alex/Projects/ethash/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_975d6/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_975d6.dir/build.make CMakeFiles/cmTC_975d6.dir/build
Building C object CMakeFiles/cmTC_975d6.dir/testCCompiler.c.o
/Users/alex/Projects/evmone/wasi-sdk-12.0/bin/clang --target=wasm32-wasi --sysroot=/Users/alex/Projects/evmone/wasi-sdk-12.0/share/wasi-sysroot -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -o CMakeFiles/cmTC_975d6.dir/testCCompiler.c.o -c /Users/alex/Projects/ethash/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_975d6
/usr/local/Cellar/cmake/3.19.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_975d6.dir/link.txt --verbose=1
/Users/alex/Projects/evmone/wasi-sdk-12.0/bin/clang --target=wasm32-wasi --sysroot=/Users/alex/Projects/evmone/wasi-sdk-12.0/share/wasi-sysroot -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_975d6.dir/testCCompiler.c.o -o cmTC_975d6
wasm-ld: error: unknown argument: -search_paths_first
wasm-ld: error: unknown argument: -headerpad_max_install_names
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_975d6] Error 1
make: *** [cmTC_975d6/fast] Error 2
That's why I used linux explicitly in ethereum/evmone#328
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.
It looks it passes some macos specific flags to wasm-ld.
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.
Yep:
However the bigger problem is, in that case it falls back to the host settings and on macOS it will not work. The macOS platform file adds some linker flags:
Codecov Report
@@ Coverage Diff @@
## master #175 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 1652 1652
=========================================
Hits 1652 1652
Flags with carried forward coverage won't be shown. Click here to find out more. |
No description provided.