All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Murphy <brian@murphy.dk>
Cc: linux-mips@oss.sgi.com
Subject: Re: compile C++ code
Date: Mon, 03 Sep 2001 08:21:13 +0200	[thread overview]
Message-ID: <3B932159.AA9C2C71@murphy.dk> (raw)
In-Reply-To: 02e701c13418$7f51a0c0$056aaac0@kjlin

kjlin wrote:

> > > #mips-linux-gcc test.C
> > > /usr/lib/gcc-lib/mips-linux/egcs-2.91.66/libgcc.a(frame.o): In function
> `decode_uleb128':
> > >
> /usr/src/redhat/BUILD/egcs-1.1.2/target-mips-linux/gcc/../../gcc/frame.c(.da
> ta+0x0): undefined reference to `pthread_create'
> > > /usr/mips-linux/bin/ld: bfd assertion fail ../../bfd/elf32-mips.c:5123
> > > mips-linux-gcc: Internal compiler error: program ld got fatal signal 11
> > > #mips-linux-g++ test.C
> > > /usr/mips-linux/lib/libstdc++.so: undefined reference to
> `pthread_create'
> > > /usr/mips-linux/lib/libstdc++.so: undefined reference to
> `pthread_getspecific'
> > > /usr/mips-linux/lib/libstdc++.so: undefined reference to `pthread_once'
> > > /usr/mips-linux/lib/libstdc++.so: undefined reference to
> `pthread_key_create'
> > > /usr/mips-linux/lib/libstdc++.so: undefined reference to
> `pthread_setspecific'
> > >
> > It seems you should link with pthread lib :
> > #mips-linux-g++ test.C -lpthread
> >
> > I think the libgcc.a should be linked with it ... Can anyone tell us
> > further on that subject?
>
> Yes, if i link with "-lpthread" , the error is solved.
> But i am confused that when i compile the same code with native gcc/g++, it
> is needless to link with that option.
> Why?

The problem is that your old toolchain (ld) cannot handle weak symbols.

/Brian

      reply	other threads:[~2001-09-03  6:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-31 10:01 compile C++ code kjlin
2001-08-31 10:01 ` kjlin
2001-08-31 11:13 ` H.Heinold
2001-08-31 18:38 ` Jean-Christophe ARNU
2001-09-03  1:33   ` kjlin
2001-09-03  1:33     ` kjlin
2001-09-03  6:21     ` Brian Murphy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B932159.AA9C2C71@murphy.dk \
    --to=brian@murphy.dk \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.