This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RFH: trouble getting gfortran to build multilib'ed
- From: Steven Bosscher <stevenb at suse dot de>
- To: gcc at gcc dot gnu dot org
- Cc: paul at codesourcery dot com
- Date: Sat, 20 Mar 2004 19:49:01 +0100
- Subject: RFH: trouble getting gfortran to build multilib'ed
- Organization: SUSE Labs
Hi,
I'm trying to make libgfortran multilib'ed. Configuring seems to work,
but I keep running into the following problem:
/space/stevenb/build-tree-ssa/gcc/xgcc -B/space/stevenb/build-tree-ssa/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -shared .libs/environ.o .libs/error.o .libs/main.o .libs/memory.o .libs/pause.o .libs/stop.o .libs/string.o .libs/select.o .libs/all_l4.o .libs/all_l8.o .libs/any_l4.o .libs/any_l8.o .libs/count_4_l4.o .libs/count_8_l4.o .libs/count_4_l8.o .libs/count_8_l8.o .libs/maxloc0_4_i4.o .libs/maxloc0_8_i4.o .libs/maxloc0_4_i8.o .libs/maxloc0_8_i8.o .libs/maxloc0_4_r4.o .libs/maxloc0_8_r4.o .libs/maxloc0_4_r8.o .libs/maxloc0_8_r8.o .libs/maxloc1_4_i4.o .libs/maxloc1_8_i4.o .libs/maxloc1_4_i8.o .libs/maxloc1_8_i8.o .libs/maxloc1_4_r4.o .libs/maxloc1_8_r4.o .libs/maxloc1_4_r8.o .libs/maxloc1_8_r8.o .libs/maxval_i4.o .libs/maxval_i8.o .libs/maxval_r4.o .libs/maxval_r8.o .libs/minloc0_4_i4.o .libs/minloc0_8_i4.o .libs/minloc0_4_i8.o .libs/minloc0_8_i8.o .libs/minloc0_4_r4.o .libs/minloc0_8_r4.o .libs/minloc0_4_r8.o .libs/minloc0_8_r8.o .libs/minloc1_4_i4.o .libs/minloc1_8_i4.o .libs/minloc1_4_i8.o .libs/minloc1_8_i8.o .libs/minloc1_4_r4.o .libs/minloc1_8_r4.o .libs/minloc1_4_r8.o .libs/minloc1_8_r8.o .libs/minval_i4.o .libs/minval_i8.o .libs/minval_r4.o .libs/minval_r8.o .libs/product_i4.o .libs/product_i8.o .libs/product_r4.o .libs/product_r8.o .libs/product_c4.o .libs/product_c8.o .libs/sum_i4.o .libs/sum_i8.o .libs/sum_r4.o .libs/sum_r8.o .libs/sum_c4.o .libs/sum_c8.o .libs/dotprod_i4.o .libs/dotprod_i8.o .libs/dotprod_r4.o .libs/dotprod_r8.o .libs/dotprod_l4.o .libs/dotprod_l8.o .libs/dotprod_c4.o .libs/dotprod_c8.o .libs/matmul_i4.o .libs/matmul_i8.o .libs/matmul_r4.o .libs/matmul_r8.o .libs/matmul_c4.o .libs/matmul_c8.o .libs/matmul_l4.o .libs/matmul_l8.o .libs/transpose_i4.o .libs/transpose_i8.o .libs/shape_i4.o .libs/shape_i8.o .libs/eoshift1_4.o .libs/eoshift1_8.o .libs/eoshift3_4.o .libs/eoshift3_8.o .libs/cshift1_4.o .libs/cshift1_8.o .libs/reshape_i4.o .libs/reshape_i8.o .libs/in_pack_i4.o .libs/in_pack_i8.o .libs/in_unpack_i4.o .libs/in_unpack_i8.o .libs/exponent_r4.o .libs/exponent_r8.o .libs/fraction_r4.o .libs/fraction_r8.o .libs/nearest_r4.o .libs/nearest_r8.o .libs/set_exponent_r4.o .libs/set_exponent_r8.o .libs/backspace.o .libs/close.o .libs/endfile.o .libs/format.o .libs/inquire.o .libs/list_read.o .libs/lock.o .libs/open.o .libs/read.o .libs/rewind.o .libs/transfer.o .libs/unit.o .libs/unix.o .libs/write.o .libs/associated.o .libs/abort.o .libs/cpu_time.o .libs/cshift0.o .libs/eoshift0.o .libs/eoshift2.o .libs/ishftc.o .libs/pack_generic.o .libs/size.o .libs/spread_generic.o .libs/string_intrinsics.o .libs/random.o .libs/reshape_generic.o .libs/reshape_packed.o .libs/selected_kind.o .libs/transpose_generic.o .libs/unpack_generic.o .libs/in_pack_generic.o .libs/in_unpack_generic.o .libs/_abs_r4.o .libs/_abs_r8.o .libs/_exp_r4.o .libs/_exp_r8.o .libs/_exp_c4.o .libs/_exp_c8.o .libs/_log_r4.o .libs/_log_r8.o .libs/_log_c4.o .libs/_log_c8.o .libs/_log10_r4.o .libs/_log10_r8.o .libs/_sqrt_r4.o .libs/_sqrt_r8.o .libs/_sqrt_c4.o .libs/_sqrt_c8.o .libs/_asin_r4.o .libs/_asin_r8.o .libs/_acos_r4.o .libs/_acos_r8.o .libs/_atan_r4.o .libs/_atan_r8.o .libs/_sin_r4.o .libs/_sin_r8.o .libs/_sin_c4.o .libs/_sin_c8.o .libs/_cos_r4.o .libs/_cos_r8.o .libs/_cos_c4.o .libs/_cos_c8.o .libs/_tan_r4.o .libs/_tan_r8.o .libs/_sinh_r4.o .libs/_sinh_r8.o .libs/_cosh_r4.o .libs/_cosh_r8.o .libs/_tanh_r4.o .libs/_tanh_r8.o .libs/_conjg_c4.o .libs/_conjg_c8.o .libs/_aint_r4.o .libs/_aint_r8.o .libs/_anint_r4.o .libs/_anint_r8.o .libs/_sign_i4.o .libs/_sign_i8.o .libs/_sign_r4.o .libs/_sign_r8.o .libs/_dim_i4.o .libs/_dim_i8.o .libs/_dim_r4.o .libs/_dim_r8.o .libs/_atan2_r4.o .libs/_atan2_r8.o .libs/_mod_i4.o .libs/_mod_i8.o .libs/_mod_r4.o .libs/_mod_r8.o .libs/dprod_r8.o .libs/trig_c4.o .libs/trig_c8.o .libs/exp_c4.o .libs/exp_c8.o .libs/hyp_c4.o .libs/hyp_c8.o -Wl,-soname -Wl,libgfortran.so.0 -o .libs/libgfortran.so.0.0.0
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: warning: i386 architecture of input file `.libs/environ.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `.libs/error.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `.libs/main.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `.libs/memory.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `.libs/pause.o' is incompatible with i386:x86-64 output
/usr/bin/ld: warning: i386 architecture of input file `.libs/stop.o' is incompatible with i386:x86-64 output
(goes on for every file...)
make[6]: *** [libgfortran.la] Error 1
make[6]: Leaving directory `/space/stevenb/build-tree-ssa/x86_64-unknown-linux-gnu/32/libgfortran'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/space/stevenb/build-tree-ssa/x86_64-unknown-linux-gnu/32/libgfortran'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/space/stevenb/build-tree-ssa/x86_64-unknown-linux-gnu/libgfortran'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/space/stevenb/build-tree-ssa/x86_64-unknown-linux-gnu/libgfortran'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/space/stevenb/build-tree-ssa/x86_64-unknown-linux-gnu/libgfortran'
make[1]: *** [all-target-libgfortran] Error 2
make[1]: Leaving directory `/space/stevenb/build-tree-ssa'
make: *** [bootstrap] Error 2
This is on amd64 configured with --enable-multilib and the attached
patch applied. As you can see, I've mostly just copied over things
from libstdc++v3, where things always works just fine. But apparently
I need something extra, and my understanding of auto* is below zero :-/
I've been stuck on this for almost a day now and I still don't know
what/where the problem is. Perhaps some build system hero can help
me out here?
Gr.
Steven
Index: libgfortran/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/Attic/Makefile.am,v
retrieving revision 1.1.2.9
diff -c -3 -p -r1.1.2.9 Makefile.am
*** libgfortran/Makefile.am 7 Feb 2004 18:06:17 -0000 1.1.2.9
--- libgfortran/Makefile.am 20 Mar 2004 17:31:11 -0000
*************** lib_LTLIBRARIES = libgfortran.la libgfor
*** 10,16 ****
libgfortranbegin_la_SOURCES = fmain.c
libgfortranbegin_la_LDFLAGS = -static
! INCLUDES = -I$(srcdir)/io
libgfortranincludedir = $(includedir)/gforio
--- 10,16 ----
libgfortranbegin_la_SOURCES = fmain.c
libgfortranbegin_la_LDFLAGS = -static
! AM_CPPFLAGS = -I$(srcdir)/io
libgfortranincludedir = $(includedir)/gforio
*************** $(gfor_built_specific2_src): m4/specific
*** 457,460 ****
endif
EXTRA_DIST = $(m4_files)
-
--- 457,459 ----
Index: libgfortran/configure.ac
===================================================================
RCS file: libgfortran/configure.ac
diff -N libgfortran/configure.ac
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- libgfortran/configure.ac 20 Mar 2004 17:31:27 -0000
***************
*** 0 ****
--- 1,133 ----
+ # Process this file with autoconf to produce a configure script, like so:
+ # aclocal && autoconf && autoheader && automake
+
+ AC_PREREQ(2.59)
+ AC_INIT([GNU Fortran Runtime Library], 0.2,,[libgfortran])
+ AC_CONFIG_HEADER(config.h)
+
+ # For libtool versioning info, format is CURRENT:REVISION:AGE
+ libtool_VERSION=6:0:0
+ AC_SUBST(libtool_VERSION)
+
+ # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
+ #
+ # You will slowly go insane if you do not grok the following fact: when
+ # building this library, the top-level /target/ becomes the library's /host/.
+ #
+ # configure then causes --target to default to --host, exactly like any
+ # other package using autoconf. Therefore, 'target' and 'host' will
+ # always be the same. This makes sense both for native and cross compilers
+ # just think about it for a little while. :-)
+ #
+ # Also, if this library is being configured as part of a cross compiler, the
+ # top-level configure script will pass the "real" host as $with_cross_host.
+ #
+ # Do not delete or change the following two lines. For why, see
+ # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
+ AC_CANONICAL_SYSTEM
+ target_alias=${target_alias-$host_alias}
+
+ # Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
+ # following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
+ # 1.8.2: minimum required version
+ # no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
+ # of other PACKAGE_* variables will, however, and there's nothing
+ # we can do about that; they come from AC_INIT).
+ # foreign: we don't follow the normal rules for GNU packages (no COPYING
+ # file in the top srcdir, etc, etc), so stop complaining.
+ # no-dependencies: turns off auto dependency generation (just for now)
+ # -Wall: turns on all automake warnings...
+ # -Wno-portability: ...except this one, since GNU make is required.
+ AM_INIT_AUTOMAKE([1.8.2 no-define foreign no-dependencies -Wall -Wno-portability])
+
+ AM_MAINTAINER_MODE
+ AM_ENABLE_MULTILIB(, ..)
+
+ # Handy for debugging:
+ #AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
+
+ # Are we being configured with some form of cross compiler?
+ # NB: We don't actually need to know this just now, but when, say, a test
+ # suite is included, we'll have to know.
+ if test "$build" != "$host"; then
+ LIBGFOR_IS_NATIVE=false
+ GCC_NO_EXECUTABLES
+ else
+ LIBGFOR_IS_NATIVE=true
+ fi
+
+ # Check the compiler.
+ AC_PROG_CC
+
+ # Add -Wall if we are using GCC.
+ if test "x$GCC" = "xyes"; then
+ CFLAGS="$CFLAGS -Wall"
+ fi
+
+ # Find other programs we need.
+ AC_CHECK_TOOL(AS, as)
+ AC_CHECK_TOOL(AR, ar)
+ AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
+ AC_PROG_MAKE_SET
+ AC_PROG_INSTALL
+
+ # Configure libtool
+ #AC_MSG_NOTICE([====== Starting libtool configuration])
+ AC_LIBTOOL_DLOPEN
+ AM_PROG_LIBTOOL
+ AC_SUBST(enable_shared)
+ AC_SUBST(enable_static)
+ #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
+
+ # We need gfortran to compile parts of the library
+ # We can't use AC_PROG_F77 because it expects a fully working gfortran.
+ #AC_PROG_F77(gfortran)
+ F77="$GFORTRAN"
+ AC_PROG_F77(gfortran)
+ FFLAGS="$FFLAGS -Wall -fno-repack-arrays -fno-underscoring"
+
+ AC_FUNC_MMAP
+ AC_TYPE_OFF_T
+
+ # check header files
+ AC_STDC_HEADERS
+ AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h)
+ AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
+ AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
+
+ # Check for complex math functions
+ AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
+
+ # Check for complex math functions in -lmx also
+ AC_CHECK_LIB([mx],[csin],[need_math="no"],[need_math="yes"])
+
+ # Check for library functions.
+ AC_CHECK_FUNCS(getrusage times)
+
+ # Let the user override this
+ AC_ARG_ENABLE(cmath,
+ AC_HELP_STRING([--enable-cmath],[Include complex math functions]),
+ [need_math=$enableval])
+ if test "$need_math" = "yes"; then
+ AC_MSG_NOTICE([Including complex math functions in libgfor]);
+ extra_math_obj='$(gfor_cmath_obj)'
+ fi
+
+ AC_SUBST([MATH_OBJ],["$extra_math_obj"])
+
+ # The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check
+ # for struct timezone, as you might think. We also need to check how
+ # to call gettimeofday if we have it.
+ LIBGFOR_GETTIMEOFDAY
+
+ AC_CACHE_SAVE
+
+ if test ${multilib} = yes; then
+ multilib_arg="--enable-multilib"
+ else
+ multilib_arg=
+ fi
+
+ # Write our Makefile.
+ AC_CONFIG_FILES(Makefile)
+ AC_OUTPUT
Index: libgfortran/configure.in
===================================================================
RCS file: libgfortran/configure.in
diff -N libgfortran/configure.in
*** libgfortran/configure.in 6 Jan 2004 00:20:01 -0000 1.1.2.3
--- /dev/null 1 Jan 1970 00:00:00 -0000
***************
*** 1,88 ****
- dnl configure.in for libgfor
- dnl Copyright Free Software Foundation
- dnl Released under the LGPL
-
- dnl The rest of gcc uses autoconf 2.13, but we really need more, hence:
- AC_PREREQ(2.54)
-
- AC_INIT([GNU Fortran Runtime Library], 0.2,,[libgfortran])
- AM_INIT_AUTOMAKE()
- AM_CONFIG_HEADER(config.h)
- AM_MAINTAINER_MODE
-
- AC_SUBST(enable_shared)
- AC_SUBST(enable_static)
-
- # check for compiler
- AC_PROG_CC
- dnl Add -Wall if using gcc
- if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -Wall"
- fi
-
- # We need gfortran to compile parts of the library
- # We can't use AC_PROG_F77 because it expects a fully working gfortran.
- #AC_PROG_F77(gfortran)
- F77="$GFORTRAN"
- AC_PROG_F77(gfortran)
- FFLAGS="$FFLAGS -Wall -fno-repack-arrays -fno-underscoring"
-
- AC_FUNC_MMAP
- AC_TYPE_OFF_T
-
- # Check for install
- AC_PROG_INSTALL
-
- # check header files
- AC_STDC_HEADERS
- AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h)
- AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
- AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
- # Check for complex math functions
- AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
-
- # Check for complex math functions in -lmx also
- AC_CHECK_LIB([mx],[csin],[need_math="no"],[need_math="yes"])
-
- dnl Checks for library functions.
- AC_CHECK_FUNCS(getrusage times)
-
- # Let the user override this
- AC_ARG_ENABLE(cmath,
- AC_HELP_STRING([--enable-cmath],[Include complex math functions]),
- [need_math=$enableval])
- if test "$need_math" = "yes"; then
- AC_MSG_NOTICE([Including complex math functions in libgfor]);
- extra_math_obj='$(gfor_cmath_obj)'
- fi
-
- AC_SUBST([MATH_OBJ],["$extra_math_obj"])
-
- dnl The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check
- dnl for struct timezone, as you might think. We also need to check how
- dnl to call gettimeofday if we have it.
- LIBGFOR_GETTIMEOFDAY
-
- dnl These should be inherited in the recursive make, but ensure they are
- dnl defined:
- test "$AR" || AR=ar
- AC_SUBST(AR)
- if test "$RANLIB"; then :
- AC_SUBST(RANLIB)
- else
- AC_PROG_RANLIB
- fi
-
- dnl Don't pull is system libtool.m4, it conflicts with the gcc version.
- dnl if test "$LIBTOOL"; then :
- dnl AC_SUBST(LIBTOOL)
- dnl else
- dnl AC_PROG_LIBTOOL
- dnl fi
- AM_PROG_LIBTOOL
-
- AC_PROG_MAKE_SET
- AC_PROG_INSTALL
-
- AC_OUTPUT(Makefile)
-
--- 0 ----