Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions pglite-wasm/excluded.pglite.imports

This file was deleted.

12 changes: 10 additions & 2 deletions src/backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,20 @@ postgres: $(OBJS)

# Extensions use functions from the core PG. These need to be exported by the emscripten compiler.
# The following target gathers all extension imports + the default ones (included.pglite.imports),
# excludes the one in excluded.pglite.imports and adds a leading _ to each.
# excludes (invoke_* and __indirect_function_table) (Emscripten runtime trampolines)
# exlcudes defined excludes, libpq exports, and libossp-uuid exports
# and adds a leading _ to each.
pglite-exported-functions:
$(MKDIR_P) '$(emscripten_imports_dir)'
cat $(top_builddir)/pglite-wasm/excluded.*.imports $(top_builddir)/src/interfaces/libpq/exports.list $(LIB_EXPORTS_DIR)/libossp-uuid.exports | sort -u > '$(top_builddir)/pglite-wasm/excluded.imports'
@# Build the exclusion list
cat $(top_builddir)/src/interfaces/libpq/exports.list $(LIB_EXPORTS_DIR)/libossp-uuid.exports | sort -u > '$(top_builddir)/pglite-wasm/excluded.imports'
@# Generate exported_functions.txt:
@# 1. Filter out invoke_* and __indirect_function_table (Emscripten runtime, never export)
@# 2. Filter out symbols in excluded.imports (build in previous step)
@# 3. Add underscore prefix
cat $(DESTDIR)$(emscripten_extension_imports_dir)/*.imports '$(top_builddir)/pglite-wasm/included.pglite.imports' | \
sort -u | \
grep -v -E '^(invoke_|__indirect_function_table)' | \
grep -Fvx -f '$(top_builddir)/pglite-wasm/excluded.imports' | \
sed 's/^/_/' \
> '$(emscripten_imports_dir)/exported_functions.txt'
Expand Down