GSoC 2020: [rtems/rsb]: Error while adding ptp support. This time building for xilinx_zynq_a9_qemu

Gedare Bloom gedare at rtems.org
Sat Jun 6 01:48:39 UTC 2020


Is this the same error Heinz said he got every other time? Try it
twice, see what happens...

On Fri, Jun 5, 2020 at 5:31 PM Mritunjay Sharma
<mritunjaysharma394 at gmail.com> wrote:
>
>
> Thank you so much Heinz for such a detailed response.
> It really helped me a lot.
>
> As advised by you and Heinz, I changed the source to https://github.com/mritunjaysharma394/ptpd/archive/master.zip
> with suggested changes. However, I have encountered few bugs again related to autoreconf.
> It looks somewhat like this:
>
> + autoreconf -i -v
> autoreconf: Entering directory `.'
> autoreconf: configure.ac: not using Gettext
> autoreconf: running: aclocal -I m4
> autoreconf: configure.ac: tracing
> autoreconf: configure.ac: creating directory build-aux
> autoreconf: configure.ac: not using Libtool
> autoreconf: running: /home/mritunjay/development/rtems/5/bin/autoconf
> configure.ac:28: error: possibly undefined macro: AC_PROG_LIBTOOL
>       If this token and others are legitimate, please use m4_pattern_allow.
>       See the Autoconf documentation.
> autoreconf: /home/mritunjay/development/rtems/5/bin/autoconf failed with exit status: 1
> shell cmd failed: /bin/sh -ex  /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-master-arm-rtems5-1/do-build
> error: building ptpd-master-arm-rtems5-1
>
> I have attached the error report as well and changes in cfg files can be found here:
> https://github.com/mritunjaysharma394/rtems-source-builder/commit/6b6bb2b3bd778ebe56e9a1bf3aec1747b078fd39
>
> Thanks,
> Mritunjay
>
>
> On Fri, Jun 5, 2020 at 2:53 AM Gedare Bloom <gedare at rtems.org> wrote:
>>
>> On Thu, Jun 4, 2020 at 1:38 PM junkes <junkes at fhi-berlin.mpg.de> wrote:
>> >
>> > Hallo Mritunjay,
>> >
>> > You can't just take the github ptpd sources and make them work in RTEMS. You have to make some configuration
>> > and sources changes before you can build the with the rsb.
>> >
>> > Some things like the sys/cpuset.h seems not to be fully compatible yet and so the configure simply makes
>> > "wrong" decisions. E.g. defines HAVE_SYS_CPUSET_H = 1 as sys/cpuset.h exists.I played a little bit with it and reset
>> > the definition in ptpd-master/src/ptpd.h  (quick and dirty) and could reduce the error messages because there is a query for
>> > this variable in the code (src/dep/sys.c):
>> >
>> > in ptpd.h after the include of the created configs :
>> >
>> > ...
>> > #ifdef HAVE_CONFIG_H
>> > # include <config.h>
>> > #endif /* HAVE_CONFIG_H */
>> >
>> > #undef HAVE_NTP_GETTIME
>> > #undef HAVE_SYS_CPUSET_H
>> >
>> > #ifdef linux
>> > ...
>> >
>> > in src/dep/sys.c
>> >
>> > ...
>> > #ifdef HAVE_SYS_CPUSET_H
>> >        cpuset_t mask;
>> >        CPU_ZERO(&mask);
>> >        if(cpu >= 0) {
>> >            CPU_SET(cpu,&mask);
>> >        } else {
>> >                int i;
>> >                for(i = 0;  i < CPU_SETSIZE; i++) {
>> >                        CPU_SET(i, &mask);
>> >                }
>> >        }
>> >        return(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID,
>> >                              -1, sizeof(mask), &mask));
>> > #endif /* HAVE_SYS_CPUSET_H */
>> >
>> > In src/dep/constants_dep.h  one can find:
>> >
>> > * platform dependent */
>> >
>> > #if !defined(linux) && !defined(__NetBSD__) && !defined(__FreeBSD__) && \
>> > !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNXNTO__)
>> > #error PTPD hasn't been ported to this OS - should be possible \
>> > if it's POSIX compatible, if you succeed, report it to ptpd-devel at sourceforge.net
>> > #endif
>> >
>> > here I added "&& !defined(__rtems__)
>> >
>> > and here:
>> > ...
>> > #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__sun) || defined(__QNXNTO__) || defined(__rtems__)
>> > # include <sys/types.h>
>> > # include <sys/socket.h>
>> > #ifdef HAVE_SYS_SOCKIO_H
>> > #include <sys/sockio.h>
>> > #endif /* HAVE_SYS_SOCKIO_H */
>> > # include <netinet/in.h>
>> > # include <net/if.h>
>> > # include <net/if_dl.h>
>> > # include <net/if_types.h>
>> > #ifdef HAVE_NET_IF_ETHER_H
>> > #  include <net/if_ether.h>
>> > ...
>> >
>> > and so on... You'd have to bite through it once and then you will surely get it compiled.
>> >
>> Great start Heinz! Mritunjay, I think this definitely the way forward.
>> Later, you might try to circle back and fix the hacks in nicer ways by
>> learning how to make the autoconf stuff work correctly, and contribute
>> those fixes back upstream to ptpd project.
>>
>> > HTH Heinz
>> >
>> >
>> >
>> > On 2020-06-04 20:29, Mritunjay Sharma wrote:
>> >
>> >
>> >
>> > On Thu, Jun 4, 2020 at 11:07 PM Sebastian Huber <sebastian.huber at embedded-brains.de> wrote:
>> >
>> > On 04/06/2020 16:22, Gedare Bloom wrote:
>> >
>> > >>> In the github version this code is conditional on sys/cpuset.h being present.
>> > >>>
>> > > Well, we do have a sys/cpuset.h in newlib. It doesn't have these BSD
>> > > definitions though. Probably either:
>> > > 1. Add more stuff to sys/cpuset.h to make it support BSDisms. This
>> > > would mean adding cpuset_setaffinity support in rtems, I guess.
>> > > 2. Figure out how to disable the conditional code using the
>> > > cpuset_setaffinity function.
>> > The <sys/cpuset.h> is already as compatible as possible to glibc and
>> > FreeBSD. There is always room for improvement, however, in this area it
>> > will be difficult.
>> >
>> >
>> > Please it would be kind of you all to guide on what is the best thing I can do next. It is looking
>> > a little difficult. If something similar has been done earlier, sharing it can be a lot helpful to take a cue.
>> >
>> > Mritunjay
>> >
>> > _______________________________________________
>> > devel mailing list
>> > devel at rtems.org
>> > http://lists.rtems.org/mailman/listinfo/devel
>> >
>> >
>> > _______________________________________________
>> > devel mailing list
>> > devel at rtems.org
>> > http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list