Description:
Some undefined references were found in function 'get_new_handler' when building MySQL
4.1.7. The message the compiler sent was:
/bin/sh ../../libtool --preserve-dup-deps --mode=link g++ -O3 -DDBUG_OFF -O2
-march=i386
-mcpu=i686 -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o mysqltest
mysqltest.o ../libmysqld.a -lrt -ldl -lpthread -lcrypt -lnsl -lm -lpthread -lcrypt -lnsl -lm -lz
-L/usr/lib -lssl -lcrypto mkdir .libs
g++ -O3 -DDBUG_OFF -O2 -march=i386 -mcpu=i686 -fno-implicit-templates -fno-exceptions
-fno-rtti -rdynamic -o mysqltest mysqltest.o ../libmysqld.a -lrt -ldl -lpthread -lcrypt -lnsl -lm
-lpthread -lcrypt -lnsl -lm -lz -L/usr/lib -lssl -lcrypto
../libmysqld.a(handler.o)(.text+0x76e): In function `get_new_handler(st_table*, db_type)':
: undefined reference to `vtable for ha_archive'
../libmysqld.a(handler.o)(.text+0x894): In function `get_new_handler(st_table*, db_type)':
: undefined reference to `vtable for ha_tina'
collect2: ld returned 1 exit status
make[3]: ** [mysqltest] Erro 1
make[3]: Leaving directory
`/workhorse/CCL/Tree/trunk/mysql/BUILD/mysql-4.1.7/libmysqld/examples'
make[2]: ** [all-recursive] Erro 1
make[2]: Leaving directory
`/workhorse/CCL/Tree/trunk/mysql/BUILD/mysql-4.1.7/libmysqld'
make[1]: ** [all-recursive] Erro 1
make[1]: Leaving directory `/workhorse/CCL/Tree/trunk/mysql/BUILD/mysql-4.1.7'
make: ** [all] Erro 2
How to repeat:
The bug showed off when building ("make") MySQL with the following options set when running
the
"configure" script:
--enable-shared \
--enable-static \
--enable-thread-safe-client \
--enable-assembler \
--enable-local-infile \
--enable-largefile \
--with-pthread \
--without-raid \
--with-mysqld-user=mysql \
--without-libwrap \
--without-pstack \
--without-debug \
--with-server \
--with-embedded-server \
--with-query-cache \
--with-geometry \
--with-embedded-privilege-control \
--with-extra-tools \
--with-mysqlfs \
--with-vio \
--with-openssl \
--with-docs \
--with-man \
--with-bench \
--with-readline \
--with-extra-charsets=all \
--with-isam \
--with-berkeley-db \
--with-innodb \
--with-archive-storage-engine \
--with-csv-storage-engine \
--with-ndbcluster \
--with-ndb-shm \
--without-ndb-test \
--with-ndb-docs \
--with-ndb-port-base
Suggested fix:
The missiong references are found into the ha_arquive.o and ha_tina.o. Running the
compilation of the "broken" file by hand, adding the missing object files, seens to be fine:
g++ -O3 -DDBUG_OFF -O2 -march=i386 -mcpu=i686 -fno-implicit-templates -fno-exceptions
-fno-rtti -rdynamic -o mysqltest mysqltest.o ../libmysqld.a -lrt -ldl -lpthread -lcrypt -lnsl -lm
-lpthread -lcrypt -lnsl -lm -lz -L/usr/lib -lssl -lcrypto ../../sql/ha_archive.o ../../sql/ha_tina.o