Skip to content

Commit 9f74c87

Browse files
committed
fix(android): add -fPIC to CFLAGS
1 parent c0e7154 commit 9f74c87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ else ifeq ($(PLATFORM),android)
117117
CC = $(BIN)/$(ARCH)-linux-$(ANDROID_ABI)-clang
118118
CURL_CONFIG = --host $(ARCH)-linux-$(ANDROID_ABI) --with-openssl=$(BIN)/../sysroot/usr LIBS="-lssl -lcrypto" AR=$(BIN)/llvm-ar AS=$(BIN)/llvm-as CC=$(CC) CXX=$(BIN)/$(ARCH)-linux-$(ANDROID_ABI)-clang++ LD=$(BIN)/ld RANLIB=$(BIN)/llvm-ranlib STRIP=$(BIN)/llvm-strip CFLAGS="-fPIC"
119119
TARGET := $(DIST_DIR)/cloudsync.so
120-
LDFLAGS += -shared -lcrypto -lssl
120+
CFLAGS += -fPIC
121+
LDFLAGS += -shared -fPIC -lssl -lcrypto
121122
STRIP = $(BIN)/llvm-strip --strip-unneeded $@
122123
else ifeq ($(PLATFORM),ios)
123124
TARGET := $(DIST_DIR)/cloudsync.dylib
@@ -226,6 +227,7 @@ $(OPENSSL):
226227
./Configure android-$(if $(filter aarch64,$(ARCH)),arm64,$(if $(filter armv7a,$(ARCH)),arm,$(ARCH))) \
227228
--prefix=$(BIN)/../sysroot/usr \
228229
no-shared no-unit-test \
230+
-fPIC \
229231
-D__ANDROID_API__=26 && \
230232
$(MAKE) && $(MAKE) install_sw
231233

0 commit comments

Comments
 (0)