I got around the problem using attribute used.<br><br>Ram<br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 10, 2017 at 9:02 AM Ramkumar Ramachandra <<a href="mailto:artagnon@gmail.com">artagnon@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">Hi,</div><div class="gmail_quote gmail_msg"><br class="gmail_msg"></div><div class="gmail_quote gmail_msg"></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">Pavel Labath <span dir="ltr" class="gmail_msg"><<a href="mailto:labath@google.com" class="gmail_msg" target="_blank">labath@google.com</a>></span> wrote:<blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
a have couple of question to better understand the situation:<br class="gmail_msg">
- what is the system you are trying this out on (OS, arch, ...)?<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">macOS, x86_64.</div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- are you using any funny compiler options that you think we should<br class="gmail_msg">
know about ? (e.g. if you're using -ffunction-sections<br class="gmail_msg">
-Wl,--gc-sections, then the function could have been removed even if<br class="gmail_msg">
the parts of the compile unit stay)<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">Linker invocation:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">Linking Shared Object ../../bin/maci64/libmwcgir_polly.dylib</div><div class="gmail_msg">xcrun -sdk macosx10.11 clang++ -arch x86_64 -dynamiclib -single_module -install_name @rpath/libmwcgir_polly.dylib  -Wl,-mark_dead_strippable_dylib   -arch x86_64 -mmacosx-version-min=10.9 -stdlib=libc++ -Wl,-dead_strip -Wl,-dead_strip_dylibs -stdlib=libc++       -o ../../bin/maci64/libmwcgir_polly.dylib ../../derived/maci64/obj/src/cgir_polly/Analysis/MemoryAccess.o ../../derived/maci64/obj/src/cgir_polly/Analysis/SCOP.o ../../derived/maci64/obj/src/cgir_polly/Analysis/SCOPExtraction.o ../../derived/maci64/obj/src/cgir_polly/Analysis/SCOPStmt.o ../../derived/maci64/obj/src/cgir_polly/CodeGen/IRGeneration.o ../../derived/maci64/obj/src/cgir_polly/IslWrap/Isl.o ../../derived/maci64/obj/src/cgir_polly/Transform/Polly.o ../../derived/maci64/obj/src/cgir_polly/Transform/PollyImpl.o ../../derived/maci64/obj/src/cgir_polly/Util/PollyPrinter.o ../../derived/maci64/obj/src/cgir_polly/modver.o -L../../bin/maci64 -L../../bin/maci64 -lmwfoundation_usm -lmwcg_ir -lmwcgir_support -lmwcgir_cgel -lut -lmwfl -L../../bin/maci64 -lboost_system -L../../bin/maci64 -lmwcpp11compat -L//mathworks/hub/3rdparty/R2017b/2334121/maci64/isl/lib -lisl -L//mathworks/hub/3rdparty/R2017b/2309377/maci64/jsoncpp/lib -ljsoncpp -L//mathworks/hub/3rdparty/R2017a/2105192/maci64/python2/lib -lpython2.7 -Wl,-rpath,@loader_path -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../sys/os/maci64</div><div class="gmail_msg">xcrun -sdk macosx10.11 clang++ -arch x86_64 -c pkgtest/tMatrixAssign.cpp -o ../../derived/maci64/obj/src/cgir_polly/pkgtest/tMatrixAssign.o -MMD -MF ../../derived/maci64/obj/src/cgir_polly/pkgtest/tMatrixAssign.d -MP -MT ../../derived/maci64/obj/src/cgir_polly/pkgtest/tMatrixAssign.o  -Iexport/include -I. -I../../src/include -I../../derived/maci64/src/include -I../include -I../../include -I../../derived/maci64/src/cgir_polly/include -I../../derived/maci64/src/cgir_polly/ -isystem//mathworks/hub/3rdparty/R2017a/1971079/maci64/boost/include -isystem//mathworks/hub/3rdparty/R2017a/1946655/maci64/cpp11compat/include -isystem//mathworks/hub/3rdparty/R2017b/2334121/maci64/isl/include -isystem//mathworks/hub/3rdparty/R2017b/2309377/maci64/jsoncpp/include -isystem//mathworks/hub/3rdparty/R2017a/2105192/maci64/python2/include/python2.7 -isystem//mathworks/hub/3rdparty/R2017a/2101198/maci64/gmock/include/gmock -isystem//mathworks/hub/3rdparty/R2017a/2101198/maci64/gmock/include/gtest   -mmacosx-version-min=10.9  -DMODULE_VERSION_SYMBOL=libmwcgir_polly_version -DMODULE_DATE_SYMBOL=libmwcgir_polly_build_date -Dmw_test_main=main -DBOOST_CB_DISABLE_DEBUG -DBOOST_THREAD_FUTURE=unique_future -DBOOST_SPIRIT_THREADSAFE -DPHOENIX_THREADSAFE -DBOOST_SIGNALS_NO_DEPRECATION_WARNING -DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS -DBOOST_MPL_LIMIT_VECTOR_SIZE=30 -DBOOST_MPL_LIMIT_MAP_SIZE=30 -DNEEDS_BOOST_UNIQUE_PTR=1    -DBUILDING_CGIR_POLLY -DGTEST_MW_USE_MW_NOT_EQUALS=1 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DBUILDING_PKGTEST -O2 -stdlib=libc++ -pipe -D_REENTRANT -std=c++11 -g -DNDEBUG -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor -Wno-unused -Wno-inconsistent-missing-override -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -std=c++11 -stdlib=libc++ -ftemplate-depth-1024 -Werror</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So yes, there's  -Wl,-mark_dead_strippable_dylib + -Wl,-dead_strip + -Wl,-dead_strip_dylibs.</div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- how exactly is your function declared? (e.g. if it's declared as<br class="gmail_msg">
inline, or a template and unused then the compiler might not bother<br class="gmail_msg">
emitting it)<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">It's not inline or a template. It's just a vanilla member function.</div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- could you verify (e.g. by running "objdump -t") that your function<br class="gmail_msg">
is indeed present in the resulting binary?<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">macOS, so:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">$ nm -a libmwcgir_polly.dylib | grep toString</div><div class="gmail_msg">00000000000050b0 T __ZNK2CG8analysis4SCOP8toStringEv</div><div class="gmail_msg">0000000000026f60 T __ZNK2CG8analysis8SCOPStmt8toStringEv </div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Does this mean that they're present?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Ram</div></div></div></div>
</blockquote></div>