Bug 15253 - __eprintf link issue for c++ on solaris 2.6
Summary: __eprintf link issue for c++ on solaris 2.6
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P1 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 15527 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-03 01:02 UTC by nick.thurn
Modified: 2004-05-19 17:45 UTC (History)
3 users (show)

See Also:
Host: sparc-sun-solaris2.6
Target: sparc-sun-solaris2.6
Build: sparc-sun-solaris2.6
Known to work:
Known to fail:
Last reconfirmed: 2004-05-03 07:19:44


Attachments
assert.h (592 bytes, application/octet-stream)
2004-05-14 01:42 UTC, nick.thurn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nick.thurn 2004-05-03 01:02:13 UTC
The basic printf("hello world!\n" program fails to link under gcc-3.4.0 on 
solaris 2.6 with the following error:

/apps/race/home/nickt/gcc/bin/ld: a.out: hidden symbol `__eprintf' 
in /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/libgcc.a
(_eprintf.oS) is referenced by DSO

This is for the following command line:

g++ -v test.cpp

The identical file (with .c extension) compiles/links with gcc and g++.
All my other c++ executables suffer the same link issue.

gcc was configured as follows:

kilmer: ~>g++ -v
Reading specs from /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-
solaris2.6/3.4.0/specs
Configured with: ../gcc-3.4.0/configure --prefix=/apps/race/home/nickt/gcc --
with-gnu-as --with-as=/apps/race/gcc/bin/as --with-gnu-ld --with-
ld=/apps/race/gcc/bin/ld --enable-languages=c,c++
Thread model: posix
gcc version 3.4.0

And built using:

gmake CFLAGS='-O' LIBCFLAGS='-g -O2' \
       LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap-lean

Thanks
Nick Thurn
Comment 1 Eric Botcazou 2004-05-03 05:45:05 UTC
Could you upload a compilable testcase that fails to link?  Thanks in advance.
Comment 2 nick.thurn 2004-05-03 05:58:58 UTC
Subject: Re:  __eprintf link issue for c++ on solaris 2.6


try:

#include <cstdio>

int main(int, const char* [])
{
      std::printf("Hello world!\n");
      return 0;
}

This fails on my machine. when compiled with

      g++ -v test.cpp

cheers
Nick

CBTO-GRT IT Sydney
+61-2-9258-1394




                                                                                                                                       
                      gcc-bugzilla@gcc.                                                                                                
                      gnu.org                  To:       Nick Thurn/Sydney/DBAustralia/DeuBa@DBAustralia                               
                                               cc:                                                                                     
                      03/05/2004 03:45         Subject:  [Bug target/15253] __eprintf link issue for c++ on solaris 2.6                
                      PM                                                                                                               
                      Please respond to                                                                                                
                      gcc-bugzilla                                                                                                     
                                                                                                                                       
                                                                                                                                       





------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-03 05:45 -------
Could you upload a compilable testcase that fails to link?  Thanks in advance.


--
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |WAITING


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

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.





--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


Comment 3 Eric Botcazou 2004-05-03 07:19:44 UTC
Thanks.  The problem doesn't occur with a compiler built with 'gmake bootstrap'
and wired to use the Sun tools.  I'll try to reproduce your configuration.
Comment 4 nick.thurn 2004-05-03 23:49:01 UTC
Subject: Re:  __eprintf link issue for c++ on solaris 2.6


I just realised the full config wasn't in the original report. In any case the below shows the error.
Note that I recompiled with gmake bootstrap last night to no effect - I did not start from clean and configure however.

kilmer: ~>g++ -v test.cpp
Reading specs from /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/specs
Configured with: ../gcc-3.4.0/configure --prefix=/apps/race/home/nickt/gcc --with-gnu-as --with-as=/apps/race/gcc/bin/as --with-gnu-ld --with-ld=/apps/race/gcc/bin/ld --enable-languages=c,c++
Thread model: posix
gcc version 3.4.0
 /apps/race/home/nickt/gcc/libexec/gcc/sparc-sun-solaris2.6/3.4.0/cc1plus -quiet -v test.cpp -quiet -dumpbase test.cpp -mcpu=v7 -auxbase test -version -o /var/tmp//ccoYMIug.s
ignoring nonexistent directory "/apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/../../../../sparc-sun-solaris2.6/include"
#include "..." search starts here:
#include <...> search starts here:
 /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/../../../../include/c++/3.4.0
 /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/../../../../include/c++/3.4.0/sparc-sun-solaris2.6
 /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/../../../../include/c++/3.4.0/backward
 /usr/local/include
 /apps/race/home/nickt/gcc/include
 /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/include
 /usr/include
End of search list.
GNU C++ version 3.4.0 (sparc-sun-solaris2.6)
        compiled by GNU C version 3.4.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /apps/race/gcc/bin/as -V -Qy -s -o /var/tmp//ccAL9glz.o /var/tmp//ccoYMIug.s
GNU assembler version 2.14 (sparc-sun-solaris2.6) using BFD version 2.14 20030612
 /apps/race/home/nickt/gcc/libexec/gcc/sparc-sun-solaris2.6/3.4.0/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/crt1.o /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/crti.o /usr/ccs/lib/values-Xa.o /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/crtbegin.o -L/apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0 -L/apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/../../../../sparc-sun-solaris2.6/lib -L/usr/ccs/bin -L/usr/ccs/lib -L/apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/../../.. /var/tmp//ccAL9glz.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc -lc /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/crtend.o /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/crtn.o
/apps/race/gcc/bin/ld: a.out: hidden symbol `__eprintf' in /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/libgcc.a(_eprintf.oS) is referenced by DSO
GNU ld version 2.14 20030612
  Supported emulations:
   elf32_sparc
collect2: ld returned 1 exit status

cheers
Nick

CBTO-GRT IT Sydney
+61-2-9258-1394




                                                                                                                                       
                      gcc-bugzilla@gcc.                                                                                                
                      gnu.org                  To:       Nick Thurn/Sydney/DBAustralia/DeuBa@DBAustralia                               
                                               cc:                                                                                     
                      03/05/2004 05:19         Subject:  [Bug target/15253] __eprintf link issue for c++ on solaris 2.6                
                      PM                                                                                                               
                      Please respond to                                                                                                
                      gcc-bugzilla                                                                                                     
                                                                                                                                       
                                                                                                                                       





------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-05-03 07:19 -------
Thanks.  The problem doesn't occur with a compiler built with 'gmake bootstrap'
and wired to use the Sun tools.  I'll try to reproduce your configuration.


--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-03 07:19:44
               date|                            |


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

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.





--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


Comment 5 Daniel Jacobowitz 2004-05-07 20:53:06 UTC
Subject: Re:  New: __eprintf link issue for c++ on solaris 2.6

> /apps/race/home/nickt/gcc/bin/ld: a.out: hidden symbol `__eprintf' 
> in /apps/race/home/nickt/gcc/lib/gcc/sparc-sun-solaris2.6/3.4.0/libgcc.a
> (_eprintf.oS) is referenced by DSO

I've encountered this error before.  I don't remember the exact cause,
but usually it means that an unfixed or outdated <assert.h> is being
picked up by the new compiler, or you have some mis-built shared
library (whichever one is trying to reference _eprintf, probably
because of a bad assert.h).

Comment 6 Eric Botcazou 2004-05-07 21:28:32 UTC
Thanks for the hint, Daniel.

The ident of <assert.h> is

#pragma ident   "@(#)assert.h   1.9     92/07/14 SMI"   /* SVr4.0 1.6.1.4 */

on the Solaris 2.6 box and it is not fixed by the compiler.
Comment 7 Eric Botcazou 2004-05-08 17:00:48 UTC
I couldn't reproduce the problem on:

beeba% uname -a
SunOS beeba 5.6 Generic_105181-35 sun4u sparc SUNW,Ultra-2

with

GNU assembler version 2.14 (sparc-sun-solaris2.6) using BFD version 2.14 20030612
GNU ld version 2.14 20030612
  Supported emulations:
   elf32_sparc

configured with:

/home/eric/cvs/gcc-3_4-branch/configure --prefix=/opt/build/eric/local
--enable-languages=c,c++ --with-as=/opt/build/eric/local/bin/as --with-gnu-as
--with-ld=/opt/build/eric/local/bin/ld --with-gnu-ld

and built with 'gmake bootstrap'.


Can you see what your <assert.h> looks like and whether it is fixed by the compiler?
Comment 8 nick.thurn 2004-05-14 01:42:11 UTC
Subject: Re:  __eprintf link issue for c++ on solaris 2.6


Hi,

Sorry for the slow response - I've been out of the office.

My assert.h file looks like the below and is not fixed by the build process.

I presume you mean I should find an assert.h file in the gcc install location that being:

      <install location>/lib/gcc/sparc-sun-solaris2.6/3.4.0/include/assert.h

There's none there or anywhere else in the install tree so I guess it's not fixed up.

cheers
Nick

CBTO-GRT IT Sydney
+61-2-9258-1394

(See attached file: assert.h)


--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
Comment 9 nick.thurn 2004-05-14 01:42:14 UTC
Created attachment 6279 [details]
assert.h
Comment 10 Eric Botcazou 2004-05-14 08:11:15 UTC
Thanks.  It appears that we have the same <assert.h> file.

Could you determine which shared library references the symbol?
Comment 11 nick.thurn 2004-05-14 08:48:22 UTC
Subject: Re:  __eprintf link issue for c++ on solaris 2.6


kilmer: ~/gcc/lib>nm -Al libstdc++.so.* libgcc_s.so.1 *.a | tee file | grep eprintf
libstdc++.so.6:         U __eprintf
libstdc++.so.6.0.0:         U __eprintf
libstdc++.a:debug.o:         U __eprintf        /apps/race/home/nickt/src/obj/sparc-sun-solaris2.6/libstdc++-v3/src/../../../../gcc-3.4.0/libstdc++-v3/src/debug.cc:489

Looks like it's the standard library.
I ran the same query on the libs in our gcc-3.3.1 install an there is no __eprintf symbol.

cheers
Nick

CBTO-GRT IT Sydney
+61-2-9258-1394




--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


Comment 12 Andrew Pinski 2004-05-18 22:16:36 UTC
*** Bug 15527 has been marked as a duplicate of this bug. ***
Comment 13 Andrew Pinski 2004-05-19 17:45:23 UTC
the only place __eprintf could be coming from is an old assert.h which should not be 
installed so this is invalid.
Comment 14 nick.thurn 2004-05-20 02:24:22 UTC
Subject: Re:  __eprintf link issue for c++ on solaris 2.6


> the only place __eprintf could be coming from is an old assert.h which should not be
> installed so this is invalid.

If you mean the Bug is invalid that is not the case. The previous version of gcc did not have this issue.

cheers
Nick

CBTO-GRT IT Sydney
+61-2-9258-1394






--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.