From bug-octave-request at bevo dot che dot wisc dot edu Mon Sep 29 15:13:48 1997 Subject: Octave dumps core when built in Linux/GNU with GNU libc. From: "Ram'on Garc'ia Fern'andez" To: bug-octave at bevo dot che dot wisc dot edu Date: Mon, 29 Sep 1997 22:12:54 +0200 (CEST) In Linux systems with libc 6 (GNU libc), octave dumps core at startup. The reason is that when octave is linked, the arguments -lc -lgcc are explicitly placed in the command line of c++. This causes these libraries to be taken before libstdc++. GNU libc and libstdc++ have incompatible implementations of some objects, like standard streams (GNU libc uses vtable thunks for interfacing with C++, but libstdc++ cannot since current versions of the GNU C++ compiler have a broken support of vtable thunks). The fix is to avoid -lc -lgcc on the command line. I include here a patch to aclocal.m4 that prevents these flags to be added in GNU/Linux systems. Regards, Ramon --- octave-2.0.9/aclocal.m4.orig Wed Jul 9 00:54:17 1997 +++ octave-2.0.9/aclocal.m4 Mon Sep 29 05:19:37 1997 at @ -120,9 +120,15 @@ -l*) if test x$arg = x-lang-c++; then arg= - else - lflags="$lflags $arg" fi + case "$target_host_type" in + *linux*) + if test x$arg = x-lc -o x$arg = x-lgcc; then + arg= + fi + ;; + esac + lflags="$lflags $arg" ;; -u) want_arg=$arg at @ -256,15 +262,26 @@ else case "$arg" in -lkernel32) - case "$canonical_host_type" in + case "$target_host_type" in *-*-cygwin32) ;; *) lflags="$lflags $arg" ;; esac + ;; + -lm) ;; - -lm | -lc) + -lc | -lgcc) + case "$target_host_type" in + *-*linux*) + arg= + ;; + *) if test "$arg" = "-lgcc"; then + lflags="$lflags $arg" + fi + ;; + esac ;; *) lflags="$lflags $arg"