make static linking work for upgraded
authorJohn Crispin <blogic@openwrt.org>
Thu, 19 Jun 2014 11:16:08 +0000 (12:16 +0100)
committerJohn Crispin <blogic@openwrt.org>
Thu, 19 Jun 2014 12:37:13 +0000 (13:37 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
CMakeLists.txt
upgraded/CMakeLists.txt
upgraded/upgraded [deleted file]

index 1616b72eef966e0a0dc3a4454e62b3aae49550ea..dc7ecd6e46ba04feda7d28ac3034ee3865c616f4 100644 (file)
@@ -21,9 +21,7 @@ IF(DEBUG)
   ADD_DEFINITIONS(-DDEBUG -g3)
 ENDIF()
 
-IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips")
 add_subdirectory(upgraded)
-ENDIF()
 
 ADD_EXECUTABLE(procd ${SOURCES})
 TARGET_LINK_LIBRARIES(procd ${LIBS})
index 7e08c0e798b7e961973f6e7cf44a3c66a8e2c95c..093dba2f2f92c89750757d53f641ab3bbdd63386 100644 (file)
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6)
 
 PROJECT(upgraded C)
 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
-set(CMAKE_EXE_LINKER_FLAGS -static)
+set(CMAKE_EXE_LINKER_FLAGS "-static -fPIC")
 set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
 set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)
 set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
@@ -11,7 +11,7 @@ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)
 set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
 ADD_EXECUTABLE(upgraded upgraded.c ../watchdog.c)
-TARGET_LINK_LIBRARIES(upgraded ubox rt)
+TARGET_LINK_LIBRARIES(upgraded ubox rt -lc -lgcc_pic)
 INSTALL(TARGETS upgraded
        RUNTIME DESTINATION sbin
 )
diff --git a/upgraded/upgraded b/upgraded/upgraded
deleted file mode 100755 (executable)
index a78470c..0000000
Binary files a/upgraded/upgraded and /dev/null differ