Open kassane opened 6 months ago
All flags: https://github.com/ldc-developers/ldc/blob/master/driver%2Fcl_options.cpp https://github.com/dlang/dub/blob/master/source%2Fdub%2Fcompilers%2Fldc.d
Based on some information, it is expected to improve support for nogc and/or betterC.
Currently the user_data
example requires GC because of AA (associative array)
The latest changes are intended to remove support for custom-Druntime (obsolete and incomplete). Only wasm32-target as betterC will be allowed. #20 This needs to be re-tested and improved.
However, for a higher priority, it is still necessary to resolve the linking conflicts of the objects generated by ldmd2/ldc2
Note: ldmd2 is just the wrapper for the ldc2 compiler, using the dmd flags (ldc2 -ldmd
- w/ dmd library).
wasm32-unknown-unknwon-wasm
is wasm32-freestanding
]
wasm-unknown-emscripten
get Warning: unknown target OS: emscripten
wasm32-emscripten
]*.wasm
). [wasm32-unknown-emscripten
]In the following, I have tested it manually (no zig build system).
Note 2: LTO between ldc2 and emcc cause warnings. Prefer enable LTO in ldc2 only (no or minimum warnings)!!
wasm-ld: warning: Linking two modules of different data layouts: '/home/kassane/.cache/zig/p/122083537ec3463ee4b2d520bf86a36b1057ab05abfe712c32bae1048f9b0c6e2a13/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc.a(llrintl.o at 2994444)' is 'e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20' whereas 'ld-temp.o' is 'e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20'
cc: @floooh
Just FIY, I'll be travelling until Thursday and will probably be unresponsive during that time.
Just FIY, I'll be travelling until Thursday and will probably be unresponsive during that time.
No trouble! Enjoy your travels.
Note 2: LTO between ldc2 and emcc cause warnings. Prefer enable LTO in ldc2 only (no or minimum warnings)!!
After fix ldc2 (master) issue (add wasm32-unknown-emscripten
)...
I have discovered a strange situation, in that when enabling LTO on all in release mode.
warning: Linking two modules of different target triples: '/home/kassane/sokol-d/zig-cache/o/11f2f18f48ea24e538f790ad4c0e12f8/libsokol.a(sokol_gfx.o at 101382)' is 'wasm32-unknown-emscripten-musl' whereas 'ld-temp.o' is 'wasm32-unknown-emscripten'
wasm32-unknown-emscripten-musl
?? Maybe based on wasi target.
The issue is fixed (without warnings) when passing -Dtarget=wasm32-emscripten-none
.
After new updates and the possible inclusion of imgui support. As you can see, build.zig
is quite long and complicated.
Unlike the sokol-zig approach (by @floooh), sokol-d has everything included, which requires extending the support in build.zig
.
So far, the port of pacman.c/pacman.zig to pacman.d is in progress, as a first external solution using sokol-d.
Any suggestions for other approaches to reduce such complexity?
Maybe pacman.d can serve as a reference.
External Reference