[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Must NOT link with pthread



On Tue, May 27, 2003 at 05:15:59PM +0200, Marcus Brinkmann wrote:
> I think that 185536 (xft2) might be a genuine bug (although I can not check
> without the X sources), while the others probably are not.  g++ should
> always add libstdc++ automatically for C++ programs.

It sounds stupid, but here is a test case (on GNU/Linux):

#include <iostream>

int
main (int argc, char *argv[])
{
  std::cout << "Hallo.";
}

$ g++ -v -o f f.cc
Reading specs from /usr/lib/gcc-lib/i386-linux/3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.3 (Debian)
 /usr/lib/gcc-lib/i386-linux/3.3/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE f.cc -D__GNUG__=3 -quiet -dumpbase f.cc -auxbase f -version -o /tmp/cct1pAZO.s
GNU C++ version 3.3 (Debian) (i386-linux)
	compiled by GNU C version 3.3 (Debian).
GGC heuristics: --param ggc-min-expand=55 --param ggc-min-heapsize=48272
ignoring nonexistent directory "/usr/i386-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3
 /usr/include/c++/3.3/i386-linux
 /usr/include/c++/3.3/backward
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/3.3/include
 /usr/include
End of search list.
 as -V -Qy -o /tmp/cccjiima.o /tmp/cct1pAZO.s
GNU assembler version 2.14.90.0.2 (i386-linux) using BFD version 2.14.90.0.2 20030515 Debian GNU/Linux
 /usr/lib/gcc-lib/i386-linux/3.3/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o f /usr/lib/gcc-lib/i386-linux/3.3/../../../crt1.o /usr/lib/gcc-lib/i386-linux/3.3/../../../crti.o /usr/lib/gcc-lib/i386-linux/3.3/crtbegin.o -L/usr/lib/gcc-lib/i386-linux/3.3 -L/usr/lib/gcc-lib/i386-linux/3.3/../../.. /tmp/cccjiima.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i386-linux/3.3/crtend.o /usr/lib/gcc-lib/i386-linux/3.3/../../../crtn.o

Note that -lstdc++ appears on the last line.  In fact, except for linux in
the path, the the output should be identical if the same compiler is used.
I think there might be a bit of deviation in the crt* stuff, but that should
be all.

Furthermore:
ulysses:/tmp# objdump -p f|grep NEEDED
  NEEDED      libstdc++.so.5
  NEEDED      libm.so.6
  NEEDED      libgcc_s.so.1
  NEEDED      libc.so.6

Except for the soname (the numbers), this should again be the same.

Thanks,
Marcus


-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/



Reply to: