On Tue, Nov 24, 2020 at 05:27:10AM +0000, Maciej W. Rozycki wrote: > On Tue, 24 Nov 2020, Maciej W. Rozycki wrote: > > > > I don't know how or why __FLT_HAS_INFINITY is set for a target which > > > does not support it, but if you get rid of that macro, that particular > > > problem should be solved. > > > > Thanks for the hint; I didn't look into it any further not to distract > > myself from the scope of the project. I have now, and the check you have > > quoted is obviously broken (as are all the remaining similar ones), given: > > > > $ vax-netbsdelf-gcc -E -dM - < /dev/null | sort | grep _HAS_ > > #define __DBL_HAS_DENORM__ 0 > > #define __DBL_HAS_INFINITY__ 0 > > #define __DBL_HAS_QUIET_NAN__ 0 > > #define __FLT_HAS_DENORM__ 0 > > #define __FLT_HAS_INFINITY__ 0 > > #define __FLT_HAS_QUIET_NAN__ 0 > > #define __LDBL_HAS_DENORM__ 0 > > #define __LDBL_HAS_INFINITY__ 0 > > #define __LDBL_HAS_QUIET_NAN__ 0 > > $ > > > > which looks reasonable to me. This seems straightforward to fix to me, so > > I'll include it along with verification I am about to schedule (assuming > > that this will be enough for libgfortran to actually build; obviously it > > hasn't been tried by anyone with such a setup for a while now, as these > > libgfortran checks date back to 2009). > > Well, it is still broken, owing to NetBSD failing to implement POSIX 2008 > locale handling correctly, apparently deliberately[1], and missing > uselocale(3)[2] while still providing newlocale(3). This confuses our > conditionals and consequently: > > .../libgfortran/io/transfer.c: In function 'data_transfer_init_worker': > .../libgfortran/io/transfer.c:3416:30: error: > 'old_locale_lock' undeclared (first use in this function) > 3416 | __gthread_mutex_lock (&old_locale_lock); > | ^~~~~~~~~~~~~~~ > > etc. > > We can probably work it around by downgrading to setlocale(3) for NetBSD > (i.e. whenever either function is missing) unless someone from the NetBSD > community contributes a better implementation (they seem to prefer their > own non-standard printf_l(3) library API).
Hi Maciej, I've been building successfully with setting: export ac_cv_func_freelocale=no export ac_cv_func_newlocale=no export ac_cv_func_uselocale=no I think the code to avoid these functions already exists, but just the configure tests need tuning. Also, this is amazing work!