Skip to content

Commit c6f5b56

Browse files
vlaskyospfrancoclaude
committed
Add Android 16KB page support via LDFLAGS
This supports upstream PR asg017#254 which needs to pass -Wl,-z,max-page-size=16384 for Android 16KB page support. Using LDFLAGS instead of CFLAGS prevents linker flags from leaking into compile-only steps, which could cause warnings or errors with stricter toolchains. Adds EXT_LDFLAGS variable to the loadable and cli targets, enabling users to pass linker-specific flags separately from compiler flags. Co-Authored-By: Oscar Franco <ospfranco@users.noreply.github.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e8f156b commit c6f5b56

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ endif
1717

1818
# Capture user-provided flags
1919
EXT_CFLAGS := $(CFLAGS) $(CPPFLAGS)
20+
EXT_LDFLAGS := $(LDFLAGS)
2021

2122
ifeq ($(shell uname -s),Darwin)
2223
CONFIG_DARWIN=y
@@ -108,7 +109,7 @@ $(TARGET_LOADABLE): sqlite-vec.c sqlite-vec.h $(prefix)
108109
-O3 \
109110
$(CFLAGS) $(EXT_CFLAGS) \
110111
$< -o $@ \
111-
$(LDLIBS)
112+
$(EXT_LDFLAGS) $(LDLIBS)
112113

113114
$(TARGET_STATIC): sqlite-vec.c sqlite-vec.h $(prefix) $(OBJS_DIR)
114115
$(CC) -Ivendor/ -fvisibility=hidden $(CFLAGS) $(EXT_CFLAGS) -DSQLITE_CORE -DSQLITE_VEC_STATIC \
@@ -155,7 +156,7 @@ $(TARGET_CLI): sqlite-vec.h $(LIBS_DIR)/sqlite-vec.a $(LIBS_DIR)/shell.a $(LIBS_
155156
-DSQLITE_ENABLE_STMT_SCANSTATUS -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
156157
-DSQLITE_EXTRA_INIT=core_init \
157158
$(CFLAGS) $(EXT_CFLAGS) \
158-
-ldl -lm \
159+
$(EXT_LDFLAGS) -ldl -lm \
159160
examples/sqlite3-cli/core_init.c $(LIBS_DIR)/shell.a $(LIBS_DIR)/sqlite3.a $(LIBS_DIR)/sqlite-vec.a -o $@
160161

161162

0 commit comments

Comments
 (0)