GCC 4.5.0 - libgfortran issue

Philipp Edelmann edelmann@MPA-Garching.MPG.DE
Tue Aug 10 08:38:00 GMT 2010


Dear Vardhan,

On Tue, May 18, 2010 at 08:21:21AM -0400, Vardhan, Sundara (GE Infra, Energy) wrote:
> I downloaded the GCC 4.5.0 source and am compiling on AIX 6.1. The
> following is the configure command used to build the make files etc 
> 
> /cots/gnu/gcc-4.5.0/configure --with-as=/usr/bin/as
> --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran
> --prefix=/cots/gnu/gcc450 --enable-threads --disable-nls
> --enable-decimal-float=dpd --with-mpfr=/cots/gnu/mpfr242
> --with-gmp=/cots/gnu/gmp501 --with-mpc=/cots/gnu/mpc081
> 
> Set the CONFIG_SHELL to bash and when compiled I get the following error
> :
> 
> ld: 0711-317 ERROR: Undefined symbol: .__copysignl128
> ld: 0711-317 ERROR: Undefined symbol: .__nextafterl128
> ld: 0711-317 ERROR: Undefined symbol: .__scalbnl128
> ld: 0711-317 ERROR: Undefined symbol: .__cabsl128
> ld: 0711-317 ERROR: Undefined symbol: .__cargl128
> ld: 0711-317 ERROR: Undefined symbol: .__truncl128
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> collect2: ld returned 8 exit status
> make[3]: *** [libgfortran.la] Error 1
> make[3]: Leaving directory
> `/cots/gnu/build450/powerpc-ibm-aix6.1.4.0/libgfortran'

I encountered the same problem while compiling gcc-4.5.1 on AIX. The
problem is that GCC tries to use the 128 bit long double functions.
These are not the default on AIX (see [1]). I tried to find the library
comprising the missing functions but I could not find it. A quick and dirty
solution is to undefine the macro __LONGDOUBLE128, which causes the
compiler to use the normal long double functions instead of the 128 bit
variants. I am not sure what happens to quad precision Fortran
calculations in this case, you should definitely check that first.
I attached a patch that fixes compilation for me. I would be glad to
hear if were successful with it. Also a GCC developer could maybe
comment on a real solution to the problem. It seems that only some of the
128 bit functions are missing (or I just didn't find them with find and
objdump), so we need a replacement. Anyway, the 128 bit floats on AIX are
not IEEE 754 compliant (they are just two normal 64 bit floats that are
added to yield a larger mantissa), so I am not sure if it actually makes
sense to use those functions when strict floating point behavior is
required.


Cheers,

[1] http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/128bit_long_double_floating-point_datatype.htm
-- 
Philipp Edelmann
Max Planck Institute for Astrophysics
Tel. +49-89-30000-2272
-------------- next part --------------
diff -ur gcc-4.5.1/libgfortran/generated/nearest_r16.c gcc-4.5.1-working/libgfortran/generated/nearest_r16.c
--- gcc-4.5.1/libgfortran/generated/nearest_r16.c	2009-04-09 17:00:19 +0200
+++ gcc-4.5.1-working/libgfortran/generated/nearest_r16.c	2010-08-09 10:08:07 +0200
@@ -23,6 +23,8 @@
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#undef __LONGDOUBLE128
+
 #include "libgfortran.h"
 
 
diff -ur gcc-4.5.1/libgfortran/generated/set_exponent_r16.c gcc-4.5.1-working/libgfortran/generated/set_exponent_r16.c
--- gcc-4.5.1/libgfortran/generated/set_exponent_r16.c	2009-04-09 17:00:19 +0200
+++ gcc-4.5.1-working/libgfortran/generated/set_exponent_r16.c	2010-08-09 10:08:44 +0200
@@ -23,6 +23,7 @@
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#undef __LONGDOUBLE128
 #include "libgfortran.h"
 
 
diff -ur gcc-4.5.1/libgfortran/intrinsics/c99_functions.c gcc-4.5.1-working/libgfortran/intrinsics/c99_functions.c
--- gcc-4.5.1/libgfortran/intrinsics/c99_functions.c	2009-07-27 11:24:41 +0200
+++ gcc-4.5.1-working/libgfortran/intrinsics/c99_functions.c	2010-08-09 09:56:17 +0200
@@ -21,6 +21,7 @@
 a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
+#undef __LONGDOUBLE128
 
 #include "config.h"
 
diff -ur gcc-4.5.1/libgfortran/intrinsics/erfc_scaled.c gcc-4.5.1-working/libgfortran/intrinsics/erfc_scaled.c
--- gcc-4.5.1/libgfortran/intrinsics/erfc_scaled.c	2009-04-09 17:00:19 +0200
+++ gcc-4.5.1-working/libgfortran/intrinsics/erfc_scaled.c	2010-08-09 10:09:10 +0200
@@ -22,6 +22,7 @@
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#undef __LONGDOUBLE128
 #include "libgfortran.h"
 
 /* This implementation of ERFC_SCALED is based on the netlib algorithm


More information about the Gcc-help mailing list