public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* 1997-09-29: Bad name mangling by c++
@ 1997-10-01 21:50 Raja R Harinath
  0 siblings, 0 replies; only message in thread
From: Raja R Harinath @ 1997-10-01 21:50 UTC (permalink / raw)
  To: egcs

Hi,

I had to recompile `dxpc-3.7.0' with the new c++.  I had problems w/
inconsistent name mangling.

  c++ -g -O2  -I/opt/X11R6.1/include  -DHAVE_SYS_SELECT_H=1  -o dxpc main.o util.o constants.o Stats.o Multiplexer.o ClientMultiplexer.o ServerMultiplexer.o ClientChannel.o ServerChannel.o ReadBuffer.o ProxyReadBuffer.o ClientReadBuffer.o ServerReadBuffer.o EncodeBuffer.o DecodeBuffer.o WriteBuffer.o IntCache.o CharCache.o PixelCache.o HuffmanCoder.o ClientCache.o ServerCache.o TextCompressor.o LastPixels.o SequenceNumQueue.o BlockCache.o BlockCacheSet.o   -L/opt/X11R6.1/lib -R/opt/X11R6.1/lib -lsocket  -lnsl
  main.o: In function `main':
  /home/grad04/harinath/z/z/dxpc-3.7.0/sol2/../main.C:108: undefined reference to `SaveCopyrightFromOptimizer__Iv'
  collect2: ld returned 1 exit status
  make: *** [dxpc] Error 1

Here's why:

  rawana ~/z/z/dxpc-3.7.0/sol2 > c++ --version
  egcs-2.90.11 970929 (gcc2-970802 experimental)
  rawana ~/z/z/dxpc-3.7.0/sol2 > nm main.o | grep Copy
	   U SaveCopyrightFromOptimizer__Iv
  rawana ~/z/z/dxpc-3.7.0/sol2 > nm constants.o | grep Copy
  00000000 T SaveCopyrightFromOptimizer__

And here's the relevant part of the source code:

  rawana ~/z/z/dxpc-3.7.0 > grep -C SaveCopy *
  constants.C-// "copyright" string literal ends up in the resulting binary
  constants.C-const char *
  constants.C:SaveCopyrightFromOptimizer(void)
  constants.C-{
  constants.C-  return copyright;
  --
  constants.H-// Call this in something other than constants.C to make sure that the
  constants.H-// copyright and liability disclaimer end up in the resulting executable
  constants.H:extern const char *SaveCopyrightFromOptimizer(void);
  constants.H-
  constants.H-#endif /* Constants_H */
  --
  main.C-main(int argc, char **argv)
  main.C-{
  main.C:  (void) SaveCopyrightFromOptimizer();
  main.C-
  main.C-  udomSocketPathname[0] = 0;

If you need more info, I could send you a more detailed script.

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-10-01 21:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-01 21:50 1997-09-29: Bad name mangling by c++ Raja R Harinath

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