Comments (8)
What version of wasi-sdk are you using?
The symbol exists at least in wasi-sdk-12 and wasi-sdk-11:
wasi-sdk-12.0 $ ./bin/llvm-nm ./lib/clang/11.0.0/lib/wasi/libclang_rt.builtins-wasm32.a | grep "T __multi3"
00000001 T __multi3
wasi-sdk-11.0 $ ./bin/llvm-nm ./lib/clang/10.0.0/lib/wasi/libclang_rt.builtins-wasm32.a | grep "T __multi3"
00000001 T __multi3
Perhaps somehow libclang_rt.builtins-wasm32.a
is now being linked it? (what is the full linker command can clang is generating? you can use -v
with clang to show the full linker command).
from wasi-libc.
@sbc100, @sunfishcode, the related pull request #99 only affects the following symbols, but not __multi3
as the issue title says.
__muldc3
__muloti4
__mulsc3
__multc3
__multf3
Since I do indeed see an undefined __multi3
symbol when compiling some C source with https://github.com/llvm/llvm-project/tree/d28af7c654d8db0b68c175db5ce212d74fb5e9bc and wasi-libc
revision 659ff41 (tied together in https://github.com/WebAssembly/wasi-sdk/tree/a927856376271224d30c5d7732c00a0b359eaa45), I wonder how this can be fixed?
from wasi-libc.
#99 will cause the wasi-libc checking code to ignore all undefined symbols that start with __mul
.. (including __multi3
) when performing its check
phase.
What problem are you seeing exactly? Are you seeing the build of wasi-libc fail the check
phase? Or are you seeing linker failure due to missing __multi3
symbol? (if you are seeing the latter then that suggests a different issue, perhaps an out-of-date compiler-rt library?)
from wasi-libc.
I am seeing a linker failure due to an undefined __multi3
symbol coming out of the compilation of a medium-sized C code-base. Supplying --unresolved-symbols=import-functions
to wasm-ld
allows the linking to succeed, but this is just deferring the problem to the runtime.
I am plainly using wasi-sdk
and am doing nothing special. Maybe a recompilation of wasi-sdk
will help, but I doubt it.
from wasi-libc.
I am using the latest wasi-sdk, a927856376271224d30c5d7732c00a0b359eaa45
, which pulls in via git submodules:
8af7c654d8db0b68c175db5ce212d74fb5e9bc src/llvm-project (llvmorg-12.0.0)
659ff414560721b1660a19685110e484a081c3d4 src/wasi-libc (heads/main)
It indeed finds __multi3
:
./bin/llvm-nm ./lib/clang/12.0.0/lib/wasi/libclang_rt.builtins-wasm32.a | grep "T __multi3"
00000001 T __multi3
Running make check
in wasi-sdk
is successful (return value 0).
I compile and link separately. Compiling:
../wasi-sdk/build/install/opt/wasi-sdk/bin/clang -c -o file.bc file.c --sysroot ../wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot
Linking:
../wasi-sdk/build/install/opt/wasi-sdk/bin/wasm-ld --no-entry --export-dynamic --unresolved-symbols=import-functions -L ../wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi -lc --import-memory -o app.wasm file1.bc file2.bc etc.
Maybe I'm missing to link some additional library?
from wasi-libc.
Problem solved. I missed the -lclang_rt.builtins-wasm32
linker flag. Thanks for the hint about libclang_rt.builtins-wasm32.a
!
from wasi-libc.
I recommend using clang to drive your link step to avoid such problems and future proof your build against toolchain changes.
from wasi-libc.
I also recommend against using the .bc
extension for your object files. That is probably old artifact of a older version of emscripten.. and I'm trying to move folks away from using that since it can lead to confusion.
from wasi-libc.
Related Issues (20)
- Adding `IFTODT` for more compatibility HOT 1
- A few packaging nits, coming from Nixpkgs/NixOS HOT 6
- Confusion around SIGCHLD value? HOT 2
- WASI signal numbers out of sync with wasi-libc signal numbers HOT 15
- Latest SIMD patch HOT 2
- fd_set implementation is inefficient HOT 5
- Support for `accept{,4}` HOT 3
- Implement the new preopen scheme in wasi-libc HOT 1
- __wasm_call_ctors broken previously wokring rust wasm reactors HOT 2
- getpagesize() HOT 4
- README seems to be wrong wrt minimal LLVM version HOT 4
- Provide socket option definitions HOT 3
- Missing __WASI_RIFLAGS_RECV_DATA_TRUNCATED for MSG_TRUNC HOT 1
- help how to disable feature for example( bulk memory)? HOT 1
- Humble request from distro packagers to start releasing versions HOT 6
- poll() with timeout fails with "timer subscriptions only support monotonic timer" HOT 1
- dlmalloc has license incompatible with Fedora policies HOT 12
- Migrate build system to CMake HOT 4
- How to distribute `THREAD_MODEL=posix` builds? HOT 46
- Is it safe to have mixed sbrk and malloc calls? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasi-libc.