|
@@ -0,0 +1,227 @@
|
|
1
|
+From 2533c88e18de689dbb26cfd4d585b1a991533c76 Mon Sep 17 00:00:00 2001
|
|
2
|
+From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
|
|
3
|
+Date: Tue, 21 Jul 2015 22:00:18 +0200
|
|
4
|
+Subject: [PATCH] build: make build fail if unresolved symbols found
|
|
5
|
+
|
|
6
|
+gcc links shared libs also when there are still some unresolved
|
|
7
|
+symbols, you have to specify it explicitly to make it fail in such
|
|
8
|
+cases. I think a compiler should fail in such cases otherwise
|
|
9
|
+someone will add some not intended dependencies or some existing
|
|
10
|
+dependencies are not getting declared.
|
|
11
|
+
|
|
12
|
+This patch makes gcc fail in such cases. I have only activated this for
|
|
13
|
+libs build in a Linux build and explicitly deactivates it for windows
|
|
14
|
+(does this even work at all?) This should be build tested with Android
|
|
15
|
+also.
|
|
16
|
+
|
|
17
|
+This was build tested for Linux and Android.
|
|
18
|
+
|
|
19
|
+This patch depends on some other patches I send which are fixing the
|
|
20
|
+problems I found with this change.
|
|
21
|
+
|
|
22
|
+Change-Id: I9ab79896ca2e86e9226cd9b39060a0763ef89694
|
|
23
|
+Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
|
|
24
|
+Reviewed-on: https://gerrit.iotivity.org/gerrit/1802
|
|
25
|
+Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
|
|
26
|
+Reviewed-by: Erich Keane <erich.keane@intel.com>
|
|
27
|
+Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
|
|
28
|
+Reviewed-by: Uze Choi <uzchoi@samsung.com>
|
|
29
|
+---
|
|
30
|
+ extlibs/expat/SConscript | 3 +++
|
|
31
|
+ .../csdk/connectivity/samples/android/SConscript | 1 +
|
|
32
|
+ resource/csdk/connectivity/src/SConscript | 3 +++
|
|
33
|
+ resource/oc_logger/SConscript | 3 +++
|
|
34
|
+ resource/src/SConscript | 3 +++
|
|
35
|
+ service/notification-manager/SConscript | 3 +++
|
|
36
|
+ service/protocol-plugin/plugin-manager/SConscript | 4 ++++
|
|
37
|
+ .../plugin-manager/src/Android/jni/SConscript | 1 +
|
|
38
|
+ service/protocol-plugin/plugins/SConscript | 3 +++
|
|
39
|
+ .../plugins/mqtt-fan/lib/cpp/SConscript | 3 +++
|
|
40
|
+ .../resource-manipulation/src/common/SConscript | 5 ++++-
|
|
41
|
+ .../src/resourceContainer/SConscript | 3 +++
|
|
42
|
+ .../src/resourceContainer/unittests/SConscript | 3 +++
|
|
43
|
+ .../src/serverBuilder/SConscript | 3 +++
|
|
44
|
+ service/soft-sensor-manager/SConscript | 3 +++
|
|
45
|
+ service/things-manager/SConscript | 3 +++
|
|
46
|
+ service/things-manager/sdk/java/jni/SConscript | 3 +++
|
|
47
|
+ 17 files changed, 49 insertions(+), 1 deletion(-)
|
|
48
|
+
|
|
49
|
+--- a/extlibs/expat/SConscript
|
|
50
|
++++ b/extlibs/expat/SConscript
|
|
51
|
+@@ -35,6 +35,9 @@ if target_os not in ['windows', 'winrt']
|
|
52
|
+ '-fexceptions', '-fno-common'])
|
|
53
|
+ expat_env.AppendUnique(CPPDEFINES = ['HAVE_EXPAT_CONFIG_H'])
|
|
54
|
+
|
|
55
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
56
|
++ expat_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
57
|
++
|
|
58
|
+ ######################################################################
|
|
59
|
+ # Source files and Targets
|
|
60
|
+ ######################################################################
|
|
61
|
+--- a/resource/csdk/connectivity/src/SConscript
|
|
62
|
++++ b/resource/csdk/connectivity/src/SConscript
|
|
63
|
+@@ -27,6 +27,9 @@ env.AppendUnique(CPPPATH = [ os.path.joi
|
|
64
|
+ if ca_os not in ['arduino', 'windows', 'winrt']:
|
|
65
|
+ env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
|
|
66
|
+
|
|
67
|
++if ca_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
68
|
++ env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
69
|
++
|
|
70
|
+ if ca_os in ['darwin','ios']:
|
|
71
|
+ env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
|
|
72
|
+
|
|
73
|
+--- a/resource/oc_logger/SConscript
|
|
74
|
++++ b/resource/oc_logger/SConscript
|
|
75
|
+@@ -42,6 +42,9 @@ if target_os not in ['arduino', 'windows
|
|
76
|
+ liboc_logger_env.AppendUnique(CFLAGS = ['-Wall', '-std=c99', '-fPIC'])
|
|
77
|
+ liboc_logger_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x', '-fPIC'])
|
|
78
|
+
|
|
79
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
80
|
++ liboc_logger_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
81
|
++
|
|
82
|
+ ######################################################################
|
|
83
|
+ # Source files and Targets
|
|
84
|
+ ######################################################################
|
|
85
|
+--- a/resource/src/SConscript
|
|
86
|
++++ b/resource/src/SConscript
|
|
87
|
+@@ -51,6 +51,9 @@ if target_os == 'linux':
|
|
88
|
+ if target_os not in ['windows', 'winrt']:
|
|
89
|
+ oclib_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC'])
|
|
90
|
+
|
|
91
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
92
|
++ oclib_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
93
|
++
|
|
94
|
+ if target_os == 'android':
|
|
95
|
+ oclib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
|
|
96
|
+ oclib_env.AppendUnique(LIBS = ['boost_thread', 'gnustl_shared', 'log'])
|
|
97
|
+--- a/service/notification-manager/SConscript
|
|
98
|
++++ b/service/notification-manager/SConscript
|
|
99
|
+@@ -65,6 +65,9 @@ notimgr_env.PrependUnique(LIBS = [
|
|
100
|
+ if target_os not in ['windows', 'winrt']:
|
|
101
|
+ notimgr_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
|
|
102
|
+
|
|
103
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
104
|
++ notimgr_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
105
|
++
|
|
106
|
+ if target_os == 'linux':
|
|
107
|
+ notimgr_env.AppendUnique(LIBS = ['pthread'])
|
|
108
|
+
|
|
109
|
+--- a/service/protocol-plugin/plugin-manager/SConscript
|
|
110
|
++++ b/service/protocol-plugin/plugin-manager/SConscript
|
|
111
|
+@@ -61,6 +61,10 @@ if target_os == 'android':
|
|
112
|
+ pmimpl_env = plugin_manager_env.Clone()
|
|
113
|
+ pmimpl_env.PrependUnique(CCFLAGS = ['-fPIC'])
|
|
114
|
+ pmimpl_env.PrependUnique(LIBS = File(env.get('BUILD_DIR') + '/libcpluff.a'))
|
|
115
|
++
|
|
116
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
117
|
++ pmimpl_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
118
|
++
|
|
119
|
+ pmimpl = pmimpl_env.SharedLibrary('pmimpl', pmimpl_src)
|
|
120
|
+
|
|
121
|
+ plugin_manager_env.InstallTarget([ppm, pmimpl], 'libppm')
|
|
122
|
+--- a/service/protocol-plugin/plugin-manager/src/Android/jni/SConscript
|
|
123
|
++++ b/service/protocol-plugin/plugin-manager/src/Android/jni/SConscript
|
|
124
|
+@@ -23,6 +23,7 @@ ppm_jni_env.PrependUnique(LIBS = ['pmimp
|
|
125
|
+ ppm_jni_env.AppendUnique(CPPPATH = [ppm_sdk+'/src'])
|
|
126
|
+ ppm_jni_env.AppendUnique(CPPPATH = [ppm_sdk+'/../lib/cpluff/libcpluff'])
|
|
127
|
+ ppm_jni_env.AppendUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/rapidxml'])
|
|
128
|
++ppm_jni_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
129
|
+
|
|
130
|
+ ######################################################################
|
|
131
|
+ # Source files and Targets
|
|
132
|
+--- a/service/protocol-plugin/plugins/SConscript
|
|
133
|
++++ b/service/protocol-plugin/plugins/SConscript
|
|
134
|
+@@ -40,6 +40,9 @@ if target_os not in ['windows', 'winrt']
|
|
135
|
+ plugins_env.PrependUnique(CCFLAGS = ['-fPIC'])
|
|
136
|
+ plugins_env.AppendUnique(LINKFLAGS = ['-fPIC'])
|
|
137
|
+
|
|
138
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
139
|
++ plugins_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
140
|
++
|
|
141
|
+ if target_os not in ['arduino', 'android']:
|
|
142
|
+ plugins_env.AppendUnique(LIBS = ['pthread'])
|
|
143
|
+
|
|
144
|
+--- a/service/protocol-plugin/plugins/mqtt-fan/lib/cpp/SConscript
|
|
145
|
++++ b/service/protocol-plugin/plugins/mqtt-fan/lib/cpp/SConscript
|
|
146
|
+@@ -16,6 +16,9 @@ mosquittopp_env.AppendUnique(CPPPATH = [
|
|
147
|
+ if target_os not in ['windows', 'winrt']:
|
|
148
|
+ mosquittopp_env.AppendUnique(CFLAGS = ['-Wall', '-ggdb', '-O2', '-fPIC'])
|
|
149
|
+
|
|
150
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
151
|
++ mosquittopp_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
152
|
++
|
|
153
|
+ if target_os == 'linux':
|
|
154
|
+ mosquittopp_env.AppendUnique(LIBS = ['pthread'])
|
|
155
|
+
|
|
156
|
+--- a/service/resource-encapsulation/src/resourceContainer/SConscript
|
|
157
|
++++ b/service/resource-encapsulation/src/resourceContainer/SConscript
|
|
158
|
+@@ -88,6 +88,9 @@ if target_os not in ['windows', 'winrt']
|
|
159
|
+ if target_os != 'android':
|
|
160
|
+ resource_container_env.AppendUnique(CXXFLAGS = ['-pthread'])
|
|
161
|
+
|
|
162
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
163
|
++ resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
164
|
++
|
|
165
|
+ if target_os == 'android':
|
|
166
|
+ resource_container_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
|
|
167
|
+ resource_container_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
|
|
168
|
+--- a/service/resource-encapsulation/src/resourceContainer/unittests/SConscript
|
|
169
|
++++ b/service/resource-encapsulation/src/resourceContainer/unittests/SConscript
|
|
170
|
+@@ -144,6 +144,9 @@ if int(containerJavaSupport):
|
|
171
|
+ test_bundle_env = container_gtest_env.Clone()
|
|
172
|
+ test_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
|
|
173
|
+
|
|
174
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
175
|
++ test_bundle_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
176
|
++
|
|
177
|
+ TEST_BUNDLE_DIR = 'TestBundle/'
|
|
178
|
+ test_bundle_env.AppendUnique(CPPPATH = [
|
|
179
|
+ TEST_BUNDLE_DIR + 'include',
|
|
180
|
+--- a/service/resource-encapsulation/src/serverBuilder/SConscript
|
|
181
|
++++ b/service/resource-encapsulation/src/serverBuilder/SConscript
|
|
182
|
+@@ -54,6 +54,9 @@ if target_os not in ['windows', 'winrt']
|
|
183
|
+ if target_os != 'android':
|
|
184
|
+ server_builder_env.AppendUnique(CXXFLAGS = ['-pthread'])
|
|
185
|
+
|
|
186
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
187
|
++ server_builder_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
188
|
++
|
|
189
|
+ if target_os == 'android':
|
|
190
|
+ server_builder_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
|
|
191
|
+ server_builder_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
|
|
192
|
+--- a/service/soft-sensor-manager/SConscript
|
|
193
|
++++ b/service/soft-sensor-manager/SConscript
|
|
194
|
+@@ -45,6 +45,9 @@ if target_os not in ['windows', 'winrt']
|
|
195
|
+ soft_sensor_manager_env.AppendUnique(LIBS = ['pthread'])
|
|
196
|
+ soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-pthread'])
|
|
197
|
+
|
|
198
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
199
|
++ soft_sensor_manager_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
200
|
++
|
|
201
|
+ if target_os == 'android':
|
|
202
|
+ soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
|
|
203
|
+ soft_sensor_manager_env.AppendUnique(LIBS = ['gnustl_shared'])
|
|
204
|
+--- a/service/things-manager/SConscript
|
|
205
|
++++ b/service/things-manager/SConscript
|
|
206
|
+@@ -43,6 +43,9 @@ if target_os not in ['windows', 'winrt']
|
|
207
|
+ things_manager_env.AppendUnique(CXXFLAGS = ['-pthread'])
|
|
208
|
+ things_manager_env.AppendUnique(LIBS = ['pthread'])
|
|
209
|
+
|
|
210
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
211
|
++ things_manager_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
212
|
++
|
|
213
|
+ if target_os == 'android':
|
|
214
|
+ things_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
|
|
215
|
+ things_manager_env.PrependUnique(LIBS = ['gnustl_shared'])
|
|
216
|
+--- a/service/things-manager/sdk/java/jni/SConscript
|
|
217
|
++++ b/service/things-manager/sdk/java/jni/SConscript
|
|
218
|
+@@ -27,6 +27,9 @@ tm_jni_env.AppendUnique(CPPPATH = [tm_sd
|
|
219
|
+ tm_jni_env.AppendUnique(CPPPATH = [base_jni])
|
|
220
|
+ tm_jni_env.AppendUnique(CPPPATH = ['tm/inc', 'jniutil/inc', extlibs+'/timer/'])
|
|
221
|
+
|
|
222
|
++if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
|
|
223
|
++ tm_jni_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
|
|
224
|
++
|
|
225
|
+ ######################################################################
|
|
226
|
+ # Source files and Targets
|
|
227
|
+ ######################################################################
|