On Wed, 2013-11-06 at 17:32 +0000, Marcus Shawcroft wrote: > Exactly, hard wiring the newlib interface into the configury of other > libraries is questionable, but the patch applied to libgfortran goes > beyond hard wiring details of the interface, it hard wires incorrect > details of the interface when sizeof(long double) != sizeof(double).
Actually, libstdc++ hardwires incorrect information too. In its configure it checks to see if long_double_math_on_this_cpu is set to 'yes' and then defines the *L math routines if it is not set. But the variable is never set to true anywhere. The comment in configure.ac says: # At some point, we should differentiate between architectures # like x86, which have long double versions, and alpha/powerpc/etc., # which don't. For the time being, punt. I tested to see if this approach would work with libgfortran and MIPS by not defining HAVE_STRTOLD and I could still build and run the testsuite. In fact (at least on MIPS) we never use strtold because GFC_REAL_16_IS_FLOAT128 is defined and that takes precedence and calls a different routine to do the conversion. > The argument that the patch is OK because libjava and libstdc++ also > use this idiom, is also rather questionable, because the libgfortran > patch goes beyond the idiom used in those other libraries by hard > wiring an assumption that does not hold universally. libgfortran is no better or worse then libstdc++ in this regard. > On that basis, I think the the libgfortran patch should be reverted > since it caused a regression. > > /Marcus I understand that you don't like the patch and that you don't think 'libstdc++ does it too' is an adequate rationale, but at some point being able to build is more important then having a clean looking configure script and if we revert my patch, I can't build Fortran on MIPS. If you don't want to check in you patch that checks to see if we can link in the exit routine, I would support removing the HAVE_STRTOLD setting completely or putting it under a long_double_math_on_this_cpu check (that is always false) like the libstdc++ configure script has. Either of these changes would allow me to build. But just removing my original patch leaves me unable to build at all and I don't know of a 'clean' way to fix that and apparently neither did the people working on the libstdc++ and libjava configure scripts so I do object to reverting my patch. Steve Ellcey sell...@mips.com