<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 19, 2021 at 1:08 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">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">On Fri, Mar 19, 2021 at 11:16 AM Matthew Joyce <<a href="mailto:mfjoyce2004@gmail.com" target="_blank">mfjoyce2004@gmail.com</a>> wrote:<br>
><br>
> Dr. Joel,<br>
><br>
> Thanks very much...I'll keep working to get a sense of what goes<br>
> where! In the meantime, where can I look to get the ground truth of<br>
> which methods are "in RTEMS" as opposed to those in newlib?<br>
><br>
There is only one ground truth:<br>
git://<a href="http://git.rtems.org/rtems.git" rel="noreferrer" target="_blank">git.rtems.org/rtems.git</a><br>
<br>
And for newlib<br>
<br>
git://<a href="http://sourceware.org/git/newlib-cygwin.git" rel="noreferrer" target="_blank">sourceware.org/git/newlib-cygwin.git</a><br>
<br>
That said, searching for the function name symbols in compiled<br>
libraries is a good first step to rule out newlib. Then, you can<br>
'grep' the RTEMS source code for the function names to see if they<br>
exist there.<br></blockquote><div><br></div><div>rtems/cpukit to be specitic. It won't be implemented anywhere else. </div><div><br></div><div>And clearly we both have forgotten that networking APIs are in the</div><div>rtems-libbsd repository. </div><div><br></div><div><a href="https://git.rtems.org/rtems-libbsd/">https://git.rtems.org/rtems-libbsd/</a></div><div><br></div><div>I suspect ppoll() might already be in there. Or at least supported by</div><div>FreeBSD. </div><div><br></div><div>You should clone everything and grep the sources. newlib already has</div><div>qsort_r. This is the nm I used:<br><br>$ ~/rtems-work/tools/6/bin/sparc-rtems6-nm ~/rtems-work/tools/6/sparc-rtems6/lib/libc.a | grep qsort_r<br>lib_a-bsd_qsort_r.o:<br>00000000 T __bsd_qsort_r<br>lib_a-qsort_r.o:<br>00000000 T qsort_r<br></div><div><br></div><div>Notice the last line has "T qsort_r" which says it is defined.</div><div><br></div><div>grep -r in the newlib source shows it is in ./libc/search/qsort_r.c</div><div><br></div><div>dladdr() looks to be prototyped in RTEMS but hidden behind an ifdef like it </div><div>wasn't ported from NetBSD so that looks possible. It is in rtems.</div><div><br></div><div>Those two examples should help you figure out why you missed </div><div>finding some things that were implemented.</div><div><br></div><div>I need to figure out what this next POSIX version is to be called</div><div>so I can update the tracking spreadsheet that generates the RTEMS</div><div>POSIX Compliance Guide, :)</div><div><br></div><div>--joel </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Thanks again!<br>
><br>
> Matt<br>
><br>
> On Fri, Mar 19, 2021 at 1:58 PM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
> ><br>
> > Keep devel@ on the list. :)<br>
> ><br>
> > On Fri, Mar 19, 2021 at 7:51 AM Matthew Joyce <<a href="mailto:mfjoyce2004@gmail.com" target="_blank">mfjoyce2004@gmail.com</a>> wrote:<br>
> >><br>
> >> Sir,<br>
> >><br>
> >> Thank you for the link! I see that you're right, those last four are<br>
> >> in newlib, plus memmem(). I updated those in the Google Sheet.<br>
> >><br>
> >> Now I see the newlib part, but where are you referring to specifically<br>
> >> when you say RTEMS, as in "POSIX support comes from a mix of RTEMS and<br>
> >> newlib"?<br>
> ><br>
> ><br>
> > POSIX is a HUGE HUGE standard and references other standards. One<br>
> > it references and pulls in is the C99 Standard C Library which is libc and<br>
> > libm. RTEMS mostly does not implement this functionality and relies on<br>
> > another open source project for those APIs. Newlib is an open source<br>
> > C Library used by RTEMS, Cygwin, and most embedded systems GNU tools<br>
> > chains.<br>
> ><br>
> > Most of the POSIX header files with RTEMS are actually in Newlib even<br>
> > if they originated with RTEMS. Many are shared with Cygwin.<br>
> ><br>
> > So methods like the string, memory, and *printf come from Newlib since they<br>
> > are in C99. We provide POSIX like threading, signals, core file access, and<br>
> > much more.<br>
> ><br>
> > It's a complementary relationship but it takes a bit to figure out when<br>
> > something should be in one or the other. The line gets blurred at times.<br>
> ><br>
> > Say you added a new CPU architecture implementation of a math<br>
> > method (like Eshan did last year), then it goes in newlib. But he also<br>
> > added some POSIX methods which go in RTEMS. In either case,<br>
> > we like tests for them in RTEMS to show they work in our environment.<br>
> ><br>
> > --joel<br>
> ><br>
> ><br>
> ><br>
> >><br>
> >> Thanks again!<br>
> >><br>
> >> Matt<br>
> >><br>
> >> On Fri, Mar 19, 2021 at 1:13 PM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
> >> ><br>
> >> ><br>
> >> ><br>
> >> > On Fri, Mar 19, 2021, 6:40 AM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
> >> >><br>
> >> >><br>
> >> >><br>
> >> >> On Fri, Mar 19, 2021, 5:48 AM Matthew Joyce <<a href="mailto:mfjoyce2004@gmail.com" target="_blank">mfjoyce2004@gmail.com</a>> wrote:<br>
> >> >>><br>
> >> >>> <a href="https://docs.google.com/spreadsheets/d/1reCNOIZC5JTwQENgl-hvG8THfQqNtlUDVy_07PYodic/edit?usp=sharing" rel="noreferrer" target="_blank">https://docs.google.com/spreadsheets/d/1reCNOIZC5JTwQENgl-hvG8THfQqNtlUDVy_07PYodic/edit?usp=sharing</a><br>
> >> >>><br>
> >> >>> Hello,<br>
> >> >>><br>
> >> >>> As suggested by Dr. Sherril, I've taken an initial look through this<br>
> >> >>> document <a href="https://www.opengroup.org/austin/docs/austin_1110.pdf" rel="noreferrer" target="_blank">https://www.opengroup.org/austin/docs/austin_1110.pdf</a> and<br>
> >> >>> added the new methods to a Googe Sheet, linked above.<br>
> >> >>><br>
> >> >>> None of them appear to be in the RTEMS POSIX API Users Guide, but<br>
> >> >>> maybe that's not the right place to look. I'll stand by for your<br>
> >> >>> feedback regarding what's possible / desirable to add to RTEMS.<br>
> >> >><br>
> >> >><br>
> >> >> It is possible they are in our C Library or Math Library. Or just not in the manual. The POSIX manual tends to be sparse since you can always use man pages or the POSIX standard.<br>
> >> >><br>
> >> >> Since you have RTEMS and tools built. Find one of the libc.a and libm.a files in the tools install and librtemscpu.a in the RTEMS build or install. Then try a command something like this:<br>
> >> >><br>
> >> >> CPU-rtems6-nm LIBRARY | grep SYMBOL<br>
> >> >><br>
> >> >> If you see it list with T then it is in the text section and there.<br>
> >> ><br>
> >> ><br>
> >> > Following up, I initially answered from my phone and didn't look at source. I am still on my phone but looked through the list and think the last four methods are probably the only ones currently supported.<br>
> >> ><br>
> >> > <a href="https://sourceware.org/git/?p=newlib-cygwin.git;a=tree;f=newlib/libc/string;h=ceeec602cdd0e6b5c6b002b741bda9b41da4e441;hb=HEAD" rel="noreferrer" target="_blank">https://sourceware.org/git/?p=newlib-cygwin.git;a=tree;f=newlib/libc/string;h=ceeec602cdd0e6b5c6b002b741bda9b41da4e441;hb=HEAD</a><br>
> >> ><br>
> >> > POSIX support comes from a mix of RTEMS and newlib. That's key to this type of project.<br>
> >> ><br>
> >> > --joel<br>
> >> >><br>
> >> >><br>
> >> >><br>
> >> >>><br>
> >> >>> Thanks very much for your time!<br>
> >> >>><br>
> >> >>> Sincerely,<br>
> >> >>><br>
> >> >>> Matt<br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>