Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 284946 - >=dev-db/mysql-5.0.83 does not build with <sys-devel/gcc-4
Summary: >=dev-db/mysql-5.0.83 does not build with <sys-devel/gcc-4
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-14 15:18 UTC by Emmanuel Andry
Modified: 2010-04-01 20:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Andry 2009-09-14 15:18:20 UTC
In file included from ./include/dict0mem.h:23,                                                                        
                 from ./include/dict0dict.h:14,                                                                       
                 from ./include/btr0btr.h:14,                                                                         
                 from btr/btr0btr.c:9:                                                                                
./include/sync0rw.h:425:2: #error HAVE_ATOMIC_BUILTINS is not defined. Do you use enough new GCC or compatibles?      
./include/sync0rw.h:426:2: #error Or do you use exact options for CFLAGS?                                             
./include/sync0rw.h:427:2: #error e.g. (for x86_32): "-m32 -march=i586 -mtune=i686"                                   
./include/sync0rw.h:428:2: #error e.g. (for Sparc_64): "-m64 -mcpu=v9"                                                
./include/sync0rw.h:429:2: #error Otherwise, this build may be slower than normal version.                            
In file included from ./include/dict0mem.h:23,                                                                        
                 from ./include/dict0dict.h:14,                                                                       
                 from ./include/btr0cur.h:13,                                                                         
                 from btr/btr0cur.c:20:                                                                               
./include/sync0rw.h:425:2: #error HAVE_ATOMIC_BUILTINS is not defined. Do you use enough new GCC or compatibles?      
./include/sync0rw.h:426:2: #error Or do you use exact options for CFLAGS?                                             
./include/sync0rw.h:427:2: #error e.g. (for x86_32): "-m32 -march=i586 -mtune=i686"                                   
./include/sync0rw.h:428:2: #error e.g. (for Sparc_64): "-m64 -mcpu=v9"                                                
./include/sync0rw.h:429:2: #error Otherwise, this build may be slower than normal version.                            
In file included from ./include/dict0mem.h:23,                                                                        
                 from ./include/dict0dict.h:14,                                                                       
                 from ./include/btr0pcur.h:13,                                                                        
                 from btr/btr0pcur.c:9:                                                                               
./include/sync0rw.h:425:2: #error HAVE_ATOMIC_BUILTINS is not defined. Do you use enough new GCC or compatibles?      
./include/sync0rw.h:426:2: #error Or do you use exact options for CFLAGS?                                             
./include/sync0rw.h:427:2: #error e.g. (for x86_32): "-m32 -march=i586 -mtune=i686"                                   
./include/sync0rw.h:428:2: #error e.g. (for Sparc_64): "-m64 -mcpu=v9"                                                
./include/sync0rw.h:429:2: #error Otherwise, this build may be slower than normal version.                            
make[3]: *** [btr0pcur.lo] Error 1                                                                                    
make[3]: *** Waiting for unfinished jobs....                                                                          
make[3]: *** [btr0cur.lo] Error 1                                                                                     
make[3]: *** [btr0btr.lo] Error 1                                                                                     
make[3]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.84-r1/work/mysql/innobase'                              
make[2]: *** [all] Error 2                                                                                            
make[2]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.84-r1/work/mysql/innobase'                              
make[1]: *** [all-recursive] Error 1                                                                                  
make[1]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.84-r1/work/mysql'                                       
make: *** [all] Error 2                                                                                               
 *                                                                                                                    
 * ERROR: dev-db/mysql-5.0.84-r1 failed.                                                                              
 * Call stack:                                                                                                        
 *               ebuild.sh, line   49:  Called src_compile                                                            
 *             environment, line 4055:  Called mysql_src_compile                                                      
 *             environment, line 3588:  Called die                                                                    
 * The specific snippet of code:                                                                                      
 *       emake || die "emake failed";                                                                                 
 *  The die message:                                                                                                  
 *   emake failed                                                                                                     
 *                                                                                                                    
 * If you need support, post the topmost build error, and the call stack if relevant.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.0.84-r1/temp/environment'.
 *

>>> Failed to emerge dev-db/mysql-5.0.84-r1

 * Messages for package dev-db/mysql-5.0.84-r1:

 * MySQL MY_DATADIR is /var/lib/mysql
 * MySQL datadir found in /var/lib/mysql
 * A new one will not be created.
 *
 * ERROR: dev-db/mysql-5.0.84-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4055:  Called mysql_src_compile
 *             environment, line 3588:  Called die
 * The specific snippet of code:
 *       emake || die "emake failed";
 *  The die message:
 *   emake failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.0.84-r1/temp/environment'.




# emerge --info mysql                                                                          
Portage 2.1.6.13 (selinux/2007.0/x86/hardened, gcc-3.4.6, glibc-2.9_p20081201-r3, 2.6.28-hardened-r7 i686)
=================================================================                                         
                        System Settings                                                                   
=================================================================                                         
System uname: Linux-2.6.28-hardened-r7-i686-Intel-R-_Xeon-TM-_CPU_2.66GHz-with-gentoo-2.0.1               
Timestamp of tree: Mon, 14 Sep 2009 12:30:01 +0000                                                        
app-shells/bash:     4.0_p33                                                                              
dev-lang/python:     2.6.2-r1, 3.1.1                                                                      
sys-apps/baselayout: 2.0.1                                                                                
sys-apps/openrc:     0.4.3-r3                                                                             
sys-apps/sandbox:    2.1                                                                                  
sys-devel/autoconf:  2.63-r1                                                                              
sys-devel/automake:  1.10.2, 1.11                                                                         
sys-devel/binutils:  2.19.1-r1                                                                            
sys-devel/gcc-config: 1.4.1                                                                               
sys-devel/libtool:   2.2.6a                                                                               
virtual/os-headers:  2.6.30-r1                                                                            
ACCEPT_KEYWORDS="x86 ~x86"                                                                                
CBUILD="i686-pc-linux-gnu"                                                                                
CFLAGS="-O2 -march=pentium4 -mtune=pentium4 -pipe -fomit-frame-pointer"                                   
CHOST="i686-pc-linux-gnu"                                                                                 
CONFIG_PROTECT="/etc"                                                                                     
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"                                                                                                        
CXXFLAGS="-O2 -march=pentium4 -mtune=pentium4 -pipe -fomit-frame-pointer"                                             
DISTDIR="/usr/portage/distfiles"                                                                                      
FEATURES="distlocks fixpackages loadpolicy parallel-fetch protect-owned sandbox selinux sesandbox sfperms strict unmerge-orphans userfetch"                                                                                                 
GENTOO_MIRRORS="ftp://mirror.ovh.net/gentoo-distfiles/ "                                                              
LDFLAGS="-Wl,-O1"                                                                                                     
LINGUAS="fr"                                                                                                          
MAKEOPTS="-j3"                                                                                                        
PKGDIR="/usr/portage/packages"                                                                                        
PORTAGE_CONFIGROOT="/"                                                                                                
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"                                              
PORTAGE_TMPDIR="/var/tmp"                                                                                             
PORTDIR="/usr/portage"                                                                                                
SYNC="rsync://rsync.gentoo.org/gentoo-portage"                                                                        
USE="acl acpi ads apache2 audit bash-completion berkdb bzip2 cgi chdir cli contentcache cracklib crypt ctype curl dri expat fortran ftp gd gmp graphite hardened iconv imap innodb ipv6 isdnlog ithreads json kerberos latin1 ldap memlimit mudflap mysql ncurses nls nptl openmp pam pcre perl php pic posix pppd python readline reflection selinux session spl ssl suhosin svg symlink tcpd threads unicode x86 xml xorg xsl zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

=================================================================
                        Package Settings
=================================================================

dev-db/mysql-5.0.70-r1 was built with the following:
USE="berkdb latin1 perl (selinux) ssl -big-tables -cluster -debug -embedded -extraengine -max-idx-128 -minimal -static"
CFLAGS="-O2 -march=pentium4 -mtune=pentium4 -pipe -DHAVE_ERRNO_AS_DEFINE=1 -fno-stack-protector-all -fno-strict-aliasing"
CXXFLAGS="-O2 -march=pentium4 -mtune=pentium4 -pipe -DHAVE_ERRNO_AS_DEFINE=1 -fno-stack-protector-all -fno-exceptions -fno-strict-aliasing -felide-constructors -fno-rtti -fno-implicit-templates -fno-strict-aliasing"





Reproducible: Always
Comment 1 Gordon Malm (RETIRED) gentoo-dev 2009-09-14 16:17:21 UTC
Seen this some months ago.  It's some defines they changed up in mysql 5.1.x series, looks like they've made their way back to mysql-5.0.x series.  Not sure if simply changing up the defines is safe or good enough though and didn't bother to test.  If I recall I just installed ~arch hardened gcc and built it with that instead.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-09-14 20:18:58 UTC
hardened/gengor:
Even with the defines changed, there's some other code I don't trust in newer versions of MySQL with GCC3 anymore.

How close is hardened to having a stable GCC4?

I can state that the hardened GCC4 runs fine with MySQL, I'm using it on some infra production boxes.
Comment 3 Gordon Malm (RETIRED) gentoo-dev 2009-09-14 21:25:33 UTC
(In reply to comment #2)
> hardened/gengor:
> Even with the defines changed, there's some other code I don't trust in newer
> versions of MySQL with GCC3 anymore.
>

Yeah, that's what I recall seeing too.  Didn't bother to try to figure out a gcc-3.4-safe patch for it and also just used ~arch hardened gcc-4.3.x.  I doubt you're interested in such a venture either.

We're pretty close to stable-marked gcc-4.x on hardened.  Not sure exactly when, but think days and weeks, not months.

Assuming there's not a patch (and quick), the ebuilds should probably be adjusted to die gracefully if <gcc-4 is in use and inform the user to use a newer gcc.  If you're planning to stabilize >=dev-db/mysql{,-community}-5.0.83, please package.mask on hardened so stable users don't get bothered.  Otherwise it can remain unmasked and hardened users trying to compile with gcc-3.4.x will just hit the error.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-09-14 21:43:39 UTC
gengor:
I wouldn't be surprised to see a sec vuln soon for MySQL (again, a timescale of weeks), which will necessitate stabilization, and be hard to solve on hardened if masked.

What's still blocking gcc-4 from being stable for hardened?
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-10-05 00:59:01 UTC
deps updated.
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2009-10-10 22:30:14 UTC
(In reply to comment #5)
> deps updated.
> 

Not appropriate. sys-devel/gcc-apple works fine too. So, this change to protect hardened users just broke osx users.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-10-10 23:32:17 UTC
re-fixed for prefix now.

Also, selinux needs to update their hardened profiles to stop masking gcc-4 ASAP.
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-04-01 20:40:27 UTC
Just a long-term followup on this:
https://lists.launchpad.net/maria-discuss/msg00116.html

Followup on bug #284946, #293801, #310615, #307251: In 5.0.87, the mutex locking code was changed a lot again, so that while 5.0.84 required a newer GCC due to the HAVE_ATOMIC_BUILTINS error, newer releases do NOT need those GCC versions anymore. This also frees up ~hppa to do more stabilization.