Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2005 17:22:29 -1000
From:      Clifton Royston <cliftonr@tikitechnologies.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Problem linking MySQL 4.1.11 via FreeBSD 4.10 ports
Message-ID:  <20050420032228.GG17236@tikitechnologies.com>
In-Reply-To: <20050420000238.GE17236@tikitechnologies.com>
References:  <20050420000238.GE17236@tikitechnologies.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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  --  cliftonr@tikitechnologies.com 
         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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050420032228.GG17236>