Bug #42817 | Compilation error with latest MySQL 5.1 from BZR | ||
---|---|---|---|
Submitted: | 13 Feb 2009 7:14 | Modified: | 13 Apr 2009 23:33 |
Reporter: | Vasil Dimov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S1 (Critical) |
Version: | r2756 | OS: | FreeBSD (FreeBSD 7.1, gcc 4.2.1) |
Assigned to: | Kent Boortz | CPU Architecture: | Any |
[13 Feb 2009 7:14]
Vasil Dimov
[13 Feb 2009 8:21]
Valeriy Kravchuk
I can't repeat this with gcc 3.3.5 on Linux. The only difference in vi.c compilation string is additional -DUNIV_LINUX flag after -O3. So, looks like this problem is related to gcc 4.2.x somehow.
[16 Feb 2009 18:37]
MySQL Verification Team
I couldn't repeat on Fedora 10 64-bit too: gmake[1]: Entering directory `/home/miguel/bzr/mysql-5.1-plugin/win' gmake[1]: Nothing to be done for `all'. gmake[1]: Leaving directory `/home/miguel/bzr/mysql-5.1-plugin/win' [miguel@hegel mysql-5.1-plugin]$ bzr revno 2756 [miguel@hegel mysql-5.1-plugin]$ cat /etc/issue Fedora release 10 (Cambridge) Kernel \r on an \m (\l) [miguel@hegel mysql-5.1-plugin]$ gcc --version gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7) Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO
[19 Feb 2009 14:21]
Vasil Dimov
On FreeBSD __weak_reference is defined like this in /usr/include/sys/cdefs.h: #ifdef __STDC__ #define __weak_reference(sym,alias) \ __asm__(".weak " #alias); \ __asm__(".equ " #alias ", " #sym) ... #else #define __weak_reference(sym,alias) \ __asm__(".weak alias"); \ __asm__(".equ alias, sym") ... In MySQL's cmd-line-utils/libedit/vi.c: 917 #ifdef __weak_reference 918 extern char *get_alias_text(const char *) __weak_reference(get_alias_text); 919 #endif On a few Linux systems that I tried __weak_reference is not defined at all which explains why people do not get this compilation error on Linux. Assigning this to joro@ who seems to be the author of the changeset that added this code: revno: 1810.3826.4 committer: Georgi Kodinov <joro@sun.com> branch nick: B42433-5.0-bugteam timestamp: Tue 2009-02-10 14:39:14 +0200 message: From jperkin : Merge libedit 2.11 and related files, based on NetBSD CVS as of 2009/02/06 20:09:00.
[19 Feb 2009 14:27]
Vasil Dimov
On NetBSD __weak_reference is defined like: #if __GNUC_PREREQ__(4, 0) #define __weak_reference(sym) __attribute__((__weakref__)) #else #define __weak_reference(sym) ; __asm(".weak " _C_LABEL_STRING(#sym)) #endif see http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/cdefs_elf.h?rev=1.29.28.1&content-type=tex... So using __weak_reference() with a single argument is not portable.
[19 Feb 2009 14:39]
Georgi Kodinov
I was just pushing for jperkin :-). Re-assigned.
[23 Feb 2009 10:24]
Vasil Dimov
Here is a dummy patch to make this thing compile on FreeBSD: --- cut --- === modified file 'cmd-line-utils/libedit/vi.c' --- cmd-line-utils/libedit/vi.c 2009-02-10 12:39:14 +0000 +++ cmd-line-utils/libedit/vi.c 2009-02-23 10:19:44 +0000 @@ -914,14 +914,14 @@ * NB: posix implies that we should enter insert mode, however * this is against historical precedent... */ -#ifdef __weak_reference +#if defined(__weak_reference) && defined(__NetBSD__) extern char *get_alias_text(const char *) __weak_reference(get_alias_text); #endif protected el_action_t /*ARGSUSED*/ vi_alias(EditLine *el, int c) { -#ifdef __weak_reference +#if defined(__weak_reference) && defined(__NetBSD__) char alias_name[3]; char *alias_text; --- cut --- Note: I have only tested this on FreeBSD and it compiles, but: * it does not use the __weak_reference() macro on FreeBSD even though it is available (with 2 arguments) * I have not tested on NetBSD, I do not even know whether the symbol __NetBSD__ is defined on NetBSD This should be fixed before the next release because it breaks compilation on FreeBSD.
[9 Mar 2009 5:58]
Vasil Dimov
------------------------------------------------------------ revno: 2728.10.6 tags: mysql-5.1.32 author: kent.boortz@sun.com committer: MySQL Build Team <build@mysql.com> branch nick: mysql-5.1.32-release timestamp: Sat 2009-02-14 01:43:21 +0100 message: Disabled libedit use of '__weak_reference' on FreeBSD, doesn't compile modified: cmd-line-utils/libedit/vi.c
[16 Mar 2009 19:40]
Kent Boortz
This is corrected in 5.0.79 and 5.1.32
[13 Apr 2009 23:33]
Paul DuBois
Noted in 5.0.79, 5.1.32 changelogs. The use by libedit of the __weak_reference() macro caused compilation failure on FreeBSD.
[15 Jul 2009 21:39]
Steven Hartland
Same thing happens on cygwin 1.7