public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33357]  New: collect2: ld terminated with signal 11 [Segmentation fault]
@ 2007-09-08 19:27 don-gcc at isis dot cs3-inc dot com
  2007-09-08 19:29 ` [Bug other/33357] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: don-gcc at isis dot cs3-inc dot com @ 2007-09-08 19:27 UTC (permalink / raw)
  To: gcc-bugs

I don't know how to fill in much of this form but I hope all will be clear from
the following transcript.
I'm hoping for advice on what to do (upgrade?) to fix the problem or failing
that what to do to help diagnose it.

===
dcohen@saturn:~/mysql-5.0.45/client> g++ -O3 -DDBUG_OFF -fno-implicit-templates 
-fno-exceptions -fno-rtti -rdynamic -o .libs/mysql mysql.o readline.o
sql_string
.o completion_hash.o  ../cmd-line-utils/libedit/libedit.a -lncurses
../libmysql/
.libs/libmysqlclient.so -lcrypt -lnsl -lm -lz -Wl,--rpath
-Wl,/home/dcohen/mysql
/lib/mysql
collect2: ld terminated with signal 11 [Segmentation fault]
dcohen@saturn:~/mysql-5.0.45/client> g++ --version
g++ (GCC) 4.1.0 (SUSE Linux)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

dcohen@saturn:~/mysql-5.0.45/client> uname -a
Linux saturn 2.6.16.27-0.9-default #1 SMP Tue Feb 13 09:35:18 UTC 2007 ia64
ia64 ia64 GNU/Linux
dcohen@saturn:~/mysql-5.0.45/client>


-- 
           Summary: collect2: ld terminated with signal 11 [Segmentation
                    fault]
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: don-gcc at isis dot cs3-inc dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33357


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 19:27 [Bug c++/33357] New: collect2: ld terminated with signal 11 [Segmentation fault] don-gcc at isis dot cs3-inc dot com
@ 2007-09-08 19:29 ` pinskia at gcc dot gnu dot org
  2007-09-09  3:44 ` don-gcc at isis dot cs3-inc dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-09-08 19:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-09-08 19:29 -------
This is ld crashing and ld is part of the binutils project.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |other


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33357


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 19:27 [Bug c++/33357] New: collect2: ld terminated with signal 11 [Segmentation fault] don-gcc at isis dot cs3-inc dot com
  2007-09-08 19:29 ` [Bug other/33357] " pinskia at gcc dot gnu dot org
@ 2007-09-09  3:44 ` don-gcc at isis dot cs3-inc dot com
  2007-09-09  8:09 ` schwab at suse dot de
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: don-gcc at isis dot cs3-inc dot com @ 2007-09-09  3:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from don-gcc at isis dot cs3-inc dot com  2007-09-09 03:43 -------
Subject:  collect2: ld terminated with signal 11 [Segmentation fault]

pinskia at gcc dot gnu dot org writes:
 > This is ld crashing and ld is part of the binutils project.
Mike Frysinger writes:
 > you should start with what version of binutils you're actually using ... run 
 > `ld --version`
 > if that version != 2.18, then you should first upgrade

Thank you both for your replies.  I have now built binutils 2.18.
However I'm not root on this machine and so cannot install it in the
place where the original command (g++ -O3 -DDBUG_OFF ...) will find
it.  Can either of you tell me how to arrange for the g++ command to
use the version of ld I've just built?
I see at least two problems here.  First, g++ is not simply calling ld
on the same arguments - when I replace g++ with ld I get an error
about unrecognized option -DDBUG_OFF.
Second, I suspect that the ld I just built is the file
~/binutils-2.18/ld/ld-new - is that correct?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33357


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 19:27 [Bug c++/33357] New: collect2: ld terminated with signal 11 [Segmentation fault] don-gcc at isis dot cs3-inc dot com
  2007-09-08 19:29 ` [Bug other/33357] " pinskia at gcc dot gnu dot org
  2007-09-09  3:44 ` don-gcc at isis dot cs3-inc dot com
@ 2007-09-09  8:09 ` schwab at suse dot de
  2007-09-17 12:08 ` nickc at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: schwab at suse dot de @ 2007-09-09  8:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from schwab at suse dot de  2007-09-09 08:09 -------
Use -B${binutils-bindir}, where ${binutils-bindir} is the directory where the
binutils binaries were installed.  `-BPREFIX'      This option specifies where
to find the executables, libraries,      include files, and data files of the
compiler itself.       The compiler driver program runs one or more of the
subprograms      `cpp', `cc1', `as' and `ld'.  It tries PREFIX as a prefix for
each      program it tries to run, both with and without `MACHINE/VERSION/'    
 (*note Target Options::).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33357


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 19:27 [Bug c++/33357] New: collect2: ld terminated with signal 11 [Segmentation fault] don-gcc at isis dot cs3-inc dot com
                   ` (2 preceding siblings ...)
  2007-09-09  8:09 ` schwab at suse dot de
@ 2007-09-17 12:08 ` nickc at redhat dot com
  2007-09-17 16:31 ` don-gcc at isis dot cs3-inc dot com
  2010-05-22 17:34 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: nickc at redhat dot com @ 2007-09-17 12:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from nickc at redhat dot com  2007-09-17 12:08 -------
Subject: Re:  collect2: ld terminated with signal 11 [Segmentation
 fault]

Hi Don,

> Thank you both for your replies.  I have now built binutils 2.18.
> However I'm not root on this machine and so cannot install it in the
> place where the original command (g++ -O3 -DDBUG_OFF ...) will find
> it.  Can either of you tell me how to arrange for the g++ command to
> use the version of ld I've just built?

There are several possibilities:

   1. Build your own local version of g++ as well and install everything in 
your own local install tree.  This might be a good idea if you have other bugs 
in the compiler or linker that you might want to track down.

   2. Compile everything to object files first.  Then perform a final link 
adding "-v" to the gcc command line.  This will show you the linker command 
line that gcc is using.  Copy this command line, replacing the name of the 
linker program with the path to your own, newly built linker.

      The problem with this approach is that you are using g++.  (If you are 
not compiling C++ sources then switch to gcc and you will not encounter the 
following problem).  The problem is that g++ does not invoke the linker 
directly.  Instead it uses an intermediary program called collect2 which 
performs some additional work before invoking the linker.  This could still be 
worked around if it were not for the fact that g++ communicates some critical 
information to collect2 via environment variables rather than the command line. 
  These variables are not shown in the "g++ -v" output and they include the 
path to the linker that collect2 invokes.  [A big design bug imho].  Try adding 
"--Wl,-debug" to the g++ command line to see some output from collect2.

    The simplest way around this problem is to still use g++ to perform the 
final link, but to rename your newly built linker executable to "real-ld" and 
put it in your PATH somewhere.  (I normally use the current directory where I 
am running my tests).  Collect2 should look for an executable called "real-ld" 
first and if it cannot find one, then use "collect-ld" or "ld" or something 
else which will probably be in the path given to it by the compiler, and not in 
a path controllable by you.

> I see at least two problems here.  First, g++ is not simply calling ld
> on the same arguments - when I replace g++ with ld I get an error
> about unrecognized option -DDBUG_OFF.

> Second, I suspect that the ld I just built is the file
> ~/binutils-2.18/ld/ld-new - is that correct?

Correct.  When the built ld-new executable is installed it is renamed to ld.

Cheers
   Nick


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33357


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 19:27 [Bug c++/33357] New: collect2: ld terminated with signal 11 [Segmentation fault] don-gcc at isis dot cs3-inc dot com
                   ` (3 preceding siblings ...)
  2007-09-17 12:08 ` nickc at redhat dot com
@ 2007-09-17 16:31 ` don-gcc at isis dot cs3-inc dot com
  2010-05-22 17:34 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: don-gcc at isis dot cs3-inc dot com @ 2007-09-17 16:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from don-gcc at isis dot cs3-inc dot com  2007-09-17 16:31 -------
Subject: Re:  collect2: ld terminated with signal 11 [Segmentation fault]

Nick Clifton writes:
 > There are several possibilities:
...
I ended up following the recommendation below - worked fine.
I installed the binutils build into my own directory and then added
the -B.  In fact I just added that to the input I passed to .configure
and the entire mysql build completed without problem.

------- Comment #3 from schwab at suse dot de  2007-09-09 08:09 -------
Use -B${binutils-bindir}, where ${binutils-bindir} is the directory where the
binutils binaries were installed.  `-BPREFIX'      This option specifies where
to find the executables, libraries,      include files, and data files of the
compiler itself.       The compiler driver program runs one or more of the
subprograms      `cpp', `cc1', `as' and `ld'.  It tries PREFIX as a prefix for
each      program it tries to run, both with and without `MACHINE/VERSION/'    
 (*note Target Options::).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33357


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 19:27 [Bug c++/33357] New: collect2: ld terminated with signal 11 [Segmentation fault] don-gcc at isis dot cs3-inc dot com
                   ` (4 preceding siblings ...)
  2007-09-17 16:31 ` don-gcc at isis dot cs3-inc dot com
@ 2010-05-22 17:34 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2010-05-22 17:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jsm28 at gcc dot gnu dot org  2010-05-22 17:33 -------
As discussed, not a GCC bug.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33357


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-05-22 17:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-08 19:27 [Bug c++/33357] New: collect2: ld terminated with signal 11 [Segmentation fault] don-gcc at isis dot cs3-inc dot com
2007-09-08 19:29 ` [Bug other/33357] " pinskia at gcc dot gnu dot org
2007-09-09  3:44 ` don-gcc at isis dot cs3-inc dot com
2007-09-09  8:09 ` schwab at suse dot de
2007-09-17 12:08 ` nickc at redhat dot com
2007-09-17 16:31 ` don-gcc at isis dot cs3-inc dot com
2010-05-22 17:34 ` jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).