Bug #25337 Cannot build with OpenSSL support
Submitted: 30 Dec 2006 5:10 Modified: 26 Apr 2007 16:56
Reporter: Josh Trutwin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.1-falcon-BK, 5.2.3, 5.1.16, 5.1.14-beta OS:Linux (Linux)
Assigned to: Magnus Blåudd CPU Architecture:Any

[30 Dec 2006 5:10] Josh Trutwin
Description:
I thought I submitted this bug back when I encountered it in version 5.1.9-beta but I cannot find it.  Anyway, I have build errors on slackware 10.0 linux - gcc 3.3.4.  My first guess after searching the existing bugs was to update autoconf/automake to the latest/greatest - but that didn't help.  

Here is the error:

creating udf_example.la
(cd .libs && rm -f udf_example.la && ln -s ../udf_example.la udf_example.la)
gcc -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql-5.1.14-beta\"" -DDATADIR="\"/usr/local/mysql-5.1.14-beta/var\"" -DSHAREDIR="\"/usr/local/mysql-5.1.14-beta/share/mysql\"" -DLIBDIR="\"/usr/local/mysql-5.1.14-beta/lib/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -I../regex -I. -I    -O3 -march=pentium3 -felide-constructors -fno-exceptions -fno-rtti   -fno-implicit-templates -fno-exceptions -fno-rtti -c -I../include -I../include -I../regex -I. -I -DTZINFO2SQL mysql_tzinfo_to_sql.cc
/bin/sh ../libtool --preserve-dup-deps --tag=CXX --mode=link gcc  -O3 -march=pentium3 -felide-constructors -fno-exceptions -fno-rtti   -fno-implicit-templates -fno-exceptions -fno-rtti  -rdynamic  -o mysql_tzinfo_to_sql  mysql_tzinfo_to_sql.o -all-shared ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a ../regex/libregex.a ../strings/libmystrings.a -lz  -lpthread -lcrypt -lnsl -lm  -lpthread 
gcc -O3 -march=pentium3 -felide-constructors -fno-exceptions -fno-rtti -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o mysql_tzinfo_to_sql mysql_tzinfo_to_sql.o -all-shared  ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a ../regex/libregex.a ../strings/libmystrings.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
mysql_tzinfo_to_sql.o(.text+0x1fb): In function `Time_zone_system::TIME_to_gmt_sec(st_mysql_time const*, char*) const':
: undefined reference to `my_system_gmt_sec'
mysql_tzinfo_to_sql.o(.text+0x23f): In function `Time_zone_system::gmt_sec_to_TIME(st_mysql_time*, long) const':
: undefined reference to `localtime_to_TIME(st_mysql_time*, tm*)'
mysql_tzinfo_to_sql.o(.text+0x2af): In function `Time_zone_utc::gmt_sec_to_TIME(st_mysql_time*, long) const':
: undefined reference to `localtime_to_TIME(st_mysql_time*, tm*)'
mysql_tzinfo_to_sql.o(.text+0x842): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `THD::THD[in-charge]()'
mysql_tzinfo_to_sql.o(.text+0x872): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `THD::store_globals()'
mysql_tzinfo_to_sql.o(.text+0xa90): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `simple_open_n_lock_tables(THD*, st_table_list*)'
mysql_tzinfo_to_sql.o(.text+0xc11): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `global_system_variables'
mysql_tzinfo_to_sql.o(.text+0xc46): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `close_thread_tables(THD*, bool, bool)'
mysql_tzinfo_to_sql.o(.text+0xc78): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `THD::store_globals()'
mysql_tzinfo_to_sql.o(.text+0xc90): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `THR_THD'
mysql_tzinfo_to_sql.o(.text+0xcaa): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `THR_MALLOC'
mysql_tzinfo_to_sql.o(.text+0xd03): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0xd1b): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0xd2c): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0xd79): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `sql_print_warning(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0xdab): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0xdbc): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0xdd9): In function `my_tz_init(THD*, char const*, char)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x105a): In function `my_tz_find(String const*, st_table_list*)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x1135): In function `my_tz_find_with_opening_tz_tables(THD*, String const*)':
: undefined reference to `simple_open_n_lock_tables(THD*, st_table_list*)'
mysql_tzinfo_to_sql.o(.text+0x115d): In function `my_tz_find_with_opening_tz_tables(THD*, String const*)':
: undefined reference to `close_thread_tables(THD*, bool, bool)'
mysql_tzinfo_to_sql.o(.text+0x1c7e): In function `tz_load_from_open_tables(String const*, st_table_list*)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x1fff): In function `tz_load_from_open_tables(String const*, st_table_list*)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x2212): In function `tz_load_from_open_tables(String const*, st_table_list*)':
: undefined reference to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x2245): In function `tz_load_from_open_tables(String const*, st_table_list*)':
: undefined reference to `sql_print_error(char const*, ...)'
collect2: ld returned 1 exit status
make[4]: *** [mysql_tzinfo_to_sql] Error 1
make[4]: Leaving directory `/usr/local/source/db/mysql-5.1.14-beta/sql'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/local/source/db/mysql-5.1.14-beta/sql'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/source/db/mysql-5.1.14-beta/sql'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/source/db/mysql-5.1.14-beta'
make: *** [all] Error 2

Let me know if there is additional info I can provide.

Thanks,

Josh

How to repeat:
Compile on my system.  :)
[30 Dec 2006 11:50] Valeriy Kravchuk
Thank you for a problem report. Please, send ./configure command line used before running make.
[30 Dec 2006 23:52] Josh Trutwin
doh - sorry, that would be useful wouldn't it?

env CFLAGS="-O3 -march=pentium3" CXX=gcc CXXFLAGS="-O3 -march=pentium3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql-5.1.14-beta \
--with-unix-socket-path=/usr/local/mysql-5.1.14-beta/mysql.sock \
--enable-assembler \
--enable-local-infile \
--disable-shared \
--with-extra-charsets=complex \
--without-isam \
--enable-thread-safe-client \
--with-vio \
--with-ssl=/usr/local \
--enable-shared=yes \
--with-mysqld-ldflags=-all-shared \
--with-charset=latin1 \
--with-collations=latin1_general_ci \
--with-archive-storage-engine \
--with-csv-storage-engine \
--with-blackhole-storage-engine \
--with-federated-storage-engine \
--with-innodb
[30 Jan 2007 14:51] Valeriy Kravchuk
Please, try to repeat without "-O3 -march=pentium3" in CCFLAGS/CXXFLAGS, and inform about the results.
[16 Feb 2007 4:09] Josh Trutwin
Hi - sorry for the delayed response - this produced the exact same error message - also tried with 5.1.15.

Full configure:

env CXX=gcc CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql-5.1.15-beta \
--with-unix-socket-path=/usr/local/mysql-5.1.15-beta/mysql.sock \
--enable-assembler \
--enable-local-infile \
--disable-shared \
--with-extra-charsets=complex \
--without-isam \
--enable-thread-safe-client \
--with-vio \
--with-ssl=/usr/local \
--enable-shared=yes \
--with-mysqld-ldflags=-all-shared \
--with-charset=latin1 \
--with-collations=latin1_general_ci \
--with-archive-storage-engine \
--with-csv-storage-engine \
--with-blackhole-storage-engine \
--with-federated-storage-engine \
--with-innodb
[3 Mar 2007 13:30] Sietse van Zanen
Just had this on 5.2.3 too. Was really baffled as I had successfully compiled it around 6 times before.

Figured, that the only thing I changed was setting --with-ssl=/usr/local to use openssl instead of bundled yassl. Switched back to yassl (just --with-ssl) and compiled succesfully again. To verify, again tried using openssl, but failed.

In my opinion, this is a real showstopper, I need openssl, as it is way more flexible than bundled yassl. Luckily I am just testing and playing around with this version.

As the error occurs in udf_example, it might compile if you leave out the example user defined functions. Haven't tried this (is it possible at all?). Something seems majorly screwed up in the configure process. And I am sooo glad I am not the one who has to fix that..... ;-p

I am compiling with gcc3.4.6 on solaris 10 / x86
./configure --prefix=/usr/local --sysconfdir=/usr/local/etc/mysql --localstatedir=/usr/local/var/mysql --enable-shared --enable-static --enable-assembler --enable-local-infile --with-extra-charsets=all --with-pic --with-pthread --with-zlib-dir=/usr/local  --with-libwrap --with-error-inject
--with-fast-mutexes --with-atomic-ops=up  --with-big-tables --with-ssl(=/usr/local) --with-plugins=all --without-plugin-falcon --with-ndb-test --with-embedded-server --with-embedded-privilege-control --with-docs
[21 Mar 2007 13:32] Valeriy Kravchuk
Please, try to build with a simpler configure:

./configure --prefix=/usr/local/mysql-5.1.16-beta \
--with-extra-charsets=complex \
--enable-thread-safe-client \
--with-archive-storage-engine \
--with-csv-storage-engine \
--with-blackhole-storage-engine \
--with-federated-storage-engine \
--with-innodb

and inform about the results.
[21 Mar 2007 13:40] Sietse van Zanen
I think I already tried with only configure --with-ssl (uses bundled yassl and succeeds).

I also think I tried with only --with-ssl=/usr/local (openssl, fails).

But it's been a while, I will verify again.
[21 Mar 2007 16:58] Malcolm Melville
Note for the record: problem is repeatable in exactly the same way on Slackware 11.0 trying to build 5.1.16 beta. Running on HP ML150 (2xdualcore xeon) and AMD Athlon single core. With OpenSSL it fails as originally described, without OpenSSL it is fine.
[24 Mar 2007 10:03] Sietse van Zanen
Just verified:

./configure --with-ssl --without-plugin-falcon
this compiles succesfully

./configure --with-ssl=/usr/local --without-plugin-falcon
This fails in the udf compilation.
[25 Mar 2007 12:22] Valeriy Kravchuk
I can not also build latest mysql-5.1-falcon with OpenSSL 0.9.8a (error messages were different, but anyway) on my SuSE Linux, while --with-ssl allows to build same sources without problems. So, this is a verified bug.
[25 Mar 2007 13:16] Valeriy Kravchuk
Same bug (exactly!) with latest OpenSSL 0.9.8e:

...
g++ -O3 -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o mysql_tzi
nfo_to_sql mysql_tzinfo_to_sql.o  ../vio/libvio.a ../mysys/libmysys.a ../dbug/li
bdbug.a ../regex/libregex.a ../strings/libmystrings.a -lz -lpthread -lcrypt -lns
l -lm -lpthread
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../crt1.o(.text+0x18): In function
`_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
mysql_tzinfo_to_sql.o(.text+0x127a): In function `my_tz_find(String const*, st_t
able_list*)':
mysql_tzinfo_to_sql.cc: undefined reference to `sql_print_error(char const*, ...
)'
mysql_tzinfo_to_sql.o(.text+0x15d6):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x1d51):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x1f3c):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x20cc): In function `my_tz_find_with_opening_tz_tab
les(THD*, String const*)':
mysql_tzinfo_to_sql.cc: undefined reference to `simple_open_n_lock_tables(THD*,
st_table_list*)'
mysql_tzinfo_to_sql.o(.text+0x20f7):mysql_tzinfo_to_sql.cc: undefined reference
to `close_thread_tables(THD*, bool, bool)'
mysql_tzinfo_to_sql.o(.text+0x216f): In function `my_tz_init(THD*, char const*,
char)':
mysql_tzinfo_to_sql.cc: undefined reference to `THD::THD[in-charge]()'
mysql_tzinfo_to_sql.o(.text+0x219a):mysql_tzinfo_to_sql.cc: undefined reference
to `THD::store_globals()'
mysql_tzinfo_to_sql.o(.text+0x23eb):mysql_tzinfo_to_sql.cc: undefined reference
to `simple_open_n_lock_tables(THD*, st_table_list*)'
mysql_tzinfo_to_sql.o(.text+0x2539):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x255d):mysql_tzinfo_to_sql.cc: undefined reference
to `THD::store_globals()'
mysql_tzinfo_to_sql.o(.text+0x257a):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x25aa):mysql_tzinfo_to_sql.cc: undefined reference
to `THD::store_globals()'
mysql_tzinfo_to_sql.o(.text+0x261d):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_warning(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x2685):mysql_tzinfo_to_sql.cc: undefined reference
to `global_system_variables'
mysql_tzinfo_to_sql.o(.text+0x26ae):mysql_tzinfo_to_sql.cc: undefined reference
to `close_thread_tables(THD*, bool, bool)'
mysql_tzinfo_to_sql.o(.text+0x2756):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x276e):mysql_tzinfo_to_sql.cc: undefined reference
to `THR_THD'
mysql_tzinfo_to_sql.o(.text+0x277e):mysql_tzinfo_to_sql.cc: undefined reference
to `THR_MALLOC'
mysql_tzinfo_to_sql.o(.text+0x2796):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x27da):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x2803):mysql_tzinfo_to_sql.cc: undefined reference
to `sql_print_error(char const*, ...)'
mysql_tzinfo_to_sql.o(.text+0x2ac3): In function `Time_zone_utc::gmt_sec_to_TIME
(st_mysql_time*, long) const':
mysql_tzinfo_to_sql.cc: undefined reference to `localtime_to_TIME(st_mysql_time*
, tm*)'
mysql_tzinfo_to_sql.o(.text+0x2b03): In function `Time_zone_system::gmt_sec_to_T
IME(st_mysql_time*, long) const':
mysql_tzinfo_to_sql.cc: undefined reference to `localtime_to_TIME(st_mysql_time*
, tm*)'
mysql_tzinfo_to_sql.o(.text+0x2b33): In function `Time_zone_system::TIME_to_gmt_
sec(st_mysql_time const*, char*) const':
mysql_tzinfo_to_sql.cc: undefined reference to `my_system_gmt_sec'
collect2: ld returned 1 exit status
make[4]: *** [mysql_tzinfo_to_sql] Error 1
make[4]: Leaving directory `/home/openxs/work/mysql-5.1-falcon/sql'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/openxs/work/mysql-5.1-falcon/sql'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/openxs/work/mysql-5.1-falcon/sql'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/openxs/work/mysql-5.1-falcon'
make: *** [all] Error 2

Verified as described in the last comment from Sietse van Zanen. Thank you for your persistence!
[3 Apr 2007 16:30] Magnus Blåudd
Problem caused by mysql_tzinfo_t_sql built without -DTZINFO2SQL. The INCLUDE directive has and empty line in it.
[3 Apr 2007 16:39] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/23697

ChangeSet@1.2557, 2007-04-03 18:39:11+02:00, msvensson@pilot.blaudden +1 -0
  Bug#25337 Cannot build with OpenSSL support
[4 Apr 2007 10:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/23770

ChangeSet@1.2558, 2007-04-04 12:42:52+02:00, msvensson@pilot.blaudden +1 -0
  Bug#25337 Cannot build with OpenSSL support
   - Cleanup Makefile.am, simplify how we build gen_lex_hash
     and mysql_tzinfo_to_sql
[26 Apr 2007 11:36] Bugs System
Pushed into 5.1.18-beta
[26 Apr 2007 16:56] Paul DuBois
No changelog entry needed.
[7 May 2007 7:55] Sveta Smirnova
There is Bug #28267 repeatable with current BK sources, which can be duplicate of this one.