[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Compiling MySQL on amd64 (Success); Was: [LinuxThreads, NPTL]



On Thu, Oct 07, 2004 at 07:42:16AM +0200, Andreas Jochens wrote:
> On 04-Oct-06 17:53, Pete Harlan wrote:
> > Do you know how I can compile a program that requires LinuxThreads?
> > 
> > Specifically, when running "configure" from the mysql source from
> > mysql.com, it now fails with:
> > 
> >  checking "LinuxThreads"... "Not found"
> >  configure: error: This is a linux system and Linuxthreads was not
> >  found. On linux Linuxthreads should be used.  Please install Linuxthreads
> >  (or a new glibc) and try again.  See the Installation chapter in the
> >  Reference Manual for more information.
> 
> This is an upstream bug in mysql. I think this will be fixed upstream 
> soon.
> 
> In the meantime, please try the attached patch (which is against 
> mysql-dfsg-4.0.21).

Thank you for the patch.  I did finally manage to get a seemingly
stable MySQL on amd64.  Specifically, by converting from pure64 to
your gcc-3.4 repository.  Thank you for that too!

After patching the sources, MySQL failed on the pure64 (3.3) archive
whether compiled from upstream MySQL sources or Alioth sources, and
whether I used gcc-3.3 or gcc-3.4.

Compiling (with gcc-3.4) on the gcc-3.4 archive did the trick though.
Either some of your patches to the libs, or simply compiling those
libs with gcc-3.4, seems to have solved the problems I was seeing.

The problem I had been seeing was when I'd do a "make test" after a
"make", it would usually work.  But if I ran it over and over again in
a loop, some one or another of the 206 tests run by "make test" would
fail once every 15-20 times through the loop.  It was a different test
that would fail each time, and which iteration of the tests would fail
also seemed random.

This was reproducible on two separate machines, one of which has had
extensive memory testing, so I don't think it's dodgy hardware.

Compiling and running on a gcc-3.4-archive box ran rock solid, making
it through ~250 iterations of "make test" without an error before I
stopped it.

It gives me more faith in the gcc-3.4 archive for everything, since
the differences presumably are in one of the libraries used by MySQL.
Those would be:

	% ldd sql/mysqld
			librt.so.1 => /lib/librt.so.1
			libdl.so.2 => /lib/libdl.so.2
			libcrypt.so.1 => /lib/libcrypt.so.1
			libnsl.so.1 => /lib/libnsl.so.1
			libpthread.so.0 => /lib/libpthread.so.0
			libstdc++.so.6 => /usr/lib/libstdc++.so.6
			libm.so.6 => /lib/libm.so.6
			libgcc_s.so.1 => /lib/libgcc_s.so.1
			libc.so.6 => /lib/libc.so.6
			/lib/ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2
	%

So, thanks again for your work!

--Pete


PS: Andreas's MySQL upstream source patch for configuring MySQL on a
LinuxThreads-free NPTL system (e.g., Debian amd64):

diff -urN ../tmp-orig/mysql-dfsg-4.0.21/configure ./configure
--- ../tmp-orig/mysql-dfsg-4.0.21/configure	2004-10-01 14:22:20.900250208 +0200
+++ ./configure	2004-10-01 14:22:17.787723384 +0200
@@ -24953,18 +24953,10 @@
     else
       echo "$as_me:$LINENO: result: \"Not found\"" >&5
 echo "${ECHO_T}\"Not found\"" >&6
-      # If this is a linux machine we should barf
       if test "$IS_LINUX" = "true"
       then
-	{ { echo "$as_me:$LINENO: error: This is a linux system and Linuxthreads was not
-found. On linux Linuxthreads should be used.  Please install Linuxthreads
-(or a new glibc) and try again.  See the Installation chapter in the
-Reference Manual for more information." >&5
-echo "$as_me: error: This is a linux system and Linuxthreads was not
-found. On linux Linuxthreads should be used.  Please install Linuxthreads
-(or a new glibc) and try again.  See the Installation chapter in the
-Reference Manual for more information." >&2;}
-   { (exit 1); exit 1; }; }
+        # use nptl instead of linuxthreads
+        CFLAGS="$CFLAGS -DUSE_MUTEX_INSTEAD_OF_RW_LOCKS -DPTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP"
       else
 	echo "$as_me:$LINENO: checking \"DEC threads\"" >&5
 echo $ECHO_N "checking \"DEC threads\"... $ECHO_C" >&6
diff -urN ../tmp-orig/mysql-dfsg-4.0.21/configure.in ./configure.in
--- ../tmp-orig/mysql-dfsg-4.0.21/configure.in	2004-09-07 00:29:39.000000000 +0200
+++ ./configure.in	2004-10-01 14:22:10.295862320 +0200
@@ -1238,13 +1238,10 @@
       with_named_thread="-lpthread"
     else
       AC_MSG_RESULT("Not found")
-      # If this is a linux machine we should barf
       if test "$IS_LINUX" = "true"
       then
-	AC_MSG_ERROR([This is a linux system and Linuxthreads was not
-found. On linux Linuxthreads should be used.  Please install Linuxthreads
-(or a new glibc) and try again.  See the Installation chapter in the
-Reference Manual for more information.])
+        # use nptl instead of linuxthreads
+        CFLAGS="$CFLAGS -DUSE_MUTEX_INSTEAD_OF_RW_LOCKS -DPTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP"
       else
 	AC_MSG_CHECKING("DEC threads")
         if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a



Reply to: