From 36ec3eb10169fc96f4f6e0021757645716347109 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Fri, 12 May 2017 20:50:10 +0200 Subject: [PATCH] security: Force link to libm (workaround) 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/19839 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- resource/csdk/security/provisioning/unittest/SConscript | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resource/csdk/security/provisioning/unittest/SConscript b/resource/csdk/security/provisioning/unittest/SConscript index fbdb5fd..78148a0 100644 --- a/resource/csdk/security/provisioning/unittest/SConscript +++ b/resource/csdk/security/provisioning/unittest/SConscript @@ -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 -- 2.7.4