Wrong linker flags are used
authorSeungyoun Ju <sy39.ju@samsung.com>
Sat, 16 Feb 2013 04:53:17 +0000 (13:53 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Sat, 16 Feb 2013 05:22:20 +0000 (14:22 +0900)
- Issues
  EXE Linker flags are defined and symbol visibility option is set wrongly

- Fix description
  Shared library linker flags are defined properly.
  Symbol visibility option is moved to cflags.

Change-Id: Id0636819b7eee80b01172069b185d1f6046d7554

CMakeLists.txt
src/tethering.c
src/tethering_client.c

index 75bd74ef81955b4b011585b813875e779802f0e5..474670baa97cf99481aef7a1e4253f172e11cc6f 100644 (file)
@@ -11,13 +11,17 @@ INCLUDE_DIRECTORIES(${INC_DIR})
 
 SET(dependents "dlog glib-2.0 capi-base-common dbus-glib-1 vconf")
 
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_name} REQUIRED ${dependents})
 FOREACH(flag ${${fw_name}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fvisibility=hidden")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 
 IF("${ARCH}" STREQUAL "arm")
@@ -27,7 +31,7 @@ ENDIF("${ARCH}" STREQUAL "arm")
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=%{_libdir} -fvisibility=hidden")
+SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed -Wl,--rpath=%{_libdir}")
 
 FIND_PROGRAM(MARSHALTOOL NAMES glib-genmarshal)
 EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${INC_DIR}/marshal.list --header > ${INC_DIR}/marshal.h")
index d75692ee95002a6611d932836e9b7b2c286a6d88..a4c82846fdd810efa79045881bd37b004ea1e496 100644 (file)
@@ -1865,7 +1865,7 @@ API int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_s
  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
  */
-int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid)
+API int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid)
 {
        _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "parameter(tethering) is NULL\n");
index 3dca57458afe9c2e74ca5351058c357e3857adcd..64cd78b18de0e75db25ce2132334906d02a4f877 100644 (file)
@@ -18,7 +18,7 @@
 #include <string.h>
 #include "tethering_private.h"
 
-int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin)
+API int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin)
 {
        _retvm_if(dest == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "Parameter(dest) is NULL\n");
@@ -39,7 +39,7 @@ int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin)
        return TETHERING_ERROR_NONE;
 }
 
-int tethering_client_destroy(tethering_client_h client)
+API int tethering_client_destroy(tethering_client_h client)
 {
        _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "Parameter(client) is NULL\n");
@@ -49,7 +49,7 @@ int tethering_client_destroy(tethering_client_h client)
        return TETHERING_ERROR_NONE;
 }
 
-int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type)
+API int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type)
 {
        _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "Parameter(client) is NULL\n");
@@ -63,7 +63,7 @@ int tethering_client_get_tethering_type(tethering_client_h client, tethering_typ
        return TETHERING_ERROR_NONE;
 }
 
-int tethering_client_get_name(tethering_client_h client, char **name)
+API int tethering_client_get_name(tethering_client_h client, char **name)
 {
        _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "Parameter(client) is NULL\n");
@@ -81,7 +81,7 @@ int tethering_client_get_name(tethering_client_h client, char **name)
        return TETHERING_ERROR_NONE;
 }
 
-int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address)
+API int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address)
 {
        _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "Parameter(client) is NULL\n");
@@ -99,7 +99,7 @@ int tethering_client_get_ip_address(tethering_client_h client, tethering_address
        return TETHERING_ERROR_NONE;
 }
 
-int tethering_client_get_mac_address(tethering_client_h client, char **mac_address)
+API int tethering_client_get_mac_address(tethering_client_h client, char **mac_address)
 {
        _retvm_if(client == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "Parameter(client) is NULL\n");