File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,17 @@ if(NOT TERMUX)
1919endif ()
2020##stop-editing
2121
22+ set (CMAKE_POSITION_INDEPENDENT_CODE ON )
2223# Termux specific, irrelevant to others. Fixes the `ld cannot find -lpthread` error when building static binary
2324set (THREADS_PREFER_PTHREAD_FLAG ON )
2425# Common, static building of external libpcap
2526option (USE_SYSTEM_PCAP "Disable System PCAP for static build" OFF )
2627if (ANDROID_PLATFORM STREQUAL "19" OR ANDROID_PLATFORM STREQUAL "20" )
2728 # Needs a fix for duplicate symbol error on sdk19 static building, leaving to shared for now
28- set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++" CACHE STRING "" FORCE)
29- #set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static -z muldefs" CACHE STRING "" FORCE)
29+ set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -fPIC -fPIE " CACHE STRING "" FORCE)
30+ # NW set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static -z muldefs" CACHE STRING "" FORCE)
3031else ()
31- set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static" CACHE STRING "" FORCE)
32+ set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static -fPIC -fPIE " CACHE STRING "" FORCE)
3233endif ()
3334
3435cmake_minimum_required (VERSION 3.12)
You can’t perform that action at this time.
0 commit comments