Modify nginx compile script for dynamic compilation#175
Modify nginx compile script for dynamic compilation#175rishabhBudhouliya wants to merge 4 commits intomainfrom
Conversation
vidyalakshmir
left a comment
There was a problem hiding this comment.
@rishabhBudhouliya Regarding lmbench, I had some questions.
- Shouldn't the compiler flag add -fPIC while compiling?
- Is libtirpc a library, if so its .so file should be produced and it be not statically compiled with lmbench
| if [[ "$LIND_DYLINK" == "1" ]]; then | ||
| echo "[nginx] running wasm-opt (dylink-aware: epoch-import + asyncify-import-globals)..." | ||
| "$WASM_OPT" \ | ||
| --enable-bulk-memory --enable-threads \ |
There was a problem hiding this comment.
Also noticed that there is no --fpcast-emu flag for the dynamic build.
There was a problem hiding this comment.
Yeah, I missed that. I also didn't test the network lmbench tests also so didn't notice a failure.
|
@vidyalakshmir The -fPIC flag is present under the DYLINK=1 section here: lind-wasm-apps/lmbench/src/compile_lmbench.sh Lines 198 to 201 in 668ef5e |
Thanks! |
|
@vidyalakshmir libtirpc perhaps should be dynamically linked but it is being statically compiled as before. I am unsure whether linking multiple dependencies dynamically is supported by lind-boot currently and if so, what are the steps to do so. |
|
@rishabhBudhouliya For lmbench, I got the following errors. Are these expected failures similar to the static build? |
Branch: dylink_impl_multi_process in lind-wasm introduces dynamic compilation.
Changes made to script:
- -nostartfiles + 3 custom CRT objects (set_stack_pointer.o, crt1_shared.o, lind_utils.o)
- -Wl,-pie --import-table --allow-undefined --unresolved-symbols=import-dynamic
- Exports: __wasm_call_ctors, __wasm_init_tls (if-defined), __tls_base
- Validates CRT objects exist at startup with helpful error messages
- Uses --enable-bulk-memory --enable-threads
- --epoch-injection --pass-arg=epoch-import --pass-arg=epoch-main-module
- --asyncify --pass-arg=asyncify-import-globals
- No --fpcast-emu, no -O2 (matches lmbench pattern)
- __wasm_apply_tls_relocs (func, optional)
- __wasm_apply_global_relocs (func, optional)
- __stack_pointer (global, required)