Commit a35b453
authored
add shared library support (#338)
This adds support for building WASI shared libraries per
https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md.
For the time being, the goal is to allow "pseudo-dynamic" linking using the
Component Model per
https://github.com/WebAssembly/component-model/blob/main/design/mvp/examples/SharedEverythingDynamicLinking.md.
This requires all libraries to be available when the component is created, but
still allows runtime symbol resolution via `dlopen`/`dlsym` backed by a static
lookup table. This is sufficient to support Python native extensions, for
example. A complete demo using `wit-component` is available at
https://github.com/dicej/component-linking-demo.
Signed-off-by: Joel Dice <[email protected]>1 parent 71fd9cb commit a35b453
3 files changed
+20
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| 155 | + | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| 164 | + | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | | - | |
165 | | - | |
| 168 | + | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
171 | | - | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
180 | | - | |
| 185 | + | |
181 | 186 | | |
182 | | - | |
183 | | - | |
| 187 | + | |
| 188 | + | |
184 | 189 | | |
185 | 190 | | |
186 | 191 | | |
187 | | - | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
192 | | - | |
| 197 | + | |
193 | 198 | | |
194 | 199 | | |
195 | | - | |
| 200 | + | |
196 | 201 | | |
197 | 202 | | |
198 | 203 | | |
| |||
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
205 | | - | |
| 210 | + | |
206 | 211 | | |
207 | 212 | | |
208 | 213 | | |
| |||
- Makefile+95-12
- README.md+1-1
- expected/wasm32-wasi-threads/include-all.c+1
- expected/wasm32-wasi-threads/predefined-macros.txt+9
- expected/wasm32-wasi-threads/undefined-symbols.txt-1
- expected/wasm32-wasi/include-all.c+1
- expected/wasm32-wasi/predefined-macros.txt+9
- expected/wasm32-wasi/undefined-symbols.txt-1
- libc-bottom-half/headers/public/__errno.h-5
- libc-bottom-half/signal/signal.c+2-2
- libc-bottom-half/sources/__main_void.c+11
- libc-top-half/musl/include/dlfcn.h+11-1
- libc-top-half/musl/include/pthread.h+2
- libc-top-half/musl/src/internal/locale_impl.h+8
- libc-top-half/musl/src/misc/dl.c+45
- libc-top-half/musl/src/thread/pthread_create.c+11-6
0 commit comments