Subject: Re: MySQL server under cygwin
From: "Gerrit P. Haase" <[email-masked]>
To: Christopher Faylor <[email-masked]>
Date: Sat, 27 Jul 2002 20:00:17 +0200

Hallo Christopher,

Am Samstag, 27. Juli 2002 um 18:07 schriebst du:

>>After trying a new build with 3.23.51 I see that there are some
>>problems with gcc-3,

> Boy do I miss Chuck Wilson.  He seems to be the only person on the
> planet who understands that it is necessary to to provide specific
> bug reports with (ohmigod) test cases when he encountered a problem
> with gcc.

> These "...of course gcc 3.1 doesn't work and then I told Maude, Maude,
> did you see try the bean dip! It's scrumptious" messages are not
> helping in any way.

I'm sorry.  Ok.  They MySQL folks add a flag if GCC version is >3, if
you are compiling statically and if you use gcc instead of g++, looks
like this:

if test "$GXX" = "yes"
then
  # mysqld requires -fno-implicit-templates.
  # Disable exceptions as they seams to create problems with gcc and threads.
  # mysqld doesn't use run-time-type-checking, so we disable it.
  CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"

  # If you are using 'gcc' 3.0 (not g++) to compile C++ programs,
  # we will gets some problems when linking static programs.
  # The following code is used to fix this problem.

  if test "$CXX" = "gcc"
  then
    if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
    then
      CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW"
      CXXLDFLAGS="$CXXLDFLAGS -Wl,--defsym -Wl,__cxa_pure_virtual=0"
    fi
  fi
fi

What is causing problems then is the message from the compiler that
there is an undefined reference to __cxa_pure_virtual during the link
stage.

Getting exactly this error then:

make[2]: Entering directory `/sourcecode/db/mysql-4.0.2-alpha/client'
gcc -DUNDEF_THREADS_HACK -I./../include -I../include -I./.. -I.. -I.. -O3 -DDBUG_OFF -O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti  -fno-implicit-templates -fno-exceptions -fno-rtti  -DUSE_MYSYS_NEW -c mysqlbinlog.cc
`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mcpu=pentiumpro' instead.
sh ../libtool --mode=link gcc  -O3 -DDBUG_OFF -O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti  -fno-implicit-templates -fno-exceptions -fno-rtti  -DUSE_MYSYS_NEW  -o mysqlbinlog  mysqlbinlog.o ../libmysql/libmysqlclient.la -Wl,--defsym -Wl,__cxa_pure_virtual=0 -lz -lcrypt -lm  
gcc -O3 -DDBUG_OFF -O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti -fno-implicit-templates -fno-exceptions -fno-rtti -DUSE_MYSYS_NEW -o mysqlbinlog mysqlbinlog.o ../libmysql/.libs/libmysqlclient.a -lz -lcrypt -Wl,--defsym -Wl,__cxa_pure_virtual=0 -lz -lcrypt
mysqlbinlog.o(.data$_ZTV9Log_event+0x8):mysqlbinlog.cc: undefined reference to `___cxa_pure_virtual'
mysqlbinlog.o(.data$_ZTV9Log_event+0x18):mysqlbinlog.cc: undefined reference to `___cxa_pure_virtual'
mysqlbinlog.o(.data$_ZTV9Log_event+0x1c):mysqlbinlog.cc: undefined reference to `___cxa_pure_virtual'
collect2: ld returned 1 exit status
make[2]: *** [mysqlbinlog] Error 1
make[2]: Leaving directory `/sourcecode/db/mysql-4.0.2-alpha/client'

BTW, works well when using g++ instead of gcc.  God knows why they
think that using gcc instead of g++ is better.

So it is obviously a bug on the MySQL side, leaving out a lib at the
linkline or s.th. like this?

Gerrit
-- 
=^..^=

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/