<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Hi all<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">i am trying to build OVS 2.5.3&nbsp;with shared libraries&nbsp;for aarch64 with a Linaro toolchain based on GCC 5.3.1<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">“</span><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">gcc
</span><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">–</span><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">v</span><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">”
</span><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">&nbsp;gives<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05)<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">my configure line&nbsp;shows this &nbsp;(from config.log). note that it was generated by buildroot so some options are meaningless for OVS<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">/configure --target=aarch64-buildroot-linux-gnu --host=aarch64-buildroot-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --localstatedir=/var --program-prefix=
 --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no --disable-dependency-tracking --enable-ipv6 --disable-static --enable-shared<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">i come across 2 issues during link time. The first issue is linking the ovs-ofctl utility. during link time ld complains that i can't find the libsflow which ofproto needs. Here is the link line
 and related error.<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">&nbsp;link: /home/yehuday/projects/ucpe/buildroot/output/host/usr/bin/aarch64-linux-gnu-gcc -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wswitch-enum -Wunused-parameter
 -Wbad-function-cast -Wcast-align -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -o utilities/.libs/ovs-ofctl utilities/ovs-ofctl.o &nbsp;-L/home/yehuday/projects/ucpe/buildroot/output/host/usr/aarch64-buildroot-linux-gnu/sysroot/usr//lib
 ofproto/.libs/libofproto.so lib/.libs/libopenvswitch.so -latomic -lpthread -lrt -lm<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">/home/yehuday/compilers/armv8/gcc-linaro-5.3.1-2016.05-i686_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.3.1/../../../../aarch64-linux-gnu/bin/ld: warning: libsflow.so.1,
 needed by ofproto/.libs/libofproto.so, not found (try using -rpath or -rpath-link)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_poller_set_bridgePort@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_removePoller@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_receiver_set_sFlowRcvrTimeout@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_addPoller@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_sampler_get_sFlowFsPacketSamplingRate@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_receiver_set_sFlowRcvrOwner@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_sampler_set_sFlowFsPacketSamplingRate@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_tick@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_poller_set_sFlowCpInterval@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_sampler_set_sFlowFsReceiver@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_removeSampler@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_init@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_sampler_set_sFlowFsMaximumHeaderSize@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_release@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_poller_writeCountersSample@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_addReceiver@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_sampler_writeFlowSample@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_agent_addSampler@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/libofproto.so: undefined reference to `sfl_poller_set_sFlowCpReceiver@libsflow_1'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">collect2: error: ld returned 1 exit status<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">make[2]: *** [utilities/ovs-ofctl] Error 1<o:p></o:p></span></p>
</div>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">libsflow.so is not mentioned anywhere in the build command, i assume ld extracts it from ofproto. However libsflow's path,&nbsp;&quot;./lib/.libs&quot;,&nbsp;is not specified so i'm not sure how ld can find it<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">i managed to resolve this issue by &nbsp;adding &quot;-Wl,-rpath-link,lib/.libs&quot; but I think that’s not so clean.<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">What is&nbsp;even stranger is that the problem disappears when i use the custom ubuntu aarch64&nbsp;compiler
<span style="background:white">(GCC 4.8.4)</span>&nbsp;or when i compile for x86. maybe the builtin compilers know that they need to search under
</span><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">project folders</span><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"> ?&nbsp;<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">another issue i come accross is related to Buildroot panic checks. buildroot makes sure that when cross-compiling the linker never uses the host libraries. when relinking ofproto a &quot;-L/usr/lib&quot;
 causes a failure of that check. thechnically there is no reason to include /usr/lib in the search path but i can't find how to disable that&nbsp;<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">here is the link line and error<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">libtool: relink: /home/yehuday/projects/ucpe/buildroot/output/host/usr/bin/aarch64-linux-gnu-gcc -shared &nbsp;-fPIC -DPIC &nbsp;ofproto<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">/.libs/ofproto_libofproto_la-bond.o ofproto/.libs/ofproto_libofproto_la-collectors.o ofproto/.libs/ofproto_libofproto_la-connm<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">gr.o ofproto/.libs/ofproto_libofproto_la-fail-open.o ofproto/.libs/ofproto_libofproto_la-in-band.o ofproto/.libs/ofproto_libof<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">proto_la-names.o ofproto/.libs/ofproto_libofproto_la-netflow.o ofproto/.libs/ofproto_libofproto_la-ofproto.o ofproto/.libs/ofp<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">roto_libofproto_la-ofproto-dpif.o ofproto/.libs/ofproto_libofproto_la-ofproto-dpif-ipfix.o ofproto/.libs/ofproto_libofproto_la<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">-ofproto-dpif-mirror.o ofproto/.libs/ofproto_libofproto_la-ofproto-dpif-monitor.o ofproto/.libs/ofproto_libofproto_la-ofproto-<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">dpif-rid.o ofproto/.libs/ofproto_libofproto_la-ofproto-dpif-sflow.o ofproto/.libs/ofproto_libofproto_la-ofproto-dpif-upcall.o&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">ofproto/.libs/ofproto_libofproto_la-ofproto-dpif-xlate.o ofproto/.libs/ofproto_libofproto_la-pktbuf.o ofproto/.libs/ofproto_li<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">bofproto_la-pinsched.o ofproto/.libs/ofproto_libofproto_la-tunnel.o ofproto/.libs/ofproto_libofproto_la-bundles.o &nbsp; -L/home/ye<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">huday/projects/ucpe/buildroot/output/host/usr/aarch64-buildroot-linux-gnu/sysroot/usr//lib -L/home/yehuday/projects/ucpe/build<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">root/output/host/usr/aarch64-buildroot-linux-gnu/sysroot/usr/lib -L/usr/lib -lsflow -latomic -lpthread -lrt -lm &nbsp;-Os -Wl,--ver<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">sion-script=./ofproto/libofproto.sym &nbsp; -Wl,-soname -Wl,libofproto.so.1 -o ofproto/.libs/libofproto.so.1.0.0<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">aarch64-linux-gnu-gcc: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/lib'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">libtool: install: error: relink `ofproto/libofproto.la' with the above command before installing it<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">make[5]: *** [install-libLTLIBRARIES] Error 1<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">​any help is greatly appreciated&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Thanks<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Yehuda&nbsp;<o:p></o:p></span></p>
</div>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>