File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,17 @@ if(NOT TERMUX)
19
19
endif ()
20
20
##stop-editing
21
21
22
+ set (CMAKE_POSITION_INDEPENDENT_CODE ON )
22
23
# Termux specific, irrelevant to others. Fixes the `ld cannot find -lpthread` error when building static binary
23
24
set (THREADS_PREFER_PTHREAD_FLAG ON )
24
25
# Common, static building of external libpcap
25
26
option (USE_SYSTEM_PCAP "Disable System PCAP for static build" OFF )
26
27
if (ANDROID_PLATFORM STREQUAL "19" OR ANDROID_PLATFORM STREQUAL "20" )
27
28
# 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)
30
31
else ()
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)
32
33
endif ()
33
34
34
35
cmake_minimum_required (VERSION 3.12)
You can’t perform that action at this time.
0 commit comments