|
81 | 81 | "-D__faasm",
|
82 | 82 | ]
|
83 | 83 |
|
| 84 | +# Wasi-libc specific flags that are needed to include certain emulation headers |
| 85 | +WASM_WASI_LIBC_CFLAGS = [ |
| 86 | + "-D_WASI_EMULATED_GETPID", |
| 87 | + "-D_WASI_EMULATED_PROCESS_CLOCKS", |
| 88 | + "-D_WASI_EMULATED_SIGNAL", |
| 89 | +] |
| 90 | + |
| 91 | +WASM_CFLAGS += WASM_WASI_LIBC_CFLAGS |
| 92 | + |
84 | 93 | WASM_CXXFLAGS = WASM_CFLAGS
|
85 | 94 |
|
86 | 95 | # Flags for shared libraries
|
|
112 | 121 | "-Xlinker --no-check-features",
|
113 | 122 | ]
|
114 | 123 |
|
| 124 | +# Wasi-libc specific libraries we need to link with to enable certain emulated |
| 125 | +# functionalities |
| 126 | +WASM_WASI_LIBC_LDFLAGS = [ |
| 127 | + "-lc-printscan-long-double", |
| 128 | + "-lwasi-emulated-getpid", |
| 129 | + "-lwasi-emulated-process-clocks", |
| 130 | + "-lwasi-emulated-signal", |
| 131 | +] |
| 132 | + |
| 133 | +WASM_LDFLAGS += WASM_WASI_LIBC_LDFLAGS |
| 134 | + |
115 | 135 | # Flags for executables
|
116 | 136 | WASM_EXE_LDFLAGS = [
|
117 | 137 | "-Xlinker --stack-first",
|
|
125 | 145 | "-Wl,--initial-memory={}".format(FAASM_WASM_INITIAL_MEMORY_SIZE),
|
126 | 146 | ]
|
127 | 147 |
|
| 148 | +WASM_EXE_LDFLAGS += WASM_WASI_LIBC_LDFLAGS |
| 149 | + |
128 | 150 | # These are the compiler and linker flags required for functions that will also
|
129 | 151 | # do dynamic linking. We need to export all symbols to make them available to
|
130 | 152 | # the dynamically loaded modules
|
|
133 | 155 | "-Xlinker --no-gc-sections",
|
134 | 156 | ]
|
135 | 157 |
|
| 158 | +WASM_EXE_LDFLAGS_SHARED += WASM_WASI_LIBC_LDFLAGS |
| 159 | + |
136 | 160 | # Flags for shared libraries
|
137 | 161 | # See notes in README about WebAssembly and shared libraries
|
138 | 162 | WASM_LDFLAGS_SHARED = [
|
|
0 commit comments