Problem linking MySQL 4.1.11 via FreeBSD 4.10 ports
I am having a problem building from ports, which is a fairly rare experience for me. When I try to make the current port of the MySQL 4.1 server under FreeBSD 4.10, I get a huge stream of undefined reference errors at the link step for mysqld. It would seem it can't find any thread-related library references, e.g. `mutex_enter_func', regardless of which thread library I request. I started out trying to build with the default pthreads library, then switched to the Linuxthreads library as it's supposed to have better performance under 4.x anyway. I've checked my environment for a messed up LD_CONFIG_PATH, have rerun ldconfig (numerous times) and have checked the threads libraries created using ldd. I can see the lthread library being referenced on the command line. Factoids: * Running FreeBSD 4.10 on a development-only server (thank goodness.) * The ports tree was CVSupped late last week (4/14/2005) * Trying to build MySQL version 4.1.11 from /usr/ports/databases/mysql41-server/ * linuxthreads-2.2.3_16 built and installed yesterday, did not resolve the problem * Problem seen (with different variable names) both with and without the WITH_LINUXTHREADS=yes parameter to make. * gcc 2.95.4 (system version), libtool-1.5.10_1 (from ports) * I've built about 10 other packages from ports into binary packages in the last few days, with no similar problems. * I've tried switching to a regular root shell via su, to make sure it's not a sudo environment problem, even though my other port makes work from sudo. * I've repeatedly done a make clean to make sure that I don't have configuration cruft. $ cc -v Using builtin specs. gcc version 2.95.4 20020320 [FreeBSD] $ head -4 /var/run/dmesg.boot | tail -1 FreeBSD 4.10-RELEASE #0: Tue Jun 22 17:01:51 HST 2004 $ head Makefile # New ports collection makefile for:MySQL-server # Date created: Fri Apr 11 10:06:26 CET 2003 # Whom: Alex Dupre [EMAIL PROTECTED] # # $FreeBSD: ports/databases/mysql41-server/Makefile,v 1.206 2005/04/12 03:25:02 obrien Exp $ # PORTNAME?= mysql PORTVERSION=4.1.11 PORTREVISION?= 1 $ sudo make FORCE_PKG_REGISTER=yes WITH_LINUXTHREADS=yes ... Making all in share /usr/local/bin/libtool15 --preserve-dup-deps --mode=link cc -DDBUG_OFF -DNEWSA LT -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include/pthread/linu xthreads -DNEWSALT -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE -I/usr/local/incl ude/pthread/linuxthreads -felide-constructors -fno-rtti -fno-exceptions -fno-i mplicit-templates -fno-exceptions -fno-rtti -DMYSQLD_NET_RETRY_COUNT=100 -o mysqld sql_lex.o sql_handler.o item.o item_sum.o item_buff.o item_func.o i tem_cmpfunc.o item_strfunc.o item_timefunc.o thr_malloc.o item_create.o item_ subselect.o item_row.o item_geofunc.o field.o strfunc.o key.o sql_class.o sql_ list.o net_serv.o protocol.o sql_state.o lock.o my_lock.o sql_string.o sql_ma nager.o sql_map.o mysqld.o password.o hash_filo.o hostname.o set_var.o sql_par se.o sql_yacc.o sql_base.o table.o sql_select.o sql_insert.o sql_prepare.o sql _error.o sql_update.o sql_delete.o uniques.o sql_do.o procedure.o item_uniq.o sql_test.o log.o log_event.o init.o derror.o sql_acl.o unireg.o des_key_file. o discover.o time.o opt_range.o opt_sum.o records.o filesort.o handler.o ha_h eap.o ha_myisam.o ha_myisammrg.o ha_berkeley.o ha_innodb.o ha_isam.o ha_isammr g.o ha_ndbcluster.o sql_db.o sql_table.o sql_rename.o sql_crypt.o sql_load.o m f_iocache.o field_conv.o sql_show.o sql_udf.o sql_analyse.o sql_cache.o slave. o sql_repl.o sql_union.o sql_derived.o client.o sql_client.o mini_client_error s.o pack.o stacktrace.o repl_failsafe.o gstream.o spatial.o sql_help.o protoc ol_cursor.o tztime.o my_time.o ha_example.o ha_archive.o ha_tina.o ha_blackhol e.o -L../bdb/build_unix -ldb ../innobase/usr/libusr.a ../innobase/srv/libsrv.a ../innobase/dict/libdict.a ../innobase/que/libque.a ../innobase/srv/libsrv.a ../ innobase/ibuf/libibuf.a ../innobase/row/librow.a ../innobase/pars/libpars.a ../i nnobase/btr/libbtr.a ../innobase/trx/libtrx.a ../innobase/read/libread.a ../inno base/usr/libusr.a ../innobase/buf/libbuf.a ../innobase/ibuf/libibuf.a ../innobas e/eval/libeval.a ../innobase/log/liblog.a ../innobase/fsp/libfsp.a ../innobase/f ut/libfut.a ../innobase/fil/libfil.a ../innobase/lock/liblock.a ../innobase/mtr/ libmtr.a ../innobase/page/libpage.a ../innobase/rem/librem.a ../innobase/thr/lib thr.a ../innobase/sync/libsync.a ../innobase/data/libdata.a ../innobase/mach/lib mach.a ../innobase/ha/libha.a ../innobase/dyn/libdyn.a ../innobase/mem/libmem.a ../innobase/sync/libsync.a ../innobase/ut/libut.a ../innobase/os/libos.a ../inno base/ut/libut.a ../myisam/libmyisam.a ../myisammrg/libmyisammrg.a ../heap/ libheap.a ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a ../regex/lib regex.a ../strings/libmystrings.a -lz -lwrap
Re: Problem linking MySQL 4.1.11 via FreeBSD 4.10 ports
On Tue, Apr 19, 2005 at 02:02:39PM -1000, Clifton Royston wrote: When I try to make the current port of the MySQL 4.1 server under FreeBSD 4.10, I get a huge stream of undefined reference errors at the link step for mysqld. More factoids - the same error continues to happen: * After rebuilding libtool 1.5.10 to make sure it's OK, as suggested to me offlist. * After rebuilding the linuxthreads port to make sure the library is OK. * After trying the same with MySQL 4.0 (mysql40-server) to make sure it's not a ports problem specific to 4.1. I started doing a bunch of find ... | xargs grep 'mutex_enter_func' and the like for the undefined symbols, and it appears that at least some of the problematic functions I'm looking at are defined internal to MySQL's libraries, and are intended to be inlined. However clearly they can't be succeeding, or they wouldn't be showing up as external references to the link phase. The function mutex_enter_func and some similar ones, for instance, are defined in files with a .ic extension - C files with heavy inlining of assembler - and they are defined with type UNIV_INLINE. In innobase/include/univ.i this shows up thus: #if (!defined(UNIV_DEBUG) !defined(INSIDE_HA_INNOBASE_CC) !defined(UNIV_MUST_NOT_INLINE)) /* Definition for inline version */ #ifdef __WIN__ #define UNIV_INLINE __inline #else /* config.h contains the right def for 'inline' for the current compiler */ #if (__GNUC__ == 2) #define UNIV_INLINE extern inline #else /* extern inline doesn't work with gcc 3.0.2 */ #define UNIV_INLINE static inline #endif #endif #else /* If we want to compile a noninlined version we use the following macro definitions: */ #define UNIV_NONINL #define UNIV_INLINE #endif /* UNIV_DEBUG */ ... so I can see that gcc 2.95 and gcc 3.3 would be handled quite differently by these conditional defines. I am starting to think this might be a toolchain issue, where the ports have gotten out of sync with what the default build environment is for 4.1. Can anyone please verify for me that the mysql40-server and/or mysql41-server ports actually *do* build under gcc 2.95.4 as installed on a fresh-out-of-box 4.x system? I'd really rather not have to upgrade the compiler toolchain just to build this port. -- Clifton -- Clifton Royston -- [EMAIL PROTECTED] Tiki Technologies Lead Programmer/Software Architect I'm gonna tell my son to grow up pretty as the grass is green And whip-smart as the English Channel's wide... -- 'Whip-Smart', Liz Phair ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Problem linking MySQL 4.1.11 via FreeBSD 4.10 ports
On Tue, Apr 19, 2005 at 05:22:29PM -1000, Clifton Royston wrote: ... so I can see that gcc 2.95 and gcc 3.3 would be handled quite differently by these conditional defines. I am starting to think this might be a toolchain issue, where the ports have gotten out of sync with what the default build environment is for 4.1. Can anyone please verify for me that the mysql40-server and/or mysql41-server ports actually *do* build under gcc 2.95.4 as installed on a fresh-out-of-box 4.x system? I'd really rather not have to upgrade the compiler toolchain just to build this port. ... Oops, I hate to follow up to myself, but there were a couple rather confusing typos and wording problems in the last few paragraphs. What I meant to say first, is that it seems to me this might be a toolchain problem, in that the ports may not be specifying the *extra* build requirements needed to build them starting from the default build environment for FreeBSD 4.x? ( Not for 4.1!) And last, I meant to say I'd rather not upgrade the compiler unless *necessary* to get MySQL running - I will if I have to. I have seen a number of people post about running MySQL on FreeBSD, though, and I haven't seen any mention that it's now necessary to upgrade GCC first, so I am still puzzled why I seem to be the only one running into this. -- Clifton -- Clifton Royston -- [EMAIL PROTECTED] Tiki Technologies Lead Programmer/Software Architect I'm gonna tell my son to grow up pretty as the grass is green And whip-smart as the English Channel's wide... -- 'Whip-Smart', Liz Phair ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]