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

* [Bug target/18383] [4.0 Regression] Cannot use assert in a dynamic library
  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 ` pinskia at gcc dot gnu dot org
  2004-11-08 21:32 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-08 21:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-08 21:06 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00515.html>, I have a new assert.h 
which corrects the problem with not outputting the function name (this was also broken in darwin's 
headers anyways).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
           Keywords|                            |patch
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-08 21:06:21
               date|                            |
   Target Milestone|---                         |4.0.0


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


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

* [Bug target/18383] [4.0 Regression] Cannot use assert in a dynamic library
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-08 21:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-08 21:32 -------
New patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00648.html>.

-- 


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


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

* [Bug target/18383] [4.0 Regression] Cannot use assert in a dynamic library
  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
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-19 19:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-19 19:43 -------
The patch is still slightly wrong, the real way to fix it would be to add -lgcc and make sure that the 
static libgcc's sources are pritave_extern (aka hidden and like on linux is right now).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |
   Last reconfirmed|2004-11-08 21:06:21         |2004-11-19 19:43:40
               date|                            |


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


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

* [Bug target/18383] [4.0 Regression] Cannot use assert in a dynamic library
  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
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-25 19:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-25 19:46 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02176.html> (Zack posted this but I 
am keeping my self assigned as I am the one who caused the regression to get to this point).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug target/18383] [4.0 Regression] Cannot use assert in a dynamic library
  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
                   ` (3 preceding siblings ...)
  2004-11-25 19:47 ` pinskia at gcc dot gnu dot org
@ 2004-11-30 23:38 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-30 23:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-30 23:38 -------
Fixed by:
2004-11-30  Zack Weinberg  <zack@codesourcery.com>

        * gthr-gnat.c, gthr-gnat.h, gthr.h, libgcc2.h, unwind-dw2-fde.h
        * unwind.h: Surround all visibility pragmas with #ifndef HIDE_EXPORTS.

etc.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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).