public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/55374] [asan] Wrong linking order of libasan and libstdc++
Date: Sat, 08 Dec 2012 17:06:00 -0000	[thread overview]
Message-ID: <bug-55374-4-z1pr64d2rd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55374-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-08 17:05:51 UTC ---
[hjl@gnu-6 gcc]$ cat /tmp/bad.cc
#include <new>

int
main ()
{
  int *buf = new int(30);
  buf[30]=1;
  return 0;
}
[hjl@gnu-6 gcc]$ ./release/usr/gcc-4.8.0/bin/g++ -fsanitize=address /tmp/bad.cc
-static-libasan -static-libstdc++
/export/build/gnu/gcc/release/usr/gcc-4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64/libasan.a(asan_new_delete.o):
In function `operator new(unsigned long)':
/export/gnu/import/git/gcc/libsanitizer/asan/asan_new_delete.cc:41: multiple
definition of `operator new(unsigned long)'
/export/build/gnu/gcc/release/usr/gcc-4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64/libstdc++.a(new_op.o):/export/gnu/import/git/gcc/libstdc++-v3/libsupc++/new_op.cc:45:
first defined here
/export/build/gnu/gcc/release/usr/gcc-4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64/libasan.a(asan_new_delete.o):
In function `operator delete(void*)':
/export/gnu/import/git/gcc/libsanitizer/asan/asan_new_delete.cc:54: multiple
definition of `operator delete(void*)'
/export/build/gnu/gcc/release/usr/gcc-4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64/libstdc++.a(del_op.o):/export/gnu/import/git/gcc/libstdc++-v3/libsupc++/del_op.cc:46:
first defined here
collect2: error: ld returned 1 exit status
[hjl@gnu-6 gcc]$


  parent reply	other threads:[~2012-12-08 17:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-18  1:10 [Bug other/55374] New: [asan] Can't link static libasan with static libstdc++ hjl.tools at gmail dot com
2012-11-18  1:18 ` [Bug other/55374] " hjl.tools at gmail dot com
2012-11-18  1:30 ` hjl.tools at gmail dot com
2012-12-08 17:06 ` hjl.tools at gmail dot com [this message]
2012-12-08 17:09 ` [Bug sanitizer/55374] [asan] -static-libasan -static-libstdc++ doesn't work hjl.tools at gmail dot com
2012-12-08 17:11 ` hjl.tools at gmail dot com
2012-12-20 19:11 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-20 19:25 ` hjl.tools at gmail dot com
2012-12-20 19:55 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-20 19:59 ` hjl.tools at gmail dot com
2012-12-20 20:05 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-20 20:12 ` jakub at gcc dot gnu.org
2012-12-20 20:43 ` Joost.VandeVondele at mat dot ethz.ch
2012-12-21  0:14 ` howarth at nitro dot med.uc.edu
2013-01-22 10:34 ` jakub at gcc dot gnu.org
2013-01-22 10:53 ` jakub at gcc dot gnu.org
2013-01-22 13:35 ` jakub at gcc dot gnu.org
2013-01-29  8:54 ` david.abdurachmanov at gmail dot com
2013-01-29  9:11 ` kcc at gcc dot gnu.org
2013-01-29  9:13 ` jakub at gcc dot gnu.org
2013-01-29  9:19 ` kcc at gcc dot gnu.org
2013-01-29  9:30 ` jakub at gcc dot gnu.org
2013-01-29  9:44 ` kcc at gcc dot gnu.org
2013-01-30 18:07 ` jakub at gcc dot gnu.org
2013-02-05  9:08 ` ebotcazou at gcc dot gnu.org
2013-02-05 15:56 ` jakub at gcc dot gnu.org
2013-03-22 14:48 ` jakub at gcc dot gnu.org
2013-05-31 11:00 ` jakub at gcc dot gnu.org
2013-10-16  9:50 ` jakub at gcc dot gnu.org
2015-06-22 14:26 ` rguenth at gcc dot gnu.org

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=bug-55374-4-z1pr64d2rd@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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 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).