diff --git a/core/src/main/cpp/CMakeLists.txt b/core/src/main/cpp/CMakeLists.txt
index 2260c1a834ed26a2756744eae4bea76669924f1b..49b2b0a11cce72f126c1b1694bde240e99e67f8e 100644
--- a/core/src/main/cpp/CMakeLists.txt
+++ b/core/src/main/cpp/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)
 
 project(clash-bridge C)
 
+set(CMAKE_POSITION_INDEPENDENT_CODE on)
+
 set(GO_OUTPUT_BASE ${GO_OUTPUT}/${FLAVOR_NAME})
 
 if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")