Adding fenv support for ARM

Joel Sherrill joel at rtems.org
Wed May 13 14:09:16 UTC 2020


National free hint day!!!

Look above the line that is reported. You will see __BEGIN_DECL. It isn't
defined. It is intended to expand to the __cplusplus wrapper.

After you fix this, you will sequentially find 2 other things to change in
this file.

Then we need to make a decision whether the static inline versions of the
methods in sys/fenv.h are appropriate for newlib or not.

--joel

On Tue, May 12, 2020 at 5:20 PM Joel Sherrill <joel at rtems.org> wrote:

> Gedare is right but one more piece of information is needed. When newlib
> is being built, it lays target dependent files on top of generic ones. So
> the default sys/fenv.h is replaced with something like
> libc/machine/arm/sys/fenv.h. Make sure that
> /home/eshan/development/newlib/newlib-cygwin/newlib/libc/include/fenv.h is
> in fact the file you think it should be.
>
> Also look at what is supposed to be in the generic fenv.h and
> <sys/fenv.h>. You will probably have to tweak it some.
>
> Check out what is in x86_64/fenv.h and riscv/fenv.h with respect to the
> default environment variable. It looks to be declared differently in the
> other ports so you may have to make it match.
>
> But more output does help.
>
> --joel
>
>
>
> On Tue, May 12, 2020 at 4:53 PM Gedare Bloom <gedare at rtems.org> wrote:
>
>> Take the first error reported, and show what is being compiled. You've
>> trimmed off too much preceding this to know what is being compiled and
>> how this might be influencing your error.
>>
>> The specific error you're getting is often due to some syntax errors
>> preceding the line shown.
>>
>> On Tue, May 12, 2020 at 2:59 PM Eshan Dhawan <eshandhawan51 at gmail.com>
>> wrote:
>> >
>> > Hello everyone,
>> > After adding the files and compiling. I am
>> > getting a few errors which I am not able to rectify.
>> > If you could take a look and tell how to sort them.
>> >
>> > link to newlib's git repo:
>> https://github.com/eshandhawan51/newlib-cygwin/tree/add_fenv_support
>> >
>> > errors :
>> >
>> > In file included from
>> /home/eshan/development/newlib/newlib-cygwin/newlib/libc/include/fenv.h:15:0,
>> >                  from
>> ../../../../../../newlib-cygwin/newlib/libm/fenv/feclearexcept.c:57:
>> >
>> /home/eshan/development/newlib/c-arm-rtems5-newlib/arm-rtems5/thumb/newlib/targ-include/sys/fenv.h:82:1:
>> error: expected '=', ',', ';', 'asm' or '__attribute__' before 'extern'
>> >  extern const fenv_t *_fe_dfl_env;
>> >  ^~~~~~
>> > In file included from
>> ../../../../../../newlib-cygwin/newlib/libm/fenv/feclearexcept.c:57:0:
>> >
>> /home/eshan/development/newlib/newlib-cygwin/newlib/libc/include/fenv.h:22:1:
>> error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
>> >  int feclearexcept(int excepts);
>> >  ^~~
>> >
>> > thanks
>> > -Eshan
>> > On Sat, May 9, 2020 at 2:53 AM Joel Sherrill <joel at rtems.org> wrote:
>> >>
>> >>
>> >>
>> >> On Thu, May 7, 2020 at 1:33 PM Eshan Dhawan <eshandhawan51 at gmail.com>
>> wrote:
>> >>>
>> >>> Hello everyone,
>> >>> This the tread to discuss adding fenv support for ARM architecture in
>> newlib.
>> >>>
>> >>> Link to previous thread:
>> https://lists.rtems.org/pipermail/devel/2020-March/058473.html
>> >>>
>> >>> ---FreeBSD Source
>> >>> # https://github.com/freebsd/freebsd/tree/master/lib/msun/arm
>> >>> #
>> https://github.com/freebsd/freebsd/blob/master/sys/arm/include/ieeefp.h
>> >>> ---NetBSD Source
>> >>> # https://github.com/NetBSD/src/tree/trunk/lib/libm/arch/arm
>> >>>
>> >>> --- Musl has no implementation for fenv support for ARM  in it
>> >>>
>> >>> After going through the implementations both FreeBSD and NetBSD have
>> a stub implementation.
>> >>> But then FreeBSD implementation seems to be more portable compared to
>> that in NetBSD.
>> >>>
>> >>> Should I start porting it from FreeBSD?
>> >>> And which ARM BSP should I use for testing the changes?
>> >>> Currently, I have xilinx_zynq_a9_qemu build
>> >>
>> >>
>> >> I think the FreeBSD implementation is the one to use. It looks to
>> support hard and soft floating point implementations.
>> >>
>> >> I think the fenv.h file there will have to be worked on so some of the
>> contents go into sys or machine/fenv.h. There is a portable fenv.h.
>> >>
>> >>>
>> >>>
>> >>> There would also be a requirement to discuss where to place the files
>> in Newlib.
>> >>
>> >>
>> >> Not much to discuss. It should go into
>> newlib-cygwin/newlib/libm/machine/arm.
>> >>>
>> >>>
>> >>> Thanks
>> >>> -Eshan
>> >>>
>> > _______________________________________________
>> > devel mailing list
>> > devel at rtems.org
>> > http://lists.rtems.org/mailman/listinfo/devel
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200513/8bed089c/attachment-0001.html>


More information about the devel mailing list