<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hi,</div><div class="gmail_quote"><br></div><div class="gmail_quote">Pavel Labath <span dir="ltr"><<a href="mailto:labath@google.com" target="_blank">labath@google.com</a>></span> wrote:<blockquote class="gmail_quote" 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>
- what is the system you are trying this out on (OS, arch, ...)?<br></blockquote><div><br></div><div>macOS, x86_64.</div><div> </div><blockquote class="gmail_quote" 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>
know about ? (e.g. if you're using -ffunction-sections<br>
-Wl,--gc-sections, then the function could have been removed even if<br>
the parts of the compile unit stay)<br></blockquote><div><br></div><div>Linker invocation:</div><div><br></div><div><div>Linking Shared Object ../../bin/maci64/libmwcgir_polly.dylib</div><div>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>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><br></div><div>So yes, there's  -Wl,-mark_dead_strippable_dylib + -Wl,-dead_strip + -Wl,-dead_strip_dylibs.</div><div> </div><blockquote class="gmail_quote" 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>
inline, or a template and unused then the compiler might not bother<br>
emitting it)<br></blockquote><div><br></div><div>It's not inline or a template. It's just a vanilla member function.</div><div> </div><blockquote class="gmail_quote" 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>
is indeed present in the resulting binary?<br></blockquote><div><br></div><div>macOS, so:</div><div><br></div><div>$ nm -a libmwcgir_polly.dylib | grep toString</div><div>00000000000050b0 T __ZNK2CG8analysis4SCOP8toStringEv</div><div>0000000000026f60 T __ZNK2CG8analysis8SCOPStmt8toStringEv </div><div><br></div><div>Does this mean that they're present?</div><div><br></div><div>Ram</div></div></div></div>