security: Force link to libm (workaround)
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Fri, 12 May 2017 18:50:10 +0000 (20:50 +0200)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Tue, 30 May 2017 23:06:58 +0000 (23:06 +0000)
This is a workaround for g++-4.7,

For some (really) weird reason ceil function was not found
when linking (even if added only at end of linker command line).

If doubled (-lm -lm) it worked.

Observed issue:

  scons VERBOSE=1 RELEASE=true WITH_RA=1 WITH_RA_IBB=1

  g++ -o out/linux/x86_64/release/resource/csdk/security/provisioning/unittest/sample_server1 \
  -m64 -pthread out/linux/x86_64/release/resource/csdk/security/provisioning/unittest/sampleserver1.o \
  -Lout/linux/x86_64/release -L. (...)
  -Lout/linux/x86_64/release/resource/c_common -Lresource/c_common \
  -Lout/linux/x86_64/release/resource/csdk/logger -Lresource/csdk/logger \
  -Lextlibs/gtest/googletest-release-1.7.0/lib/.libs
  -locpmapi_internal -loc -loctbstack_internal -locsrm -lroutingmanager \
  -loc_logger_internal -lconnectivity_abstraction_internal
  -lcoap -lgtest -lgtest_main -lc_common -llogger -ldl -lpthread -lstrophe -lssl -lcrypto -lresolv
  -lwksxmppxep -lm
  -lboost_system -lboost_thread -luuid -lrt -lmbedtls -lmbedx509 -lmbedcrypto -lsqlite3 -lgio-2.0 -lgobject-2.0 -lglib-2.0
  out/linux/x86_64/release/libwksxmppxep.so: undefined reference to `ceil'

  gcc (Ubuntu/Linaro 4.7.3-12ubuntu1) 4.7.3

Bug: https://jira.iotivity.org/browse/IOT-2244
Change-Id: Ie8a69a4fdd99c346244cfaee17cc7e3780942b5a
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19839
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
resource/csdk/security/provisioning/unittest/SConscript

index fbdb5fd..78148a0 100644 (file)
@@ -84,6 +84,8 @@ if target_os in ['msys_nt', 'windows']:
 else:
     if target_os in ['linux', 'tizen']:
         sptest_env.ParseConfig('pkg-config --cflags --libs sqlite3 gobject-2.0 gio-2.0 glib-2.0')
+# TODO: remove this workaround needed for g++-4.7
+        sptest_env.Append(LIBS = ['m'])
 
 ######################################################################
 # Source files and Targets