[IOT-2295] Some libraries in "services" don't have the soname set.
authorHerve Jourdain <herve.jourdain@beechwoods.com>
Thu, 18 May 2017 08:06:57 +0000 (16:06 +0800)
committerUze Choi <uzchoi@samsung.com>
Mon, 22 May 2017 07:17:13 +0000 (07:17 +0000)
In the android case, this results in some jni libraries not being able
to load the shared libraries they depend upon, which results in errors.
The solution is to add the soname for the libraries that don't have it.

Change-Id: I52e3e3e182b1aeb9257862c7253d11023a634ac3
Signed-off-by: Herve Jourdain <herve.jourdain@beechwoods.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20105
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/cpp-wrapper/consumer/SConscript
service/notification/cpp-wrapper/provider/SConscript
service/resource-container/SConscript
service/resource-encapsulation/SConscript
service/resource-encapsulation/src/common/SConscript
service/resource-encapsulation/src/serverBuilder/SConscript

index 87dd0c7a581f9171e4d0ffa834f43274de7ba299..67186eac2f9997c2ebc25c051fd7b4116ad54356 100644 (file)
@@ -76,6 +76,7 @@ if target_os == 'linux':
 if target_os == 'android':
     notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_consumer_wrapper.so'])
 
 if not env.get('RELEASE') and target_os not in ['ios']:
     notification_env.PrependUnique(LIBS = ['gcov'])
index ba03bfb8ca146209a653cfc4865627c6aa1999de..35b2fbf381704a5c1016ca31c9b350b5c1feb238 100644 (file)
@@ -77,6 +77,7 @@ if target_os == 'linux':
 if target_os == 'android':
     notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider_wrapper.so'])
 
 if not env.get('RELEASE') and target_os not in ['ios']:
     notification_env.PrependUnique(LIBS = ['gcov'])
index 8b0565363ea08642fbfa7c5c82f4c2f4fb6faef7..67678d78a7fd8852cc9aa4f70f7dbc196afc953d 100644 (file)
@@ -144,6 +144,9 @@ else:
 resource_container_env.UserInstallTargetHeader('include/RCSBundleInfo.h', 'service/resource-container', 'RCSBundleInfo.h')
 resource_container_env.UserInstallTargetHeader('include/RCSResourceContainer.h', 'service/resource-container', 'RCSResourceContainer.h')
 
+if target_os in ['android']:
+    resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_container.so'])
+
 ######################################################################
 # build discomfort index sensor sample bundle
 ######################################################################
@@ -167,6 +170,9 @@ if target_os in ['linux', 'tizen', 'android']:
         Command("THSensorApp", DI_SENSOR_BUNDLE_DIR + "src/inputSensors/THSensorApp/THSensorApp", Copy("$TARGET", "$SOURCE"))
         Command("THSensorApp1", DI_SENSOR_BUNDLE_DIR + "src/inputSensors/THSensorApp1/THSensorApp1", Copy("$TARGET", "$SOURCE"))
 
+    if target_os in ['android']:
+        resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libDISensorBundle.so'])
+
 ######################################################################
 # build BMI sensor sample bundle
 ######################################################################
@@ -190,6 +196,9 @@ if target_os in ['linux', 'tizen', 'android']:
         Command("HeightSensorApp", BMI_SENSOR_BUNDLE_DIR + "src/inputSensors/HeightSensorApp/HeightSensorApp", Copy("$TARGET", "$SOURCE"))
         Command("WeightSensorApp", BMI_SENSOR_BUNDLE_DIR + "src/inputSensors/WeightSensorApp/WeightSensorApp", Copy("$TARGET", "$SOURCE"))
 
+    if target_os in ['android']:
+        resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libBMISensorBundle.so'])
+
 ######################################################################
 # build hue sample bundle
 ######################################################################
index 4eba1b5ec87eea656a2dbbf541201216114b626b..70b4328ce4b6c8156f12c6838c50fa62e3043842 100644 (file)
@@ -78,6 +78,7 @@ if target_os not in ['windows']:
 if target_os in ['android']:
     resourceClient_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     resourceClient_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    resourceClient_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_client.so'])
 
 if target_os in ['linux']:
     if not env.get('RELEASE'):
index 1c2b9e2c78bdb2b449b47d39518b2bb7c716f6e0..fedc923d924cf2e5afede5aab7ba29144efa9774 100644 (file)
@@ -62,6 +62,7 @@ if target_os not in ['darwin', 'ios', 'windows']:
 if target_os == 'android':
     rcs_common_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     rcs_common_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    rcs_common_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_common.so'])
 
 rcs_common_env.AppendUnique(LIBS = ['oc'])
 
index e85a4397e04d9c22dc01e4d870d2f9457a428488..4138d82eb3596797428c8f90794cce70b5e6b72e 100644 (file)
@@ -68,6 +68,7 @@ if target_os not in ['darwin', 'ios', 'windows']:
 if target_os in ['android']:
     server_builder_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     server_builder_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    server_builder_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_server.so'])
 
 if server_builder_env.get('SECURED') == '1':
        if server_builder_env.get('WITH_TCP') == True: