public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43974]  New: Undefined symbol main in crt1.o when compiling shared libs on Solaris
@ 2010-05-03 11:53 bjoern at j3e dot de
  2010-05-04 17:25 ` [Bug target/43974] " pinskia at gcc dot gnu dot org
  2010-05-04 22:50 ` bjoern at j3e dot de
  0 siblings, 2 replies; 3+ messages in thread
From: bjoern at j3e dot de @ 2010-05-03 11:53 UTC (permalink / raw)
  To: gcc-bugs

Comiling any shared library on Solaris with LDFLAGS "-Wl,-z,defs" to make sure
that there are no unresoloved symbols results in:

Undefined                       first referenced
 symbol                             in file
main                               
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/crt1.o
ld: fatal: Symbol referencing errors. No output written to bin/libtalloc.so.2

It looks like there is a wrong assumption about a shared library having to have
a symbol "main" on gcc on Solaris. More recent gcc releases than the above
example are also affected.


-- 
           Summary: Undefined symbol main in crt1.o when compiling shared
                    libs on Solaris
           Product: gcc
           Version: 3.4.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bjoern at j3e dot de


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


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

* [Bug target/43974] Undefined symbol main in crt1.o when compiling shared libs on Solaris
  2010-05-03 11:53 [Bug c/43974] New: Undefined symbol main in crt1.o when compiling shared libs on Solaris bjoern at j3e dot de
@ 2010-05-04 17:25 ` pinskia at gcc dot gnu dot org
  2010-05-04 22:50 ` bjoern at j3e dot de
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-05-04 17:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-05-04 17:24 -------
Can you show the command line which you used to link the shared library?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
          Component|c                           |target
  GCC build triplet|                            |sparc-sun-solaris2.10
   GCC host triplet|                            |sparc-sun-solaris2.10
 GCC target triplet|                            |sparc-sun-solaris2.10


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


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

* [Bug target/43974] Undefined symbol main in crt1.o when compiling shared libs on Solaris
  2010-05-03 11:53 [Bug c/43974] New: Undefined symbol main in crt1.o when compiling shared libs on Solaris bjoern at j3e dot de
  2010-05-04 17:25 ` [Bug target/43974] " pinskia at gcc dot gnu dot org
@ 2010-05-04 22:50 ` bjoern at j3e dot de
  1 sibling, 0 replies; 3+ messages in thread
From: bjoern at j3e dot de @ 2010-05-04 22:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bjoern at j3e dot de  2010-05-04 22:49 -------
I should have taken a look at the exact command line earlier. The build system
on solaris is quite messed up. Fixing the linking calls makes them also work
with "-z defs". Sorry for the noise.


-- 

bjoern at j3e dot de changed:

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


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


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-03 11:53 [Bug c/43974] New: Undefined symbol main in crt1.o when compiling shared libs on Solaris bjoern at j3e dot de
2010-05-04 17:25 ` [Bug target/43974] " pinskia at gcc dot gnu dot org
2010-05-04 22:50 ` bjoern at j3e dot de

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