Re: [PATCH v6 2/3] Add default implementation of fenv.h and all methods

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Aug  9 09:50, Corinna Vinschen wrote:
> On Aug  8 15:04, Joel Sherrill wrote:
> > On Thu, Aug 8, 2019 at 2:05 PM Corinna Vinschen <[email protected]> wrote:
> > 
> > > On Aug  8 11:27, [email protected] wrote:
> > > > +/*
> > > > + * This is a non-functional implementation that should be overridden
> > > > + * by an architecture specific implementation in
> > > newlib/libm/machine/ARCH.
> > > > + *
> > > > + * The implmentation must defined FE_DFL_ENV to point to a default
> > > > + * environment of type fenv_t.
> > > > + */
> > > > +static const fenv_t fe_dfl_env = { 0 };
> > > > +const fenv_t *_fe_dfl_env = &fe_dfl_env;
> > >
> > > Bummer.  This doesn't work.  The problem is that Cygwin needs to
> > > initialize fe_dfl_env, like this:
> > >
> > >   fegetenv (&fe_dfl_env);
> > >
> > > However, even if I drop `const' as in Cygwin, if fe_dfl_env is static
> > > I can't access it from the _feinitialise() function at DLL init time.
> > >
> > > I'm not quite sure how to fix this.  Any ideas?  Do I have to drop
> > > the idea to reuse this file and we need our own target-specific one?
> > >
> > 
> > I'm not opposed to making it non-const and not static. Whatever it
> > takes to make it work on Cygwin.
> 
> Ok, if nobody else disagrees.  I'll wait over the weekend.

Oh, btw., this is not exactly Cygwin only.  As I wrote before,
the code should be usable for other x86{_64} targets as well.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1NJ0EACgkQ9TYGna5E
T6Drvg//aec6sxSpfwSxtfVdkOkk3cngjHjfKWizXJGSqXmJJfgd9vaUOZYXBDDO
cOxz6ETinUK6nGaGuesRZfZF537pT6WHNKNmpwDvajpuZGWrcI/qrCKvWwwYQwyb
SryKAmE1LO9JFlXduImXroFRgmxX+xTkXaiByGrdw+AFlKhyy5fL+mBexf0Fa4pC
4WPuyu0lnL+toPtlij6/gJ4GNj8BNxy5+LUUwa38NtdgrG898RYzm2wkf08kYfTC
c20Ilpj4AfZGvJZDqaKHMwIMZjgOD1g1PWK7Jlb4kGEA6GHNO7SCdxF9xy3yo6P+
zsva6dbWckqCD6DkzDg66RX07u8SjwnKC/0K1TVySw/WLQiwpGak1gs51KaMUbCE
zhqQFMPBPdkLE4eZSDhVSEhqBqmgY/t7xhBGKYrrFAwBdpXC+TYZJygPVBUszXor
MXItp5xgQFKz5TKlsH/+e5OGI7Xu/Pq0zHV48wER4LCkRMhD0YpAAiIDsSs/cpTQ
0Y/TAZ7ya/+b7MQ+c/+N32isYidHm8hDWybOYfHWy6ej9eiMwC5+/ZJSGoTbTcES
Kbh1Xj0WkUMaeaHXfRjQe81JaJxvZhE7bFH6Wi+4KgYKkXGBM0Fgmz8gC+8mcf0Q
WbEfjQPiveWfCurseOW9GfaxkWOoN6TlBCZ0aqrybc6uqb69F3w=
=jYU+
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.