<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 16, 2021 at 5:50 PM Johnson, Andrew N. <<a href="mailto:anj@anl.gov">anj@anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
On Feb 16, 2021, at 5:26 PM, Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
<div>
<blockquote type="cite"><br>
<div>
<div dir="auto">Can you provide a cutdown? </div>
</div>
</blockquote>
<div><br>
</div>
<div>Sure, it’s 1 line of source:</div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"><b>tux%
</b>cat m.cpp </span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">#include <cmath></span></div></blockquote></div></div></div></blockquote><div><br></div><div>I can confirm this one-liner compilers on every rtems 5 and 6 gcc target including m68k but when you add mcpu=5282 to either the rtems 5 or 6 gcc it does not compile. </div><div><br></div><div>The next step would be to look at the multilib directories selected by that. Something must be different about that vs the default (m68020 w/FPU).</div><div><br></div><div>Luckily I had 4.11 tools laying around and I can report it works with the 4.11 GCC. Bad news, is that it is gcc 4.9.3 versus gcc 7. I suspect an examination of what that compiler did versus the new one will highlight the issue. Then we have to look at the config/m68k/t-* files RTEMS uses for changes.</div><div><br></div><div>[joel@devel cmath]$ /home/joel/rtems-cron-411/tools/4.11/bin//m68k-rtems4.11-gcc -c -mcpu=5282 m.cc<br>[joel@devel cmath]$ /home/joel/rtems-cron-411/tools/4.11/bin//m68k-rtems4.11-gcc --version<br>m68k-rtems4.11-gcc (GCC) 4.9.3 20150626 (RTEMS 4.11, RSB 158ad680aed1c4fd00f00d5b0e269391597872ef, Newlib 2.2.0.20150423)<br></div><div><br></div><div>I'm afraid I did the quick part since I had the tools. Gedare.. can you do some version comparison and gcc git archeology? Just chat me and we can run this down.</div><div><br></div><div>--joel</div><div><br></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"><div style="overflow-wrap: break-word;"><div><div><blockquote type="cite">
</blockquote>
<div><br>
</div>
<div>which when compiled:</div>
<br>
<div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">
<blockquote type="cite">
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><b>tux%
</b>/local/anj/RTEMS-5.1/rtems-5.1/bin/m68k-rtems5-g++ -B/local/anj/RTEMS-5.1/rtems-5.1/m68k-rtems5/uC5282/lib/ -specs bsp_specs -qrtems -mcpu=5282 -Wall -c m.cpp</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">In file included from
<b>m.cpp:1:0</b>:</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><b>/local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/cmath:1086:11:</b>
</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>error:
</b></span><span style="font-variant-ligatures:no-common-ligatures">'<b>::acoshl</b>' has not been declared</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> using ::</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>acoshl</b></span><span style="font-variant-ligatures:no-common-ligatures">;</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">
</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>^~~~~~</b></span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><b>/local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/cmath:1090:11:</b>
</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>error:
</b></span><span style="font-variant-ligatures:no-common-ligatures">'<b>::asinhl</b>' has not been declared</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> using ::</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>asinhl</b></span><span style="font-variant-ligatures:no-common-ligatures">;</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">
</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>^~~~~~</b></span></div>
</blockquote>
<div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b><br>
</b></span></div>
</div>
</span></div>
</div>
</div>
<div>Long list of errors truncated as before.</div>
<div><br>
</div>
<blockquote type="cite">
<div>
<div dir="auto">
<div dir="auto">And any idea what those using statements are referring to? I know the methods in libm but so not understand what it means in the context of using</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I think that's how you ask C++ to import symbols into the current namespace (they are all inside a
<font face="Menlo">namespace std {...}</font> block), but I’m not a C++ expert. In any case they come from gcc. EPICS probably doesn’t need any of the missing functions which look to have been added by C99, but we do need to be able to pull in math.h
and/or cmath from C++ code.</div>
<div><br>
</div>
<div>- Andrew</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Feb 16, 2021, 4:42 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi Andrew,<br>
<br>
On Tue, Feb 16, 2021 at 1:16 PM Johnson, Andrew N. <<a href="mailto:anj@anl.gov" rel="noreferrer" target="_blank">anj@anl.gov</a>> wrote:<br>
><br>
> I tried to build the in-progress port of EPICS for the uC5282 BSP last night against a release build of RTEMS-5.1 with tools and BSP built using RSB. It looks like the g++ cmath routines haven't been configured properly for this target. It failed at the first
C++ source file includes math.h (other BSPs such as the beatnik and qoriq_e500 get further than this, and only the pc686 build completely succeeds right now):<br>
><br>
> > /local/anj/RTEMS-5.1/rtems-5.1/bin/m68k-rtems5-g++ -B/local/anj/RTEMS-5.1/rtems-5.1/m68k-rtems5/uC5282/lib/ -specs bsp_specs -qrtems -mcpu=5282 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DUNIX -O2 -g -ffunction-sections -fdata-sections
-Wall -DMY_DO_BOOTP=NULL -D__LINUX_ERRNO_EXTENSIONS__ -DHAVE_SOCKADDR_SA_LEN=1 -I. -I../O.Common -I. -I../osi/compiler/gcc -I../osi/compiler/default -I. -I../osi/os/RTEMS-posix -I../osi/os/RTEMS -I../osi/os/posix -I../osi/os/default -I.. -I../as
-I../bucketLib -I../calc -I../cvtFast -I../cppStd -I../cxxTemplates -I../dbmf -I../ellLib -I../env -I../error -I../fdmgr -I../flex -I../freeList -I../gpHash -I../iocsh -I../log -I../macLib -I../misc -I../osi -I../pool -I../ring -I../taskwd -I../timer -I../yacc
-I../yacc -I../yajl -I../../../../include/compiler/gcc -I../../../../include/os/RTEMS -I../../../../include -c ../cxxTemplates/resourceLib.cpp<br>
<br>
I don't see -lm not sure if that is an issue or not, but it seems<br>
suspect. can you snip out the compiler command line to compare with<br>
the pc686 build?<br>
<br>
> > In file included from /local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/math.h:36:0,<br>
> > from ../cxxTemplates/resourceLib.h:38,<br>
> > from ../cxxTemplates/resourceLib.cpp:15:<br>
> > /local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/cmath:1086:11: error: '::acoshl' has not been declared<br>
> > using ::acoshl;<br>
> > ^~~~~~<br>
> > /local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/cmath:1090:11: error: '::asinhl' has not been declared<br>
> > using ::asinhl;<br>
> > ^~~~~~<br>
> > /local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/cmath:1094:11: error: '::atanhl' has not been declared<br>
> > using ::atanhl;<br>
> > ^~~~~~<br>
> ><br>
> > ... many similar errors snipped ...<br>
> ><br>
> > /local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/cmath:1220:11: error: '::tgammal' has not been declared<br>
> > using ::tgammal;<br>
> > ^~~~~~~<br>
> > /local/anj/RTEMS-5.1/rtems-5.1/lib/gcc/m68k-rtems5/7.5.0/include/c++/cmath:1224:11: error: '::truncl' has not been declared<br>
> > using ::truncl;<br>
> > ^~~~~~<br>
><br>
> There could very well have been errors building the BSP on my part as I had to hand-create a uC5282.bset file for RSB to build it:<br>
><br>
> > tux% cat config/5/bsps/uC5282.bset<br>
> > %define mail_single_report 1<br>
> ><br>
> > %define with_rtems_bsp uC5282<br>
> > %define rtems_target m68k-rtems5<br>
> > %define rtems_host %{rtems_target}<br>
> ><br>
> > 5/rtems-m68k<br>
> > 5/rtems-kernel<br>
> > 5/rtems-libbsd<br>
><br>
><br>
> The libbsd line there might be wrong, but I wouldn’t expect that to affect the availability of <cmath> functions to the C++ compiler.<br>
><br>
> Any suggestions?<br>
><br>
> Thanks,<br>
><br>
> - Andrew<br>
><br>
> --<br>
> Complexity comes for free, simplicity you have to work for.<br>
><br>
> _______________________________________________<br>
> users mailing list<br>
> <a href="mailto:users@rtems.org" rel="noreferrer" target="_blank">users@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer noreferrer" target="_blank">
http://lists.rtems.org/mailman/listinfo/users</a><br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" rel="noreferrer" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></blockquote>
</div>
</div>
</blockquote>
</div>
<br>
<div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>-- </div>
<div>Complexity comes for free, simplicity you have to work for.</div>
</div>
</div>
<br>
</div>
</blockquote></div></div>