Error while building the rtems-libbsd

Christian Mauderer christian.mauderer at embedded-brains.de
Thu Jan 9 06:12:00 UTC 2020


Hello Utkarsh,

On 08/01/2020 18:52, Utkarsh Rai wrote:
> 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. 

Great.

>  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 here
> <https://reviews.freebsd.org/D11959> (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).

What advantage would you gain in re-writing the application? As far as I
understood the problem is with the mmap implementation. That won't
change by re-writing a demo application.

mmap in RTEMS is always a bit tricky. Basically everything that goes
beyond returning a pointer to a fixed memory location will get tricky. I
don't know the topic exactly. But I would expect that for the PRU
drivers mmap just has to just return a pointer to a fixed location.

Regarding the FreeBSD ticket you linked:

- It seems to be an old and closed one (from 2017). So I would assume
that FreeBSD already has that one implemented. Did you check that? Did
you check whether libbsd uses a recent enough commit to pull the patch in?

- I'm not sure why you think that ticket has something to do with mmap.
The only change in ti_pruss_mmap is that it returns an error value that
is more useful than before.

Best regards

Christian

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

-- 
--------------------------------------------
embedded brains GmbH
Herr Christian Mauderer
Dornierstr. 4
D-82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list