Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 168660 - sci-physics/root-5.14.00b compilation fails with mysql USE flag set and sys-kernel/linux-headers-2.6.20-r1
Summary: sci-physics/root-5.14.00b compilation fails with mysql USE flag set and sys-k...
Status: RESOLVED DUPLICATE of bug 168931
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Science Physics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-27 23:55 UTC by James Ausmus
Modified: 2007-03-02 02:38 UTC (History)
2 users (show)

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


Attachments
mysql-5.0.32-no-atomic.patch (mysql-5.0.32-no-atomic.patch,1.16 KB, patch)
2007-02-28 22:27 UTC, Peter Alfredsen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Ausmus 2007-02-27 23:55:11 UTC
The root compilation fails when sys-kernel/linux-headers-2.6.20-r1 is installed and the mysql USE flag is enabled with the following messages:


In file included from mysql/src/TMySQLServer.cxx:23:
/usr/include/mysql/my_global.h:318:24: error: asm/atomic.h: No such file or directory
bin/rmkdepend -R -foracle/src/TOracleResult.d -Y -w 1000 -- -pipe -Wall -m64 -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -I/usr/include/oracle/10.2.0.3/client -D__cplusplus -- oracle/src/TOracleResult.cxx
bin/rmkdepend -R -foracle/src/TOracleRow.d -Y -w 1000 -- -pipe -Wall -m64 -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -I/usr/include/oracle/10.2.0.3/client -D__cplusplus -- oracle/src/TOracleRow.cxx
make: *** [mysql/src/TMySQLServer.o] Error 1
make: *** Waiting for unfinished jobs....
g++ -march=athlon64 -O2 -pipe -funroll-loops -msse3 -pipe -Wall -m64 -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -I/usr/include/oracle/10.2.0.3/client -DUSEPCH -include precompile.h -o oracle/src/TOracleResult.o -c oracle/src/TOracleResult.cxx
g++ -march=athlon64 -O2 -pipe -funroll-loops -msse3 -pipe -Wall -m64 -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -I/usr/include/oracle/10.2.0.3/client -DUSEPCH -include precompile.h -o oracle/src/TOracleRow.o -c oracle/src/TOracleRow.cxx
rm utils/src/rootcint_tmp.cxx utils/src/RStl_tmp.cxx

!!! ERROR: sci-physics/root-5.14.00b failed.
Call stack:
  ebuild.sh, line 1614:   Called dyn_compile
  ebuild.sh, line 971:   Called qa_call 'src_compile'
  environment, line 3557:   Called src_compile
  root-5.14.00b.ebuild, line 119:   Called die


The sys-kernel/linux-headers-2.6.20-r1 package does not contain an asm/atomic.h file - however, sys-kernel/linux-headers-2.6.17 did - I'm not sure about intermediate versions

Reproducible: Always

Steps to Reproduce:
1. emerge =sys-kernel/linux-headers-2.6.20-r1
2. USE="mysql" emerge root
3. Wait for the breakage...
Comment 1 Peter Alfredsen (RETIRED) gentoo-dev 2007-02-28 14:34:33 UTC
This isn't actually a problem with root; it's a problem with mysql. mysql/my_global.h is the one that's including asm/atomic.h, not root. Please reassign.

To the reporter: Which version of mysql are you using?

Comment 2 Sébastien Fabbro (RETIRED) gentoo-dev 2007-02-28 14:44:04 UTC
Hi,

I cannot reproduce this.
Could you provide additional info, such as emerge --info and the mysql version
you have installed?

Thanks.
Comment 3 James Ausmus 2007-02-28 19:15:39 UTC
The MySQL version is 
dev-db/mysql-5.0.32  
built with USE="berkdb extraengine perl ssl -big-tables -cluster -debug -embedded -latin1 -max-idx-128 -minimal (-selinux) -static"

emerge --info:

Portage 2.1.2-r12 (default-linux/amd64/2006.1, gcc-4.1.2, glibc-2.5-r0, 2.6.18-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.18-gentoo-r1 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4400+
Gentoo Base System version 1.12.9
Timestamp of tree: Wed, 28 Feb 2007 10:01:01 +0000
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.20-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -funroll-loops -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/fax /usr/share/X11/xkb /usr/share/config /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=athlon64 -O2 -pipe -funroll-loops -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LINGUAS="en en_US"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-* --prune-empty-dirs"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="16bit-indices 3ds 64bit 7zip X Xaw3d a52 aac aalib accessibility acct acl acpi ada addbookmarks aiglx aio akode alias allegro alsa altenburgcards amarok amd64 amr animgif ansi ao aoss apache2 arj artworkextra asf async auctex audiofile automount autoreplace avahi avalon-framework avalon-logkit badval bash-completion battery bcmath bcp beagle berkdb bidi binfilter bitmap-fonts bittorrent bjam blas boo bookmarks boost branding bzip2 c3p0 cairo cal3d calendar caps cdaudio cddb cdinstall cdparanoia cdr cegui cg chipcard chm chroot cjk clearcase cli clisp connectionstatus contactnotes contrib cpudetection cpufreq cracklib crypt cscope css ctype cups curl curlwrappers custom-cflags cvs daap dbus demo deprecated devhelp device-mapper devil dga directfb discouraged diskio divx djvu dmi doc dom4j double-precision dri dtaus dts dv dvb dvd dvdr dvdread dvi editor eds elf elisp enca encode epydoc evo examples exif expat extraengine extrafilters fam fame fastbuild fat fbcon ffmpeg fftw fidonet firefox fits flac flatfile fmod fontconfig foomaticdb fortran fpx freetds frontendonly ftp fuse gadu galago gcj gcl gd gdbm gdl gedit geldkarte geoip geos ggi gif gimp ginac glade glib glitz glut glw gmath gmedia gml gmp gnokii gnome gnutls gphoto2 gpm gps graphviz groupwise gs gsm gstreamer gtk gtk2 gtkhtml gtp guile hacking hal hardware-carrier hash haskell hbci hdf hdf5 hfs highlight history hlapi hpn html ical iconv idl idn ieee1394 ifp ilbc imagemagick imap imlib inherit-graph inifile insecure-savers ipod ipv6 irc irda isdnlog ithreads itrax jack java java5 javamail javascript jbig jce jfs jikes jingle jms jmx jni jpeg jpeg2k jython kcal kde kdecards kdeenablefinal kdehiddenvisibility kerberos keyring kig-scripting kmid kqemu lame lapack largefile latex lcms ldap ldb lesstif lha libburn libcaca libedit libg++ libnotify libsexy libwww lirc live lm_sensors log4j logitech-mouse logrotate lua lzo mad matroska mdb memlimit metalink mgetty mhash midi mikmod mime ming mixer mjpeg mmap mng modplug module mono mopac7 motif mozbranding mozdevelop moznopango mp3 mp3rtp mpeg mpi mplayer mpm-threadpool mpqc mssql mt940 mtp muine musepack music musicbrainz mysql nas ncurses net netbeans netboot netcdf netjack netmeeting network networking new-clx new-login nextaw nfs nis njb nls nntp nowlistening nptl nptlonly nsplugin ntfs ntp numarray numeric oav objc objc++ objc-gc ocaml oci8 odbc ode odk offensive ofx ogdi ogg ole openal openbabel openexr opengl oracle oss pam pam_chroot pam_console pam_timestamp pango pascal pcmcia pcntl pcre pda pdf pdo perforce perl php physfs pike plotutils plugins png portaudio posix postgres povray ppds pppd preview-latex proteus pwdb pysolcards pyste python qdbm qhull qt3 qt3support qt4 quicktime quotas quotes rar rdesktop readline real realmedia recode reflection regex reiser4 reiserfs remix rhino rle root rpm rt2500pci rtc ruby samba sametime sasl sbcl scanner scenarios script sdl sensord serial serpentine server servletapi session sftp sharedext sharedmem simplexml skey slang slp smp sms sndfile snmp soap sockets socks5 sound sounds source sourceview sox speex spell spl sql sqlite sqlite3 srt ssl startup-notification staticsocket statistics streamripper subversion svg swat sysfs syslog sysvipc szip t1lib tcl tcltk tcpd tetex texteffect tga theora threads thunar-vfs tidy tiff timidity tk tntc tokenizer toolbar tordns totem translator transmitter truetype truetype-fonts tse3 type1-fonts unicode urandom usb utempter v4l v4l2 valgrind vcd vim vim-pager vim-syntax vim-with-x visualization voice vorbis wavpack webdav webpresence wifi winbind winpopup wireshark wlan wmf wmp workbench wxgtk1 wxwindows x264 xanim xbase xcb xcomposite xerces-c xext xforms xfs xine xinerama xml xmldoclet xmlreader xmlrpc xmlwriter xorg xpm xprint xscreensaver xskatcards xsl xtended xv xvid xvmc yahoo yaz yv12 zeroconf zip zippy zlib zrtp zvbi" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="synaptics evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" LIRC_DEVICES="serial" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Peter Alfredsen (RETIRED) gentoo-dev 2007-02-28 22:27:58 UTC
Created attachment 111630 [details, diff]
mysql-5.0.32-no-atomic.patch

I was unable to reproduce this with a newly emerged mysql and  USE="-* mysql" emerge -1v sci-physics/root
I've taken a look at mysql's configure.in file and it looks to me as if it will adapt itself to the linux-headers present at build time. There's a patch here:

http://svn.pardus.org.tr/pardus/devel/server/database/mysql/files/mysql-no-atomic.patch

Which I have adapted to mysql 5.0.32, attached. It disables atomic writes even for linux-headers that support it. This seems prudent to do as soon as possible, since arch will soon have linux-headers-2.6.20-r1, so we'll want as many as possible to have this patch when they upgrade.

I will test if it compiles when I have tested root once again with some other useflags. Others would be welcome to do this. Root is a huge package for an Athlon 2500+.

If you grep like this:
cat /usr/include/mysql/my_global.h|grep -A1 -B4 atom

#ifdef HAVE_ATOMIC_ADD
#define new my_arg_new
#define need_to_restore_new 1
C_MODE_START
#include <asm/atomic.h>
C_MODE_END

You will se what the patch does.

My conjecture so far, to summarize, is that to get this bug, the emerge order must have been like this:
emerge <linux-headers-2.6.20-r1
emerge dev-db/mysql
emerge =linux-headers-2.6.20-r1
USE="mysql" emerge sci-physics/root

The resolution for the reporter would be to emerge -1 dev-db/mysql; emerge sci-physics/root
Comment 5 Peter Alfredsen (RETIRED) gentoo-dev 2007-02-28 23:48:59 UTC
USE="-* mysql doc fftw ldap odbc opengl ssl ruby qt3 xml" emerge -1v sci-physics/root

Also succesful. Will try patch and mysql tomorrow when not so tired. Reporter, please try proposed resolution.
Comment 6 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-01 07:58:12 UTC
(In reply to comment #4)

> My conjecture so far, to summarize, is that to get this bug, the emerge order
> must have been like this:
> emerge <linux-headers-2.6.20-r1
> emerge dev-db/mysql
> emerge =linux-headers-2.6.20-r1
> USE="mysql" emerge sci-physics/root
 
That first linux-headers line should have been <=linux-headers-2.6.17-r2. That's the last time I see atomic.h in the linux-headers in our tree.
Comment 7 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-01 09:09:38 UTC
Hmm... Even with that emerge order, I couldn't replicate the problem.
This list message suggests that it may be limited to 64 bit platforms only:
http://lists.mysql.com/packagers/264
Either way, lkml says including atomic.h is a bad idea:
http://lkml.org/lkml/2006/7/10/417

Could someone with a x86_64  try to replicate this?
What I just did was:
emerge -1v =linux-headers-2.6.17-r2
emerge -1v =dev-db/mysql-5.0.32
emerge -1v =linux-headers-2.6.20-r1
USE="-* mysql" emerge -1v =sci-physics/root-5.14.00b
Comment 8 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-01 09:24:51 UTC
Reporter:
Please do:
grep -i have_atomic_add /usr/include/mysql/*

For reference, for me the output is:
loki elm # grep -i have_atomic_add /usr/include/mysql/*
/usr/include/mysql/my_config.h:/* #undef HAVE_ATOMIC_ADD */
/usr/include/mysql/my_global.h:#ifdef HAVE_ATOMIC_ADD
/usr/include/mysql/my_pthread.h:#ifdef HAVE_ATOMIC_ADD
/usr/include/mysql/my_pthread.h:#endif /* HAVE_ATOMIC_ADD */

Comment 9 James Ausmus 2007-03-01 20:39:36 UTC
OK, I think this one can be closed - it's most certainly *not* a root issue, it's an issue with the mysql build - I've opened a new bug (bug #168931) against dev-db/mysql-5.0.32 about this - you can see my detailed findings there, but the short'n'sweet of it is that if you already have a /usr/include/mysql/my_config.h file in existance, the mysql build will *not* replace that with the newly generated one, which means that, unless you rm that file, or unmerge mysql, you can't ever get rid of HAVE_ATOMIC_ADD once it's been created - unless you hand edit the file, of course.

Not sure what the proper bug status is it it's actually a bug somewhere else, so I'll let someone with more know-how than me change the status. ;)

Thanks much for your time and effort!

-James
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2007-03-02 02:38:52 UTC

*** This bug has been marked as a duplicate of bug 168931 ***