Description:
Compiling 5.0 tree on Gentoo Linux fails with error:
undefined reference to `operator delete(void*)'
The failure has been happening with bk sources for a couple of weeks (can't remeber exact date when it started). it happens both with compile-pentium-debug and compile-pentium-max.
4.1 tree compiles without problems.
How to repeat:
Try to compile 5.0 and get the following:
ccache gcc -O3 -DDBUG_OFF -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -mcpu=pentiumpro -O3 -fno-omit-frame-pointer -g -rdynamic -o myisamchk myisamchk.o libmyisam.a ../mysys/libmysys.a ../dbug/libdbug.a ../strings/libmystrings.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
../mysys/libmysys.a(raid.o)(.text+0xa5): In function `my_raid_create':
/home/psergey/mysql-5.0/mysys/raid.cc:119: undefined reference to `operator new(unsigned int)'
../mysys/libmysys.a(raid.o)(.text+0x13b):/home/psergey/mysql-5.0/mysys/raid.cc:130: undefined reference to `operator delete(void*)'
../mysys/libmysys.a(raid.o)(.text+0x195): In function `my_raid_open':
/home/psergey/mysql-5.0/mysys/raid.cc:141: undefined reference to `operator new(unsigned int)'
../mysys/libmysys.a(raid.o)(.text+0x22b):/home/psergey/mysql-5.0/mysys/raid.cc:152: undefined reference to `operator delete(void*)'
../mysys/libmysys.a(raid.o)(.text+0x786): In function `my_raid_close':
/home/psergey/mysql-5.0/mysys/raid.cc:279: undefined reference to `operator delete(void*)'
collect2: ld returned 1 exit status
make[2]: *** [myisamchk] Error 1
make[2]: Leaving directory `/home/psergey/mysql-5.0/myisam'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/psergey/mysql-5.0'
If one adds -lstd++ into LIBS in mysys/Makefile and myisam/Makefile one can finish the build.
Suggested fix:
Make it compile