MySQLTalk.org Forum Index MySQLTalk.org
MYSQL discussions groups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compile error of last version

 
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL Packagers
View previous topic :: View next topic  
Author Message
Mauro Sacchetto
Guest





PostPosted: Fri Dec 09, 2005 2:03 am    Post subject: Compile error of last version Reply with quote



I'm trying to compile mysql normal on a Slackware 10.2.
All seems to work fine in the first part of compilation,
but at the end I receive this error message:

===============================================
In file included from /usr/include/asm/atomic.h:6,
from ../include/my_global.h:309,
from mysys_priv.h:17,
from my_new.cc:22:
/usr/include/asm/processor.h: In function `void set_in_cr4(long unsigned
int)':
/usr/include/asm/processor.h:235: error: `read_cr4' undeclared (first use this
function)
/usr/include/asm/processor.h:235: error: (Each undeclared identifier is
reported only once for each function it appears in.)
/usr/include/asm/processor.h:237: error: `write_cr4' undeclared (first use
this
function)
/usr/include/asm/processor.h: In function `void clear_in_cr4(long unsigned
int)
':
/usr/include/asm/processor.h:246: error: `write_cr4' undeclared (first use
this
function)
make[1]: *** [my_new.o] Error 1
make[1]: Leaving directory `/tmp/mysql-5.0.16/mysys'
make: *** [install-recursive] Error 1
===============================================
I'm using a kernel 2.6.14.3. Any suggestion?
Thanx!

MS
Back to top
Lenz Grimmer
Guest





PostPosted: Fri Dec 09, 2005 5:12 pm    Post subject: Re: Compile error of last version Reply with quote



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On Thu, 8 Dec 2005, Mauro Sacchetto wrote:

Quote:
I'm trying to compile mysql normal on a Slackware 10.2. All seems to work
fine in the first part of compilation, but at the end I receive this error
message:

===============================================
In file included from /usr/include/asm/atomic.h:6,
from ../include/my_global.h:309,
from mysys_priv.h:17,
from my_new.cc:22:
/usr/include/asm/processor.h: In function `void set_in_cr4(long unsigned int)':
/usr/include/asm/processor.h:235: error: `read_cr4' undeclared (first use this function)
/usr/include/asm/processor.h:235: error: (Each undeclared identifier is reported only once for each function it appears in.)
/usr/include/asm/processor.h:237: error: `write_cr4' undeclared (first use this function)
/usr/include/asm/processor.h: In function `void clear_in_cr4(long unsigned int)':
/usr/include/asm/processor.h:246: error: `write_cr4' undeclared (first use this function)
make[1]: *** [my_new.o] Error 1
make[1]: Leaving directory `/tmp/mysql-5.0.16/mysys'
make: *** [install-recursive] Error 1
===============================================
I'm using a kernel 2.6.14.3. Any suggestion?

Strange, that looks like a bug in a header file. What configure options did you use?

Bye,
LenZ
- --
Lenz Grimmer <lenz (AT) mysql (DOT) com>
Community Relations - Europe
MySQL GmbH, http://www.mysql.de/, Hamburg, Germany
MySQL Users Conference 2006 (Santa Clara CA, 24-27 April) - http://www.mysqluc.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFDmbsgSVDhKrJykfIRAt2aAJ9xM4xFKX0f3fX2VHFHLkOm1Z9bbQCfcCuw
QBs31gmbvBoyWZwS1q6u8oA=
=wVZ0
-----END PGP SIGNATURE-----
Back to top
Mauro Sacchetto
Guest





PostPosted: Fri Dec 09, 2005 10:26 pm    Post subject: Re: Compile error of last version Reply with quote



Alle 18:12, venerd́ 9 dicembre 2005, Lenz Grimmer ha scritto:
Quote:
Strange, that looks like a bug in a header file. What configure options did
you use?

This one:

CFLAGS="-O2 -march=i486 -mcpu=i686" CXX=gcc CXXFLAGS="-O2 -march=i486
-mcpu=i686" ./configure \
--prefix=/usr \
--with-mysqld-user=mysql \
--with-unix-socket-path=/var/run/mysql/mysql.sock \
--localstatedir=/var/lib/mysql \
--enable-assembler \
--with-raid \
--without-debug \
--enable-thread-safe-client \
--without-bench \
--with-extra-charsets=complex \
--with-vio \
--with-openssl \
--program-prefix="" \
--program-suffix="" \
$ARCH-slackware-linux


Thanx for your attention

MS
Back to top
Mauro Sacchetto
Guest





PostPosted: Sat Dec 10, 2005 5:41 am    Post subject: Re: Compile error of last version Reply with quote

Alle 18:12, venerd́ 9 dicembre 2005, Lenz Grimmer ha scritto:
Quote:
I'm using a kernel 2.6.14.3. Any suggestion?

Strange, that looks like a bug in a header file. What configure options did
you use?

I made a try... Compilation not only with kernel 2.4,
but with kernel 2.6.13.4 too works fine.
So I really think it's a trouble with 2.6.14.3 headers...
Do u think I can write to kernel manteiners?

Thanx
MS
Back to top
Mauro Sacchetto
Guest





PostPosted: Sat Dec 10, 2005 5:46 pm    Post subject: Re: Compile error of last version Reply with quote

Alle 18:12, venerd́ 9 dicembre 2005, Lenz Grimmer ha scritto:
Quote:
Strange, that looks like a bug in a header file.

I communicate it to bugzilla. The kernel team replied:

======================================First of all, the kernel headers aren't directly usable for userspace, your
distribution should ship sane headers.

Additionally, last I checked MySQL abused atomic.h in a way it was never meant
to be used (for using the inline functions in userspace).
======================================
I compiled from myself the headers for the most recent kernel.
With 2.6.13 mysql compilation worls fine, with 2.6.14 no.
Please, consider if the problem is not of mysql itself...

Thanx
MS
Back to top
Tom Lane
Guest





PostPosted: Sat Dec 10, 2005 9:29 pm    Post subject: Re: Compile error of last version Reply with quote

Mauro Sacchetto <mauro.sacchetto (AT) alice (DOT) it> writes:
Quote:
I communicate it to bugzilla. The kernel team replied:
Additionally, last I checked MySQL abused atomic.h in a way it was never meant
to be used (for using the inline functions in userspace).

I compiled from myself the headers for the most recent kernel.
With 2.6.13 mysql compilation worls fine, with 2.6.14 no.
Please, consider if the problem is not of mysql itself...

The Red Hat distribution of mysql ran into this problem quite some time
ago: the "atomic add/sub" assembly code doesn't work on any of RH's
64-bit platforms. Fortunately there is a configure-driven option to not
use that code. We fix it by hacking configure.in (see attached patch,
which presumes that you run autoconf afterwards) but I suppose you could
also do it by modifying configure's output files. The patch was
generated against 4.1.x, as you can see, but it still applies to 5.0.x.

regards, tom lane


The idea of userland using <asm/atomic.h> has our kernel hackers all bent
out of shape, so don't do it. Suppressing this has another benefit too,
which is we avoid the 4-vs-8-byte problem in BDB that formerly required
mysql-threads.patch.


diff -Naur mysql-4.1.12.orig/configure.in mysql-4.1.12/configure.in
--- mysql-4.1.12.orig/configure.in 2005-05-13 07:32:33.000000000 -0400
+++ mysql-4.1.12/configure.in 2005-07-11 12:16:28.000000000 -0400
@@ -862,43 +862,6 @@
AC_SUBST(WRAPLIBS)

if test "$TARGET_LINUX" = "true"; then
- AC_MSG_CHECKING([for atomic operations])
-
- atom_ops=
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_add(5, &v);
- return atomic_read(&v) == 28 ? 0 : -1;
-}
- ],
- [AC_DEFINE([HAVE_ATOMIC_ADD], [1],
- [atomic_add() from <asm/atomic.h> (Linux only)])
- atom_ops="${atom_ops}atomic_add "],
- )
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_sub(5, &v);
- return atomic_read(&v) == 18 ? 0 : -1;
-}
- ],
- [AC_DEFINE([HAVE_ATOMIC_SUB], [1],
- [atomic_sub() from <asm/atomic.h> (Linux only)])
- atom_ops="${atom_ops}atomic_sub "],
- )
-
- if test -z "$atom_ops"; then atom_ops="no"; fi
- AC_MSG_RESULT($atom_ops)
-
AC_ARG_WITH(pstack,
[ --with-pstack Use the pstack backtrace library],
[ USE_PSTACK=$withval ],
Back to top
Lenz Grimmer
Guest





PostPosted: Mon Dec 12, 2005 1:41 pm    Post subject: Re: Compile error of last version Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On Sat, 10 Dec 2005, Tom Lane wrote:

Quote:
Mauro Sacchetto <mauro.sacchetto (AT) alice (DOT) it> writes:
I communicate it to bugzilla. The kernel team replied:
Additionally, last I checked MySQL abused atomic.h in a way it was never meant
to be used (for using the inline functions in userspace).

Could you please give me the related Bugzilla ID for reference?

Quote:
I compiled from myself the headers for the most recent kernel.
With 2.6.13 mysql compilation worls fine, with 2.6.14 no.
Please, consider if the problem is not of mysql itself...

It's a MySQL problem, related to the detection of atomic operations in
"configure".

Quote:
The Red Hat distribution of mysql ran into this problem quite some time
ago: the "atomic add/sub" assembly code doesn't work on any of RH's
64-bit platforms. Fortunately there is a configure-driven option to not
use that code. We fix it by hacking configure.in (see attached patch,
which presumes that you run autoconf afterwards) but I suppose you could
also do it by modifying configure's output files. The patch was
generated against 4.1.x, as you can see, but it still applies to 5.0.x.

Thanks! Could you please alert us about such issues via our bug database at
http://bugs.mysql.com/ in the future? That should make sure you don't have to
maintain such fixes by yourself forever and we don't have to trawl through all
vendors' SRPMs for useful patches :)

Quote:
The idea of userland using <asm/atomic.h> has our kernel hackers all bent
out of shape, so don't do it. Suppressing this has another benefit too,
which is we avoid the 4-vs-8-byte problem in BDB that formerly required
mysql-threads.patch.

Agreed, this is ugly. It seems like this particular issue was reported in
our Bugs DB already:

http://bugs.mysql.com/bug.php?id=13621
http://bugs.mysql.com/bug.php?id=15244

I will nudge our devs about this one again. Thanks for the reminder!

Bye,
LenZ
- --
Lenz Grimmer <lenz (AT) mysql (DOT) com>
Community Relations - Europe
MySQL GmbH, http://www.mysql.de/, Hamburg, Germany
MySQL Users Conference 2006 (Santa Clara CA, 24-27 April) - http://www.mysqluc.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFDnX3xSVDhKrJykfIRAl1nAJ4r9EzuCaCmwfZx08ckWmapGLcRhACfR/ls
1fJG28/3vobCepY98yo7iHY=
=La0C
-----END PGP SIGNATURE-----
Back to top
Lenz Grimmer
Guest





PostPosted: Mon Dec 12, 2005 1:49 pm    Post subject: Re: Compile error of last version Reply with quote

Back to top
Tom Lane
Guest





PostPosted: Tue Dec 13, 2005 3:07 am    Post subject: Re: Compile error of last version Reply with quote

Lenz Grimmer <lenz (AT) mysql (DOT) com> writes:
Quote:
Thanks! Could you please alert us about such issues via our bug database at
http://bugs.mysql.com/ in the future?

Here's something you might find interesting: latest gcc breaks mysql
in at least one place
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175462

regards, tom lane
Back to top
Lenz Grimmer
Guest





PostPosted: Tue Dec 13, 2005 7:57 am    Post subject: Re: Compile error of last version Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Tom,

On Mon, 12 Dec 2005, Tom Lane wrote:

Quote:
Here's something you might find interesting: latest gcc breaks mysql
in at least one place
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175462

Interesting, indeed! Thanks for the pointer, I will ask our devs to take
a look.

Bye,
LenZ
- --
Lenz Grimmer <lenz (AT) mysql (DOT) com>
Community Relations - Europe
MySQL GmbH, http://www.mysql.de/, Hamburg, Germany
MySQL Users Conference 2006 (Santa Clara CA, 24-27 April) - http://www.mysqluc.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFDnn7OSVDhKrJykfIRAkV4AJ9b0z8b7PLQpbJXeu/0+TU1rNrgmACfUxLu
F7B2XXH+nJn6lp3wmF6FEyU=
=c4/8
-----END PGP SIGNATURE-----
Back to top
Display posts from previous:   
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL Packagers All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.