public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/18383] New: [4.0 Regression] Cannot use assert in a dynamic library
@ 2004-11-08 21:03 pinskia at gcc dot gnu dot org
  2004-11-08 21:06 ` [Bug target/18383] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-08 21:03 UTC (permalink / raw)
  To: gcc-bugs

% cat t.c
#include <assert.h>

int f1(int a)
{
  assert(a);
  return a;
}
% cat t.cc
#include <assert.h>

extern "C" int f(int);

int f(int a)
{
  assert(a);
  return a;
}
% cat main.cc
extern"C" int f(int);
extern"C" int f1(int);


int main(void)
{
  f(0);
  f1(0);
}

% g++ -dynamiclib t.cc -o libt1.dylib
% gcc -dynamiclib t.c -o libt.dylib
% g++ -L. -lt -lt1 main.cc

Before my patch to use shared libgcc for dynamic library which means we are doing something wrong:
/usr/bin/ld: warning suggest use of -bind_at_load, as lazy binding may result in errors or different 
symbols being used
symbol ___eprintf used from dynamic library /Users/pinskia/tree-cleanup-branch/lib/gcc/powerpc-
apple-darwin7.4.1/4.1.0-tcb/../../../libstdc++.dylib(_eprintf.o) not from earlier dynamic library 
libt.dylib(_eprintf.o)

After (when linking the first dynamic library):
ld: Undefined symbols:
___eprintf
/usr/bin/libtool: internal link edit command failed

-- 
           Summary: [4.0 Regression] Cannot use assert in a dynamic library
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: *-darwin*


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


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

end of thread, other threads:[~2004-11-30 23:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-08 21:03 [Bug target/18383] New: [4.0 Regression] Cannot use assert in a dynamic library pinskia at gcc dot gnu dot org
2004-11-08 21:06 ` [Bug target/18383] " pinskia at gcc dot gnu dot org
2004-11-08 21:32 ` pinskia at gcc dot gnu dot org
2004-11-19 19:43 ` pinskia at gcc dot gnu dot org
2004-11-25 19:47 ` pinskia at gcc dot gnu dot org
2004-11-30 23:38 ` pinskia 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).