Re: [Dovecot] dovecot cores
On 12.10.2012, at 10.02, dovecot@freakout.de wrote:
-lmysqlclient shouldn't be in LDFLAGS.
I'm not sure why it's doing that. It really shouldn't. You could try SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient if one of them helps.
Timo Sirainen wrote the following on 12.10.2012 14:34:
Since Dovecot 1.x all the way up to 2.1.10 I had trouble with this and only by putting -lmysqlclient in LDFLAGS as described before Dovecot compiles without error (Ubuntu Server 8.04 & 10.04, mySQL in a non-standart location).
On 12.10.2012, at 10.45, Tamsy wrote:
Axel, please let us know whether one of these works: "SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient".
Since Dovecot 1.x all the way up to 2.1.10 I had trouble with this and only by putting -lmysqlclient in LDFLAGS as described before Dovecot compiles without error (Ubuntu Server 8.04 & 10.04, mySQL in a non-standart location).
If you run configure without adding the -lmysqlclient, what do you get with:
egrep -i 'mysql|auth_libs|sql_libs' Makefile
I guess the problem is that I shouldn't have copy&pasted the mysql detection code from php, and configure somehow passes successfully without actually setting any MYSQL_LIBS..
Timo Sirainen wrote the following on 12.10.2012 14:50:
Just ran configure without adding the -lmysqlclient (CPPFLAGS='-I/opt/mysql/include/mysql' LDFLAGS='-L/opt/mysql/lib/mysql -lz -lcrypt -lnsl -lm' ./configure --with-mysql....
egrep -i 'mysql|auth_libs|sql_libs' Makefile
says:
AUTH_LIBS = CPPFLAGS = -I/opt/mysql/include/mysql LDFLAGS = $(NOPLUGIN_LDFLAGS) -L/opt/mysql/lib/mysql -lz -lcrypt -lnsl -lm MYSQL_CFLAGS = MYSQL_CONFIG = NO MYSQL_LIBS = PGSQL_LIBS = SQL_LIBS = sql_drivers = mysql scan-build -o scan-reports ../configure --with-ldap=auto --with-pgsql=auto --with-mysql=auto --with-sqlite=auto --with-solr=auto --with-gssapi=auto --with-libwrap=auto; \
configure runs without error but make ends with:
<snip>
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_get_error': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:469: undefined reference to
mysql_errno'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:470: undefined
reference to mysql_error' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_get_field_value_binary':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:436: undefined
reference to mysql_fetch_lengths' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_fetch_fields':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:383: undefined
reference to mysql_num_fields' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:384: undefined reference to
mysql_fetch_fields'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_next_row': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:366: undefined reference to
mysql_fetch_row'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:370: undefined
reference to mysql_errno' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_free':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:351: undefined
reference to mysql_free_result' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_do_query':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:233: undefined
reference to mysql_query' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:237: undefined reference to
mysql_errno'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_query_s': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:315: undefined reference to
mysql_affected_rows'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:316: undefined
reference to mysql_store_result' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:321: undefined reference to
mysql_next_result'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:332: undefined
reference to mysql_free_result' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:327: undefined reference to
mysql_errno'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_exec': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:284: undefined reference to
mysql_error'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_escape_string': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:274: undefined reference to
mysql_real_escape_string'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:268: undefined
reference to mysql_escape_string' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_connect':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:83: undefined
reference to mysql_options' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:87: undefined reference to
mysql_options'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:92: undefined
reference to mysql_ssl_set' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:110: undefined reference to
mysql_real_connect'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:123: undefined
reference to mysql_error' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_deinit_v':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:226: undefined
reference to mysql_close' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_parse_connect_string':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:198: undefined
reference to mysql_init' collect2: ld returned 1 exit status make[3]: *** [auth] Error 1 make[3]: Leaving directory
/usr/local/src/dovecot-2.1.10/src/auth'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /usr/local/src/dovecot-2.1.10/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/usr/local/src/dovecot-2.1.10'
make: *** [all] Error 2
According to Tamsy:
SQL_LIBS=-lmysqlclient => not working AUTH_LIBS=-lmysqlclient => not working
MYSQL_LIBS=-lmysqlclient
LDFLAGS="-L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib"
./configure --prefix=%{_prefix}
--sysconfdir=%{_etcdir} --mandir=%{_mandir} --docdir=%{_docdir} --libexecdir=%{_sbindir} --datadir=%{_prefix}
--with-rundir=/var/dovecot/run
--with-statedir=/var/dovecot/state
--with-mysql
=> WORKING
BUT:
[axel@joe rpm]$ ldd BUILD/dovecot-2.1.10-root/opt/dovecot-2.1.10-5/sbin/dovecot libdovecot.so.0 => /opt/dovecot/lib/libdovecot.so.0 (0x00993000) libgcc_s.so.1 => /opt/gcc4/lib/libgcc_s.so.1 (0x0092c000) libc.so.6 => /lib/libc.so.6 (0x00ebf000)
dovecot still seems to be linked with the mysqlclient!
i have just compiled - not tried the binaries - the core dump occurs only in the night!
If you run configure without adding the -lmysqlclient, what do you get with:
egrep -i 'mysql|auth_libs|sql_libs' Makefile
[axel@joe dovecot-2.1.10]$ egrep -i 'mysql|auth_libs|sql_libs' Makefile AUTH_LIBS = -lcrypt -lmysqlclient CFLAGS = -std=gnu99 -g -I/opt/zlib/include -I/opt/ssl/include -I/opt/mysql/include -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -fno-builtin-strftime -Wstrict-aliasing=2 -I/opt/ssl/include LDFLAGS = $(NOPLUGIN_LDFLAGS) -L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib MYSQL_CFLAGS = MYSQL_CONFIG = NO MYSQL_LIBS = -lmysqlclient PGSQL_LIBS = SQL_LIBS = -lmysqlclient sql_drivers = mysql scan-build -o scan-reports ../configure --with-ldap=auto --with-pgsql=auto --with-mysql=auto --with-sqlite=auto --with-solr=auto --with-gssapi=auto --with-libwrap=auto; \
Cheers Axel
On 12.10.2012, at 11.10, dovecot@freakout.de wrote:
I think this is the correct fix for this. Basically same as what I committed now: http://hg.dovecot.org/dovecot-2.1/rev/c8d55ba25f39
Maybe the old LDFLAGS was cached somehow? Or maybe the rpm build does something strange? I don't see how that could happen otherwise.
participants (3)
-
dovecot@freakout.de
-
Tamsy
-
Timo Sirainen