|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-22 21:37 UTC] jason at devrandom dot org
Not sure if this is a problem of my own making or not, but something I've been profoundly frustrated with. I'm running Redhat 8.0.92 (Phoebe - Beta) with Apache 2.0.44 (tried .43 as well) and MySQL. I run into what appears to be the same error whether I use --with-mysql=/path/to/mysql or leave it built with the internal MySQL access libraries.
When using the following build string:
./configure --with-apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql/ --with-gettext --with-zlib --enable-track-vars --enable-force-cgi-redirect
I get the following results:
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.
Inside config.log I see:
configure:47975: gcc -o conftest -g -O2
-L/opt/mysql//lib
conftest.c -lmysqlclient -lz -lcrypt -lresolv -lm -ldl -lnsl -lcrypt 1>&5
/opt/mysql//lib/libmysqlclient.a(my_malloc.o)(.text+0x28): In function `my_mallo
c':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_realloc.o)(.text+0x65): In function `my_real
loc':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_lib.o)(.text+0x2e1): In function `my_dir':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_lib.o)(.text+0x3d1): In function `my_stat':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_getwd.o)(.text+0x44): In function `my_getwd'
:
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_getwd.o)(.text+0xce): more undefined referen
ces to `errno' follow
collect2: ld returned 1 exit status
configure: failed program was:
#line 47964 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mysql_close();
int main() {
mysql_close()
; return 0; }
configure:48102: checking for mysql_error in -lmysqlclient
configure:48121: gcc -o conftest -g -O2
-L/usr/lib -L/opt/mysql//lib
-Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient -lz -lz -lcrypt -lresol
v -lm -ldl -lnsl -lcrypt 1>&5
/opt/mysql//lib/libmysqlclient.a(my_malloc.o)(.text+0x28): In function `my_mallo
c':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_realloc.o)(.text+0x65): In function `my_real
loc':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_lib.o)(.text+0x2e1): In function `my_dir':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_lib.o)(.text+0x3d1): In function `my_stat':
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_getwd.o)(.text+0x44): In function `my_getwd'
:
: undefined reference to `errno'
/opt/mysql//lib/libmysqlclient.a(my_getwd.o)(.text+0xce): more undefined referen
ces to `errno' follow
collect2: ld returned 1 exit status
configure: failed program was:
#line 48110 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mysql_error();
int main() {
mysql_error()
; return 0; }
If I build without the --with-mysql=/opt/mysql, the configure script completes correctly but during 'make' I get the following error:
ext/mysql/libmysql/my_tempnam.lo(.text+0x4c): In function `my_tempnam':
/home/downloads/web/php-4.3.0/ext/mysql/libmysql/my_tempnam.c:103: the use of `tempnam' is dangerous, better use `mkstemp'
ext/mysql/libmysql/my_lib.lo(.text+0x3d1): In function `my_dir':
/home/downloads/web/php-4.3.0/ext/mysql/libmysql/my_lib.c:169: undefined reference to `errno'
ext/mysql/libmysql/my_lib.lo(.text+0x5ef): In function `my_stat':
/home/downloads/web/php-4.3.0/ext/mysql/libmysql/my_lib.c:588: undefined reference to `errno'
ext/mysql/libmysql/my_malloc.lo(.text+0xde): In function `my_malloc':
/home/downloads/web/php-4.3.0/ext/mysql/libmysql/my_malloc.c:24: undefined reference to `errno'
ext/mysql/libmysql/my_realloc.lo(.text+0xd5): In function `my_realloc':
/home/downloads/web/php-4.3.0/ext/mysql/libmysql/my_realloc.c:44: undefined reference to `errno'
ext/mysql/libmysql/my_delete.lo(.text+0x86): In function `my_delete':
/home/downloads/web/php-4.3.0/ext/mysql/libmysql/my_delete.c:16: undefined reference to `errno'
ext/mysql/libmysql/my_tempnam.lo(.text+0x89):/home/downloads/web/php-4.3.0/ext/mysql/libmysql/my_tempnam.c:108: more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
As I said, I'm not sure if this isn't a problem with RH 8.0.92 but I've complied many other things succesfully. Please let me know if I can be of any help testing.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 14:00:02 2025 UTC |
It's not gcc, it's libc6 2.3.1-38; errno breaks quite a few packages at anything newer than 2.3.1-5 (standard 8.0?). Snapshot does not fix this, as this is a problem with the pre-packaged MySQL binaries and not PHP. Quick fix: grab the mysql 4.0.9 sources, patch using my patch at the end of this message and build/install it somewhere; you can still use their supplied binaries to run the actual mysql server, but you need a proper libmysqlclient to link PHP against. Then PHP 4.3.0 will build w/o incident. configure mysql as such: CFLAGS="-O2 -mcpu=pentiumpro" CXX=gcc CXXFLAGS="-O2 -mcpu=pentiumpro -felide-constructors" ./configure --prefix=/usr/src/mysql-4.0.9-gamma-libc6-2.3.1-6+ --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --without-innodb then use --with-mysql=../mysql-4.0.9-gamma-libc6-2.3.1-6+ for configuring PHP Patch: --- mysql-4.0.9-gamma.vanilla/bdb/examples_c/ex_thread.c Thu Jan 9 04:35:18 2003 +++ mysql-4.0.9-gamma/bdb/examples_c/ex_thread.c Wed Jan 29 02:29:03 2003 @@ -99,7 +99,8 @@ char *argv[]; { extern char *optarg; - extern int errno, optind; +/* extern int errno, optind; */ + extern optind; pthread_t *tids; int ch, i, ret; char *home; --- mysql-4.0.9-gamma.vanilla/include/my_sys.h Thu Jan 9 04:35:22 2003 +++ mysql-4.0.9-gamma/include/my_sys.h Wed Jan 29 02:30:12 2003 @@ -192,11 +192,7 @@ #endif #endif /* MSDOS */ -#ifdef HAVE_ERRNO_AS_DEFINE #include <errno.h> /* errno is a define */ -#else -extern int errno; /* declare errno */ -#endif extern const char ** NEAR my_errmsg[]; extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ --- mysql-4.0.9-gamma.vanilla/readline/bind.c Thu Jan 9 04:35:21 2003 +++ mysql-4.0.9-gamma/readline/bind.c Wed Jan 29 02:31:37 2003 @@ -45,10 +45,6 @@ #include <signal.h> #include <errno.h> -#if !defined (errno) -extern int errno; -#endif /* !errno */ - #include "posixstat.h" /* System-specific feature definitions and include files. */ --- mysql-4.0.9-gamma.vanilla/readline/complete.c Thu Jan 9 04:35:22 2003 +++ mysql-4.0.9-gamma/readline/complete.c Wed Jan 29 02:31:06 2003 @@ -44,9 +44,6 @@ #include <stdio.h> #include <errno.h> -#if !defined (errno) -extern int errno; -#endif /* !errno */ #include <pwd.h> #if !defined (HAVE_GETPW_DECLS) --- mysql-4.0.9-gamma.vanilla/readline/histfile.c Thu Jan 9 04:35:17 2003 +++ mysql-4.0.9-gamma/readline/histfile.c Wed Jan 29 02:31:24 2003 @@ -65,9 +65,6 @@ #endif /* !__EMX__ */ #include <errno.h> -#if !defined (errno) -extern int errno; -#endif /* !errno */ #include "history.h" #include "histlib.h" --- mysql-4.0.9-gamma.vanilla/readline/input.c Thu Jan 9 04:35:18 2003 +++ mysql-4.0.9-gamma/readline/input.c Wed Jan 29 02:31:50 2003 @@ -57,10 +57,6 @@ #include <stdio.h> #include <errno.h> -#if !defined (errno) -extern int errno; -#endif /* !errno */ - /* System-specific feature definitions and include files. */ #include "rldefs.h" --- mysql-4.0.9-gamma.vanilla/readline/rltty.c Thu Jan 9 04:35:17 2003 +++ mysql-4.0.9-gamma/readline/rltty.c Wed Jan 29 02:30:45 2003 @@ -44,10 +44,6 @@ #include "rltty.h" #include "readline.h" -#if !defined (errno) -extern int errno; -#endif /* !errno */ - extern int readline_echoing_p; extern int _rl_eof_char;