Add build script to compile bash dynamically#93
Open
vidyalakshmir wants to merge 1 commit intomainfrom
Open
Conversation
Contributor
Author
|
I am adding this PR to get started with compiling apps for dynamic loading. I have mentioned the steps followed to use the new 'dynamic loading' branch within lind-wasm. Also the steps to build bash dynamically was followed looking at the python build scripts from 'build_python' branch of lind-wasm-apps/. I am hitting an issue when I run both bash and python which is built for dynamic loading. @qianxichen233 |
rennergade
reviewed
Feb 26, 2026
| fi | ||
|
|
||
| BASE_SYSROOT="${BASE_SYSROOT:-$LIND_WASM_ROOT/build/sysroot}" | ||
| MERGED_SYSROOT="${APPS_MERGED:-$APPS_ROOT/build/sysroot_merged}" |
Contributor
There was a problem hiding this comment.
this is a static build thing. is libc not dynamic now?
rennergade
reviewed
Feb 26, 2026
| fi | ||
|
|
||
| ############################################################################### | ||
| # 10. Install to Lind Filesystem |
Contributor
There was a problem hiding this comment.
probably want to remove this since we'll have our own make install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a dynamic (shared) WebAssembly build script for Bash.
Key Changes
-fPICtoCFLAGSso all core objects and builtins are compiled for dynamic linking.-Wl,-pie,-Wl,--import-table,-Wl,--export-dynamic,-Wl,--experimental-pic).libdlSupport: Re-introduced-ldlin the final linker command to support loading shared objects at runtime.bashbinary (and.cwasmif available) directly into$LINDFS_ROOT/bin.Integration with
lind-wasmbranchdylink_impl_integrationThe latest
dylink_impl_integrationof lind-wasm is used. Steps followed are detailed below.Updated
lind-wasm/scripts/append_tls_relocs_export.shto use standardwasm2watandwat2wasmcommands instead of absolute paths.Tested
Test script
Tested with a simple test script
lind-wasm/lindfs/bash_tests/test.shCommand to run the test
sudo /home/lind/lind-wasm/src/lind-boot/target/debug/lind-boot --preload env=/lib/libc.so --preload env=/lib/libm.so /bin/bash /bash_tests/test.shTest output