Re: [rtems/rsb]: Adding PTP support to RSB [GSoC 2020]

2020-05-22 Thread Mritunjay Sharma
On Thu, May 21, 2020 at 1:07 AM Mritunjay Sharma <
mritunjaysharma...@gmail.com> wrote:

>
>
> On Wed, May 20, 2020 at 1:46 AM Vijay Kumar Banerjee 
> wrote:
>
>> On Wed, May 20, 2020 at 1:27 AM Mritunjay Sharma
>>  wrote:
>> >
>> >> Thanks for the log files. From a quick look, there is one obvious
>> >> error, the linker can't find libbsd most probably because it is not
>> >> there. So, you need to remove the -lbsd option from ptpd-2-1.cfg file
>> >> LIBS value. Another thing to be noted is that there are a few errors
>> >> due to failed version checking of the sparc-rtems5-gcc, this can
>> >> probably ignored for now if removing the -lbsd option fixes your
>> >> issue.
>> >>
>> > Thank you so much! Removing the lbsd from cfg file resloved the earlier
>> > compiler issue but now another error is coming up and it is somewhat
>> like this:
>> >  "Makefile:502: recipe for target 'all-recursive' failed
>> > make[1]: Leaving directory
>> '/home/mritunjay/development/rtems/rsb/rtems/build/ptpd-2.3.1-sparc-rtems5-1/build-cxc'
>> > make[1]: *** [all-recursive] Error 1
>> > Makefile:412: recipe for target 'all' failed
>> > make: *** [all] Error 2
>> > shell cmd failed: /bin/sh -ex
>> /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-2.3.1-sparc-rtems5-1/do-build
>> > error: building ptpd-2.3.1-sparc-rtems5-1"
>> >
>>
>> The error is generally at the end of the log file. In this case, it is:
>> ```
>>
>> In file included from ../../ptpd-2.3.1/src/arith.c:53:0:
>> ../../ptpd-2.3.1/src/ptpd.h:93:10: fatal error: netinet/ip.h: No such
>> file or directory
>>  #include 
>>   ^~
>> compilation terminated.
>> ```
>> This header file isn't there in the include directory. Is netinet a
>> dependency fo ptpd? If so, you'll have to find the package that
>> provides netinet, and add that to rsb in a similar manner as in ptpd,
>> then you'll have to add it in the ptpd.bset .
>>
>
Hi, I am attaching netinet/ip.h file, do we need to add entire netinet
package as ptpd?
Or there's way to add just this file. I have tried finding netinet tar
package but have to satisfy myself with
just a github repo? Can it be added as source in cfg file?

Thanks,
Mritunjay

>
> I have tried in this course. Have to still execute. Chris is telling there
> is a problem with Canadian Cross
> Compiling this. Is it allowed here to implement?
>
>>
>> > Attaching the log file as well.
>> > - Mritunjay
>>
>
/*-
 * Copyright (c) 1982, 1986, 1990, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 * 4. Neither the name of the University nor the names of its contributors
 *may be used to endorse or promote products derived from this software
 *without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)in.h	8.3 (Berkeley) 1/3/94
 * $FreeBSD$
 */

#ifndef _NETINET_IN_H_
#define	_NETINET_IN_H_

#include 
#include 
#include 

/* Protocols common to RFC 1700, POSIX, and X/Open. */
#define	IPPROTO_IP		0		/* dummy for IP */
#define	IPPROTO_ICMP		1		/* control message protocol */
#define	IPPROTO_TCP		6		/* tcp */
#define	IPPROTO_UDP		17		/* user datagram protocol */

#define	INADDR_ANY		(u_int32_t)0x
#define	INADDR_BROADCAST	(u_int32_t)0x	/* must be masked */

#ifndef _UINT8_T_DECLARED
typedef	__uint8_t		uint8_t;
#define	_UINT8_T_DECLARED
#endif

#ifndef _UINT16_T_DECLARED
typedef	__uint16_t		uint16_t;
#define	_UINT16_T_DECLARED
#endif

#ifndef _UINT32_T_DECLARED
typedef	__uint32_t		uint32_t;
#define	_UINT32_T_DECLARED
#endif

#ifndef _IN_ADDR_T_DECLARED
typedef	uint32_t		in_addr_t;
#define	_IN_ADDR_T_DECLARED
#endif

#ifndef _IN_PORT_T_DECLARED
typedef	uint16_t		in_port_t;
#define	_IN_PORT_T_DECLARED
#endif

#ifndef _SA_FAMILY_T_DECLARED

Re: [rtems/rsb]: Adding PTP support to RSB [GSoC 2020]

2020-05-22 Thread Vijay Kumar Banerjee
On Sat, May 23, 2020, 12:26 AM Mritunjay Sharma <
mritunjaysharma...@gmail.com> wrote:

>
>
> On Thu, May 21, 2020 at 1:07 AM Mritunjay Sharma <
> mritunjaysharma...@gmail.com> wrote:
>
>>
>>
>> On Wed, May 20, 2020 at 1:46 AM Vijay Kumar Banerjee 
>> wrote:
>>
>>> On Wed, May 20, 2020 at 1:27 AM Mritunjay Sharma
>>>  wrote:
>>> >
>>> >> Thanks for the log files. From a quick look, there is one obvious
>>> >> error, the linker can't find libbsd most probably because it is not
>>> >> there. So, you need to remove the -lbsd option from ptpd-2-1.cfg file
>>> >> LIBS value. Another thing to be noted is that there are a few errors
>>> >> due to failed version checking of the sparc-rtems5-gcc, this can
>>> >> probably ignored for now if removing the -lbsd option fixes your
>>> >> issue.
>>> >>
>>> > Thank you so much! Removing the lbsd from cfg file resloved the earlier
>>> > compiler issue but now another error is coming up and it is somewhat
>>> like this:
>>> >  "Makefile:502: recipe for target 'all-recursive' failed
>>> > make[1]: Leaving directory
>>> '/home/mritunjay/development/rtems/rsb/rtems/build/ptpd-2.3.1-sparc-rtems5-1/build-cxc'
>>> > make[1]: *** [all-recursive] Error 1
>>> > Makefile:412: recipe for target 'all' failed
>>> > make: *** [all] Error 2
>>> > shell cmd failed: /bin/sh -ex
>>> /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-2.3.1-sparc-rtems5-1/do-build
>>> > error: building ptpd-2.3.1-sparc-rtems5-1"
>>> >
>>>
>>> The error is generally at the end of the log file. In this case, it is:
>>> ```
>>>
>>> In file included from ../../ptpd-2.3.1/src/arith.c:53:0:
>>> ../../ptpd-2.3.1/src/ptpd.h:93:10: fatal error: netinet/ip.h: No such
>>> file or directory
>>>  #include 
>>>   ^~
>>> compilation terminated.
>>> ```
>>> This header file isn't there in the include directory. Is netinet a
>>> dependency fo ptpd? If so, you'll have to find the package that
>>> provides netinet, and add that to rsb in a similar manner as in ptpd,
>>> then you'll have to add it in the ptpd.bset .
>>>
>>
> Hi, I am attaching netinet/ip.h file, do we need to add entire netinet
> package as ptpd?
>
We can't just pull one file and add it to rsb, this will make it almost
impossible to track with the upstream. It would be better to add the whole
package. Did you find the official source?

To add the package, we need to add a separate set of cfg for netinet and
then add a reference in the ptpd cfg so that it builds before ptpd. qemu or
qemu-couverture can be examples of how to add a github repository to rsb
and build it. Please have a look at them and feel free to ask if you don't
understand something (maybe in a separate thread :) )

Also, please post the source of the package that you want to add, so that
there's no objection with the source later.


Chris commented about possible errors in the script, you might have to
follow up with him to fix the issue so that you don't face any problems
later.

Best regards,
Vijay

Or there's way to add just this file. I have tried finding netinet tar
> package but have to satisfy myself with
> just a github repo? Can it be added as source in cfg file?
>
> Thanks,
> Mritunjay
>
>>
>> I have tried in this course. Have to still execute. Chris is telling
>> there is a problem with Canadian Cross
>> Compiling this. Is it allowed here to implement?
>>
>>>
>>> > Attaching the log file as well.
>>> > - Mritunjay
>>>
>>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [rtems/rsb]: Adding PTP support to RSB [GSoC 2020]

2020-05-22 Thread Mritunjay Sharma
On Sat, May 23, 2020 at 12:57 AM Vijay Kumar Banerjee 
wrote:

>
>
> On Sat, May 23, 2020, 12:26 AM Mritunjay Sharma <
> mritunjaysharma...@gmail.com> wrote:
>
>>
>>
>> On Thu, May 21, 2020 at 1:07 AM Mritunjay Sharma <
>> mritunjaysharma...@gmail.com> wrote:
>>
>>>
>>>
>>> On Wed, May 20, 2020 at 1:46 AM Vijay Kumar Banerjee 
>>> wrote:
>>>
 On Wed, May 20, 2020 at 1:27 AM Mritunjay Sharma
  wrote:
 >
 >> Thanks for the log files. From a quick look, there is one obvious
 >> error, the linker can't find libbsd most probably because it is not
 >> there. So, you need to remove the -lbsd option from ptpd-2-1.cfg file
 >> LIBS value. Another thing to be noted is that there are a few errors
 >> due to failed version checking of the sparc-rtems5-gcc, this can
 >> probably ignored for now if removing the -lbsd option fixes your
 >> issue.
 >>
 > Thank you so much! Removing the lbsd from cfg file resloved the
 earlier
 > compiler issue but now another error is coming up and it is somewhat
 like this:
 >  "Makefile:502: recipe for target 'all-recursive' failed
 > make[1]: Leaving directory
 '/home/mritunjay/development/rtems/rsb/rtems/build/ptpd-2.3.1-sparc-rtems5-1/build-cxc'
 > make[1]: *** [all-recursive] Error 1
 > Makefile:412: recipe for target 'all' failed
 > make: *** [all] Error 2
 > shell cmd failed: /bin/sh -ex
 /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-2.3.1-sparc-rtems5-1/do-build
 > error: building ptpd-2.3.1-sparc-rtems5-1"
 >

 The error is generally at the end of the log file. In this case, it is:
 ```

 In file included from ../../ptpd-2.3.1/src/arith.c:53:0:
 ../../ptpd-2.3.1/src/ptpd.h:93:10: fatal error: netinet/ip.h: No such
 file or directory
  #include 
   ^~
 compilation terminated.
 ```
 This header file isn't there in the include directory. Is netinet a
 dependency fo ptpd? If so, you'll have to find the package that
 provides netinet, and add that to rsb in a similar manner as in ptpd,
 then you'll have to add it in the ptpd.bset .

>>>
>> Hi, I am attaching netinet/ip.h file, do we need to add entire netinet
>> package as ptpd?
>>
> We can't just pull one file and add it to rsb, this will make it almost
> impossible to track with the upstream. It would be better to add the whole
> package. Did you find the official source?
>
> To add the package, we need to add a separate set of cfg for netinet and
> then add a reference in the ptpd cfg so that it builds before ptpd. qemu or
> qemu-couverture can be examples of how to add a github repository to rsb
> and build it. Please have a look at them and feel free to ask if you don't
> understand something (maybe in a separate thread :) )
>
> Also, please post the source of the package that you want to add, so that
> there's no objection with the source later.
>
>
> Chris commented about possible errors in the script, you might have to
> follow up with him to fix the issue so that you don't face any problems
> later.
>
> Best regards,
> Vijay
>
> Thank you so much for your help and guidance. I will work out as told and
revert. Sure, I will discuss once I am done adding netinet

Thanks
Mritunjay

> Or there's way to add just this file. I have tried finding netinet tar
>> package but have to satisfy myself with
>> just a github repo? Can it be added as source in cfg file?
>>
>> Thanks,
>> Mritunjay
>>
>>>
>>> I have tried in this course. Have to still execute. Chris is telling
>>> there is a problem with Canadian Cross
>>> Compiling this. Is it allowed here to implement?
>>>

 > Attaching the log file as well.
 > - Mritunjay

>>>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] Adding fenv support arm.

2020-05-22 Thread Eshan dhawan
This patch adds FENV support for ARM

The code is ported from FreeBSD.

Signed-off-by: Eshan dhawan 
---
 newlib/libc/machine/arm/machine/acle-compat.h | 182 ++
 newlib/libc/machine/arm/machine/fenv-mangle.h |  53 +++
 .../libc/machine/arm/machine/fenv-softfloat.h | 187 ++
 newlib/libc/machine/arm/machine/fenv-vfp.h| 187 ++
 newlib/libc/machine/arm/sys/fenv.h| 122 +++
 newlib/libm/machine/arm/Makefile.am   |  18 +-
 newlib/libm/machine/arm/Makefile.in   | 174 +-
 newlib/libm/machine/arm/fe_dfl_env.c  |   7 +
 newlib/libm/machine/arm/feclearexcept.c   |   7 +
 newlib/libm/machine/arm/fegetenv.c|   7 +
 newlib/libm/machine/arm/fegetexceptflag.c |   7 +
 newlib/libm/machine/arm/fegetround.c  |   7 +
 newlib/libm/machine/arm/feholdexcept.c|   7 +
 newlib/libm/machine/arm/fenv-softfp.c |  32 ++
 newlib/libm/machine/arm/fenv-vfp.c|  32 ++
 newlib/libm/machine/arm/fenv.c| 328 ++
 newlib/libm/machine/arm/feraiseexcept.c   |   7 +
 newlib/libm/machine/arm/fesetenv.c|   7 +
 newlib/libm/machine/arm/fesetexceptflag.c |   7 +
 newlib/libm/machine/arm/fesetround.c  |   7 +
 newlib/libm/machine/arm/fetestexcept.c|   7 +
 newlib/libm/machine/arm/feupdateenv.c |   7 +
 22 files changed, 1380 insertions(+), 19 deletions(-)
 create mode 100644 newlib/libc/machine/arm/machine/acle-compat.h
 create mode 100644 newlib/libc/machine/arm/machine/fenv-mangle.h
 create mode 100644 newlib/libc/machine/arm/machine/fenv-softfloat.h
 create mode 100644 newlib/libc/machine/arm/machine/fenv-vfp.h
 create mode 100644 newlib/libc/machine/arm/sys/fenv.h
 create mode 100644 newlib/libm/machine/arm/fe_dfl_env.c
 create mode 100644 newlib/libm/machine/arm/feclearexcept.c
 create mode 100644 newlib/libm/machine/arm/fegetenv.c
 create mode 100644 newlib/libm/machine/arm/fegetexceptflag.c
 create mode 100644 newlib/libm/machine/arm/fegetround.c
 create mode 100644 newlib/libm/machine/arm/feholdexcept.c
 create mode 100644 newlib/libm/machine/arm/fenv-softfp.c
 create mode 100644 newlib/libm/machine/arm/fenv-vfp.c
 create mode 100644 newlib/libm/machine/arm/fenv.c
 create mode 100644 newlib/libm/machine/arm/feraiseexcept.c
 create mode 100644 newlib/libm/machine/arm/fesetenv.c
 create mode 100644 newlib/libm/machine/arm/fesetexceptflag.c
 create mode 100644 newlib/libm/machine/arm/fesetround.c
 create mode 100644 newlib/libm/machine/arm/fetestexcept.c
 create mode 100644 newlib/libm/machine/arm/feupdateenv.c

diff --git a/newlib/libc/machine/arm/machine/acle-compat.h 
b/newlib/libc/machine/arm/machine/acle-compat.h
new file mode 100644
index 0..888ae2ea8
--- /dev/null
+++ b/newlib/libc/machine/arm/machine/acle-compat.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2014 ARM Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ *products derived from this software without specific prior written
+ *permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __ARM_ARCH
+
+/* ACLE standardises a set of pre-defines that describe the ARM architecture.
+   These were mostly implemented in GCC around GCC-4.8; older versions
+   have no, or only partial support.  To provide a level of backwards
+   compatibility we try to work out what the definitions should be, given
+   the older pre-defines that GCC did produce.  This isn't complete, but
+   it should be enough for use by routines that depend on this header.  */
+
+/* No need to handle ARMv8, GCC had ACLE support before that.  */
+
+# ifdef __ARM_ARCH_7__
+/* The common subset of ARMv7 in all profiles.  */
+#  define __ARM_ARCH 7
+#  def