[gfortran, patch] PR libfortran/21950

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[gfortran, patch] PR libfortran/21950

FX Coudert
Attached patch provides a fallback implementation of scalbn for
platforms that don't have it. It allows gfortran to run on Tru64 UNIX
V4.0F, IRIX 5.3 and 6.5.10 (without this patch, libgfortran builds but
gfortran is not usable, since scalbn can't be resolved at linking).

Successfully built on 3 said platforms (see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21950 for test results), and
built and regtested on i686-linux.

I'm not sure whether it can be considered obvious, but I hope to have a
quick approval since this actually allows gfortran to work on 3 more
platforms.

OK for mainline and 4.0? (and should I wait for 4.0 to reopen or can I
commit this now, trying to make it for 4.0.1?)

FX

Index: libgfortran/c99_protos.h
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/c99_protos.h,v
retrieving revision 1.3
diff -p -u -r1.3 c99_protos.h
--- libgfortran/c99_protos.h 21 May 2005 06:44:48 -0000 1.3
+++ libgfortran/c99_protos.h 15 Jun 2005 05:51:55 -0000
@@ -89,6 +89,10 @@ extern float logf(float);
 extern float log10f(float);
 #endif
 
+#ifndef HAVE_SCALBN
+extern double scalbn(double, int);
+#endif
+
 #ifndef HAVE_SCALBNF
 extern float scalbnf(float, int);
 #endif
Index: libgfortran/configure.ac
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/configure.ac,v
retrieving revision 1.27
diff -p -u -r1.27 configure.ac
--- libgfortran/configure.ac 21 May 2005 06:44:50 -0000 1.27
+++ libgfortran/configure.ac 15 Jun 2005 05:51:55 -0000
@@ -201,6 +201,7 @@ AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE
 AC_CHECK_LIB([m],[round],[AC_DEFINE([HAVE_ROUND],[1],[libm includes round])])
 AC_CHECK_LIB([m],[roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[libm includes roundf])])
 AC_CHECK_LIB([m],[scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[libm includes scalbnf])])
+AC_CHECK_LIB([m],[scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[libm includes scalbn])])
 AC_CHECK_LIB([m],[sinf],[AC_DEFINE([HAVE_SINF],[1],[libm includes sinf])])
 AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAVE_SINHF],[1],[libm includes sinhf])])
 AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
Index: libgfortran/intrinsics/c99_functions.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/intrinsics/c99_functions.c,v
retrieving revision 1.11
diff -p -u -r1.11 c99_functions.c
--- libgfortran/intrinsics/c99_functions.c 21 May 2005 06:44:50 -0000 1.11
+++ libgfortran/intrinsics/c99_functions.c 15 Jun 2005 05:51:55 -0000
@@ -154,6 +154,14 @@ log10f(float x)
 }
 #endif
 
+#ifndef HAVE_SCALBN
+double
+scalbn(double x, int y)
+{
+  return x * pow(FLT_RADIX, y);
+}
+#endif
+
 #ifndef HAVE_SCALBNF
 float

2005-06-15  Francois-Xavier Coudert  <[hidden email]>

        PR libfortran/21950
        * intrinsics/c99_functions.c (scalbn): Provide fallback
        implentation for scalbn.
        * c99_protos.h: Prototype for scalbn.
        * configure.ac: Add check for scalbn.
        * configure: Regenerate.
        * config.h.in: Regenerate.
Reply | Threaded
Open this post in threaded view
|

Re: [gfortran, patch] PR libfortran/21950

Tobias Schlüter
FX Coudert wrote:
> OK for mainline and 4.0? (and should I wait for 4.0 to reopen or can I
> commit this now, trying to make it for 4.0.1?)

Ok.  I think you may commit this to 4.0, at least that's what I read Mark's
statements to say.

> 2005-06-15  Francois-Xavier Coudert  <[hidden email]>
>
> PR libfortran/21950
> * intrinsics/c99_functions.c (scalbn): Provide fallback
> implentation for scalbn.
         ^^^^^^^^^^^ typo
> * c99_protos.h: Prototype for scalbn.
> * configure.ac: Add check for scalbn.
> * configure: Regenerate.
> * config.h.in: Regenerate.

- Tobi
Reply | Threaded
Open this post in threaded view
|

Re: [gfortran, patch] PR libfortran/21950

FX Coudert
Committed on mainline. For 4.0, I can't regenerate configure:

$ autoconf
configure.ac:71: error: possibly undefined macro: TL_AC_GCC_VERSION
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
$ autoconf --version
autoconf (GNU Autoconf) 2.59

Did I miss something in the magic incantations? ("autoheader && autoconf")
Reply | Threaded
Open this post in threaded view
|

Re: [gfortran, patch] PR libfortran/21950

Tobias Schlüter
Fran?ois-Xavier Coudert wrote:

> Committed on mainline. For 4.0, I can't regenerate configure:
>
> $ autoconf
> configure.ac:71: error: possibly undefined macro: TL_AC_GCC_VERSION
>       If this token and others are legitimate, please use m4_pattern_allow.
>       See the Autoconf documentation.
> $ autoconf --version
> autoconf (GNU Autoconf) 2.59
>
> Did I miss something in the magic incantations? ("autoheader && autoconf")
>

I don't know of any.  In my experience, autoconf is be one of those programs
where retrying fixes things magically.

- Tobi
Reply | Threaded
Open this post in threaded view
|

Re: [gfortran, patch] PR libfortran/21950

FX Coudert
>> $ autoconf
>> configure.ac:71: error: possibly undefined macro: TL_AC_GCC_VERSION
>>       If this token and others are legitimate, please use m4_pattern_allow.
>>       See the Autoconf documentation.
>> $ autoconf --version
>> autoconf (GNU Autoconf) 2.59
>
> In my experience, autoconf is be one of those programs where retrying fixes things
> magically.

Well, I tried again (with various orders of commands) but can't see
any change. If nobody has an idea of the problem, could someone else
commit this patch on 4.0? I think it could be good to have that one
(allow build on 3 more platforms) for 4.0.1.

Thanks,
FX
Reply | Threaded
Open this post in threaded view
|

Re: [gfortran, patch] PR libfortran/21950

FX Coudert
>>In my experience, autoconf is be one of those programs where retrying fixes things
>>magically.

Well, autoreconf seems to be the thing I needed. Commited on 4.0 after
one more build test!

FX
Reply | Threaded
Open this post in threaded view
|

Re: [gfortran, patch] PR libfortran/21950

Tobias Schlüter
In reply to this post by FX Coudert
Fran?ois-Xavier Coudert wrote:

> Committed on mainline. For 4.0, I can't regenerate configure:
>
> $ autoconf
> configure.ac:71: error: possibly undefined macro: TL_AC_GCC_VERSION
>       If this token and others are legitimate, please use m4_pattern_allow.
>       See the Autoconf documentation.
> $ autoconf --version
> autoconf (GNU Autoconf) 2.59
>
> Did I miss something in the magic incantations? ("autoheader && autoconf")
>
I'm seeing the same problem.  Something's fishy in CVS:
[tobi@marktplatz libgfortran]$ grep TL_AC configure.ac
TL_AC_GCC_VERSION([$srcdir/..])
[tobi@marktplatz libgfortran]$ cvs ann configure.ac | grep TL_AC

Annotations for configure.ac
***************
[tobi@marktplatz libgfortran]$ cvs diff configure.ac
[tobi@marktplatz libgfortran]$

- Tobi
Reply | Threaded
Open this post in threaded view
|

Re: [gfortran, patch] PR libfortran/21950

Andrew Pinski

On Jun 15, 2005, at 3:01 PM, Tobias Schlüter wrote:

> François-Xavier Coudert wrote:
>> Committed on mainline. For 4.0, I can't regenerate configure:
>>
>> $ autoconf
>> configure.ac:71: error: possibly undefined macro: TL_AC_GCC_VERSION
>>       If this token and others are legitimate, please use
>> m4_pattern_allow.
>>       See the Autoconf documentation.
>> $ autoconf --version
>> autoconf (GNU Autoconf) 2.59
>>
>> Did I miss something in the magic incantations? ("autoheader &&
>> autoconf")
>>
> I'm seeing the same problem.  Something's fishy in CVS:
> [tobi@marktplatz libgfortran]$ grep TL_AC configure.ac
> TL_AC_GCC_VERSION([$srcdir/..])
> [tobi@marktplatz libgfortran]$ cvs ann configure.ac | grep TL_AC
>
> Annotations for configure.ac
> ***************
> [tobi@marktplatz libgfortran]$ cvs diff configure.ac

cvs ann works on the mainline by default (I know it is stupid that way).

-- Pinski