<div dir="ltr">So, finally after resetting almost every configuration on my system , and rebasing the changes on the latest libsd commit I was able to build the libbsd successfully on my host for beagle BSP. <div> I have been trying to get a test app to work for PRU drivers , as of now the app cannot read the IRQs triggered as described <a href="https://reviews.freebsd.org/D11959">here</a> (The issue seems to be with mmaps) . Should I write the app from scratch or continue upon the current work?(And in that case it would be helpful if I could get some pointers to solve the mmap issue).</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 5, 2020 at 2:27 PM Christian Mauderer <<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</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 05/01/2020 03:17, Utkarsh Rai wrote:<br>
> 1. For the libbbsd I have been<br>
> using <a href="https://github.com/nilhoel1/rtems-libbsd/tree/ti_pruss" rel="noreferrer" target="_blank">https://github.com/nilhoel1/rtems-libbsd/tree/ti_pruss</a>, this was<br>
> used by @Nils Hölscher <mailto:<a href="mailto:nilhoel1@gmail.com" target="_blank">nilhoel1@gmail.com</a>> for his GSoc project(<br>
> I have talked to him about my errors, and this libbsd builds fine on his<br>
> host system).<br>
<br>
That version of libbsd is based on commit bc2ba9a9c of libbsd which has<br>
been added on 2019-07-09.<br>
<br>
> 2. The rtems and RSB versions are <a href="https://github.com/RTEMS/rtems.git" rel="noreferrer" target="_blank">https://github.com/RTEMS/rtems.git</a> <br>
> and <a href="https://github.com/RTEMS/rtems-source-builder.git" rel="noreferrer" target="_blank">https://github.com/RTEMS/rtems-source-builder.git</a><br>
<br>
Which commit did you check out? I would suggest to either check out one<br>
with about the same date as the libbsd commit. Or you should rebase the<br>
changes onto the latest libbsd commit. That depends on whether you want<br>
to just use the work or continue it.<br>
<br>
> 3. I have been using the beaglebone black BSP.<br>
> <br>
> <br>
> On Fri, Jan 3, 2020 at 2:12 PM Christian Mauderer <<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a><br>
> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>>> wrote:<br>
> <br>
> On 01/01/2020 16:14, Utkarsh Rai wrote:<br>
> > I have been successful in building the rtems-libbsd using 'python3<br>
> > ./waf'. Although, I had to do some weird changes to some of the<br>
> files in<br>
> > the libbsd package. (These changes were done as there were several<br>
> build<br>
> > errors even after the 'python ./waf' command )<br>
> ><br>
> > 1. In the ../freebsd/sys/netinet/in_mcast.c<br>
> > and ../../freebsd/sys/netpfil/pf/if_pfsync.c files I had to change<br>
> > the IP_MIN_MEMBERSHIPS with IP_MAX_MEMBERSHIPS .<br>
> ><br>
> > 2. In the ../../freebsd/sys/netinet6/in6_mcast.c and<br>
> > .../freebsd/sys/netinet/ip_carp.c files I had to<br>
> > change IPV6_MIN_MEMBERSHIPS, to IPV6_MAX_MEMBERSHIPS,<br>
> ><br>
> > 3. In the ../testsuite/syscalls01/test_main.c I changed<br>
> the IPPROTO_SEP<br>
> > to IPPROTO_EGP .<br>
> ><br>
> > Now, I suspect that these changes will come back to bite me as I<br>
> proceed<br>
> > further as I have simply overwritten them based on build error<br>
> > messages. It would be helpful if the community can provide its<br>
> views on<br>
> > my changes and whether this is a bug or something that I am doing<br>
> wrong.<br>
> <br>
> I would too expect that these changes are not a good idea. In normal<br>
> case libbsd builds without any trouble.<br>
> <br>
> Can you give some more information about the exact versions you use:<br>
> <br>
> - Which commit of libbsd are you trying to build?<br>
> - Which rtems commit do you use?<br>
> - Which tool version do you use? If RSB: Which commit?<br>
> - What BSP do you use?<br>
> <br>
> Best regards<br>
> <br>
> Christian<br>
> <br>
> ><br>
> > On Tue, Dec 31, 2019 at 6:28 PM Christian Mauderer<br>
> <<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>><br>
> > <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>>>> wrote:<br>
> ><br>
> > On 31/12/2019 12:41, Utkarsh Rai wrote:<br>
> > > My host system has an x-86_64 architecture with ubuntu-18.04<br>
> > running on<br>
> > > top of it, I have a python2 installed.<br>
> > > Interestingly enough, when I clean up the libbsd directory<br>
> and try to<br>
> > > build as a super-user, I have two observations:-<br>
> ><br>
> > Please note that building as super user is generally not a<br>
> good idea for<br>
> > any sane build environment. Although I have to say that in<br>
> this case it<br>
> > provided an interesting error output ...<br>
> ><br>
> > > 1. The build fails with the following error message:-<br>
> > > [1/4] Creating<br>
> > ><br>
> > <br>
> ///h/o/m/e///u/r/1/0///s/a/n/d/b/o/x///r/t/e/m/s/-/l/i/b/b/s/d///b/u/i/l/d///a/r/m/-/r/t/e/m/s/5/-/b/e/a/g/l/e/b/o/n/e/b/l/a/c/k/-/d/e/f/a/u/l/t/build-include/rtems/bsd/modules.h<br>
> ><br>
> > ... here. That looks like some join went horrible wrong. I<br>
> assume that<br>
> > there is some location in the build system where an array of paths<br>
> > should be joined but only one is given. Looks like a bug.<br>
> ><br>
> > > [2/4] Compiling rtemsbsd/rtems/generate_kvm_symbols<br>
> > > [3/4] Compiling<br>
> > testsuite/include/rtems/bsd/test/<a href="http://network-config.h.in" rel="noreferrer" target="_blank">network-config.h.in</a><br>
> <<a href="http://network-config.h.in" rel="noreferrer" target="_blank">http://network-config.h.in</a>><br>
> > <<a href="http://network-config.h.in" rel="noreferrer" target="_blank">http://network-config.h.in</a>><br>
> > > <<a href="http://network-config.h.in" rel="noreferrer" target="_blank">http://network-config.h.in</a>><br>
> > > /bin/sh: 1:<br>
> > ><br>
> .//home/ur10/sandbox/rtems-libbsd/rtemsbsd/rtems/generate_kvm_symbols:<br>
> ><br>
> > The ./ in front is a bit odd here. Looks like an absolute path<br>
> which<br>
> > (for some reason) has been forced to be local...<br>
> ><br>
> > > not found<br>
> > ><br>
> > > Now I have checked, and the file in question is present at its<br>
> > location.<br>
> > ><br>
> > > 2. The traceback of the last calls is something like this:-<br>
> > > File<br>
> > ><br>
> > <br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Build.py",<br>
> > > line 100, in execute_build<br>
> > > self.compile()<br>
> > > File<br>
> > ><br>
> > <br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Build.py",<br>
> > > line 174, in compile<br>
> > > self.store()<br>
> > > File<br>
> > ><br>
> > <br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Build.py",<br>
> > > line 153, in store<br>
> > > Utils.writef(db+'.tmp',x,m='wb')<br>
> > > File<br>
> > ><br>
> > <br>
> "/home/ur10/sandbox/rtems-libbsd/.waf-2.0.13-4c5a17779813574907c253ab5418388d/waflib/Utils.py",<br>
> > > line 155, in writef<br>
> > > with open(fname,m)as f:<br>
> > > IOError: [Errno 2] No such file or directory:<br>
> > ><br>
> > <br>
> u'/home/ur10/sandbox/rtems-libbsd/build/arm-rtems5-beagleboneblack-default/.wafpickle-linux2-34017264-20.tmp'<br>
> > ><br>
> > > If I am correct, this is a python exception for invalid file<br>
> > handling.<br>
> > > Since I have already removed the 'build' directory, I suppose<br>
> > the call<br>
> > > should be 'w+' or 'wb+' but this does not seem to be the<br>
> case. (I am<br>
> > > going out on a limb with this assumption, I may be wrong !)<br>
> ><br>
> > You are right that it's a python exception. Most likely it's a<br>
> follow up<br>
> > bug due to the wrong paths further up.<br>
> ><br>
> > ><br>
> > > It would be very helpful if you could provide your views on the<br>
> > problem<br>
> > > and as to how I should proceed to resolve this.<br>
> > ><br>
> ><br>
> > The solution is to find the bug in the path handling from<br>
> further above.<br>
> > As a workaround could you try to use python3? Some string<br>
> handling is<br>
> > different there so it might work or give a better error message.<br>
> > Just use<br>
> ><br>
> > python3 ./waf ...<br>
> ><br>
> > instead of only "waf" in every waf command line.<br>
> ><br>
> > ><br>
> > > On Mon, Dec 30, 2019 at 7:19 PM Christian Mauderer<br>
> > <<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>><br>
> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>>><br>
> > > <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>><br>
> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a> <mailto:<a href="mailto:list@c-mauderer.de" target="_blank">list@c-mauderer.de</a>>>>> wrote:<br>
> > ><br>
> > > On 28/12/2019 18:43, Utkarsh Rai wrote:<br>
> > > > Hi,<br>
> > > > While building the rtems-libbsd as described here<br>
> > > ><br>
> > > <br>
> > <br>
> <<a href="https://devel.rtems.org/browser/rtems-libbsd/README.waf?rev=b83012a9f9f1551d9d223c3126d0f43aba79db62" rel="noreferrer" target="_blank">https://devel.rtems.org/browser/rtems-libbsd/README.waf?rev=b83012a9f9f1551d9d223c3126d0f43aba79db62</a>> I<br>
> > > > was able to successfully configure the waf file as:-<br>
> > > > waf configure<br>
> > > > --prefix="/home/ur10/sandbox/rtems/5"<br>
> > > > --rtems-bsps=arm/beagleboneblack<br>
> > > > --buildset=buildset/default.ini <br>
> > > > But the build fails on the "waf" instruction with the<br>
> error<br>
> > - "Could<br>
> > > > not create the directory ///h".<br>
> > > > My path for the build is<br>
> PATH="~/sandbox/rtems/bin:$PATH",<br>
> > with the<br>
> > > > tools and the rtems-libbsd in the sandbox directory. <br>
> > > > It would be very kind of you if someone could point out as<br>
> > to what<br>
> > > is it<br>
> > > > that I am doing wrong.<br>
> > > > Thank You, Regards.<br>
> > ><br>
> > > Hello Utkarsh Rai,<br>
> > ><br>
> > > I now have seen that bug about two or three times on the<br>
> list.<br>
> > But I've<br>
> > > never been able to reproduce it. What host system are you<br>
> > using? Do you<br>
> > > have a python2 or a python3 as default python?<br>
> > ><br>
> > > Sometimes it works to clean up the libbsd directory. Remove<br>
> > the "build"<br>
> > > directory and the ".waf2..." or ".waf3..." directory. Also<br>
> > remove any<br>
> > > "__pycache__" directories.<br>
> > ><br>
> > > >From your call it seems that you use waf from your host<br>
> > system. Can you<br>
> > > try to use the waf version delivered with libbsd instead<br>
> > (using "./waf<br>
> > > configure ...")?<br>
> > ><br>
> > > Best regards<br>
> > ><br>
> > > Christian<br>
> > ><br>
> ><br>
> <br>
</blockquote></div>