Re: [PHP-DEV] [PATCH] OCI8 link failure (Tru64/AIX) (#22324)
Attached is patch for ext/oci8/config.m4, please try it out. --Jani On Tue, 11 Mar 2003, Michael Mauch wrote: Jani Taskinen [EMAIL PROTECTED] wrote: I still don't think we should be linking with libocijdbc8 in any case. Can you ask some Oracle support why their libs differ with same version but in different OSes?? I can try to do so [1], although I don't see what that will buy us. From Oracle9i Administrator's Reference http://download-east.oracle.com/docs/html/A97297_01/ch4_comp.htm#i26133, chapter 4, Using Oracle Precompilers and the Oracle Call Interface: | Custom Make Files | | Oracle Corporation recommends that you use the provided demo_product.mk | make files to create user programs as described in the specific product | sections of this chapter. | [...] | If you choose to use a make utility such as nmake or GNU make, be aware | of how macro and suffix processing differs from the make utility | provided with the platform. Oracle make files are tested and are | supported with the make utility for your platform. The demo_product.mk is in reality called demo_rdbms.mk - and of course it's virtually undocumented. | Oracle library names and the contents of Oracle libraries are subject to | change between releases. Always use the demo_product.mk make file that | ships with the current release as a guide to determine the required | libraries. Then they go on to explain their symfind utility, which is a shell script around find, grep and nm - with platform-specific output [2]. | Correcting Undefined Symbols (Solaris Only) | | Oracle provides the symfind utility to assist you in locating a library | or object file where a symbol is defined. When linking a program, | undefined symbols are a common error that produce an error message | similar to the following: IMHO this is totally unacceptable. If they can't provide a well-defined set of interface libraries, they should at least offer some kind of oci-config or a few text files with -lsomelib -lanotherlib lines. But no matter how hard we wish they had some such thing, they don't have it at the moment - and even if they would suddenly start to clean up that whole mess, it would probably take a long time until their patches would be installed everywhere. I still think that the best solution would be to check if linking with -lcntsh alone is enough to get OCILobIsTemporary, and if not, check if it works with -locijdbc8. Regards... Michael [1]: My question in the Oracle Technology Network forum has not been answered for two weeks now, ditto in comp.databases.oracle.misc. [2]: Symfind (or nm) finds the OCILobIsTemporary definition (T) not only in libocijdbc8.so, but also in libclntsh.so and a few other libs: OCILobIsTemporary| | U | 0008 ^^^ ./lib/libsql8.a OCILobIsTemporary| 0004396969863776 | T | 0008 ^^^ ./lib/libnjni8.so OCILobIsTemporary| 5408 | T | 0008 ^^^ ./lib/libclient8.a OCILobIsTemporary| 5408 | T | 0008 OCILobIsTemporary| | U | 0008 ^^^ ./lib/libclntst8.a OCILobIsTemporary| 0004396969227952 | T | 0008 ^^^ ./lib/libocijdbc8.so OCILobIsTemporary| 0004396962545744 | T | 0008 ^^^ ./lib/libocijdbc8_g.so OCILobIsTemporary| | U | 0008 ^^^ ./lib/libsqlplus.a OCILobIsTemporary| | U | 0008 ^^^ ./lib/libordim8.a OCILobIsTemporary| 0004396966909952 | T | 0008 ^^^ ./lib/libclntsh.so This is on the Compaq/HP test drive with Tru64 5.1 and Oracle 8.1.7. -- - For Sale! - Index: config.m4 === RCS file: /repository/php4/ext/oci8/config.m4,v retrieving revision 1.37.2.3 diff -u -r1.37.2.3 config.m4 --- config.m4 25 Feb 2003 04:37:08 - 1.37.2.3 +++ config.m4 23 Mar 2003 01:17:41 - @@ -88,14 +88,7 @@ 8.1) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - -dnl This breaks build on some systems (AIX at least). -dnl if test -f $OCI8_DIR/lib/libocijdbc8.so ; then -dnl PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) -dnl fi - PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD) - AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) dnl @@ -106,14 +99,7 @@ 9.0) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) - -dnl This breaks build on some systems (AIX at least) -dnl if test -f $OCI8_DIR/lib/libocijdbc8.so
Re: [PHP-DEV] [PATCH] OCI8 link failure (Tru64/AIX) (#22324)
Jani Taskinen [EMAIL PROTECTED] wrote: I still don't think we should be linking with libocijdbc8 in any case. Can you ask some Oracle support why their libs differ with same version but in different OSes?? I can try to do so [1], although I don't see what that will buy us. From Oracle9i Administrator's Reference http://download-east.oracle.com/docs/html/A97297_01/ch4_comp.htm#i26133, chapter 4, Using Oracle Precompilers and the Oracle Call Interface: | Custom Make Files | | Oracle Corporation recommends that you use the provided demo_product.mk | make files to create user programs as described in the specific product | sections of this chapter. | [...] | If you choose to use a make utility such as nmake or GNU make, be aware | of how macro and suffix processing differs from the make utility | provided with the platform. Oracle make files are tested and are | supported with the make utility for your platform. The demo_product.mk is in reality called demo_rdbms.mk - and of course it's virtually undocumented. | Oracle library names and the contents of Oracle libraries are subject to | change between releases. Always use the demo_product.mk make file that | ships with the current release as a guide to determine the required | libraries. Then they go on to explain their symfind utility, which is a shell script around find, grep and nm - with platform-specific output [2]. | Correcting Undefined Symbols (Solaris Only) | | Oracle provides the symfind utility to assist you in locating a library | or object file where a symbol is defined. When linking a program, | undefined symbols are a common error that produce an error message | similar to the following: IMHO this is totally unacceptable. If they can't provide a well-defined set of interface libraries, they should at least offer some kind of oci-config or a few text files with -lsomelib -lanotherlib lines. But no matter how hard we wish they had some such thing, they don't have it at the moment - and even if they would suddenly start to clean up that whole mess, it would probably take a long time until their patches would be installed everywhere. I still think that the best solution would be to check if linking with -lcntsh alone is enough to get OCILobIsTemporary, and if not, check if it works with -locijdbc8. Regards... Michael [1]: My question in the Oracle Technology Network forum has not been answered for two weeks now, ditto in comp.databases.oracle.misc. [2]: Symfind (or nm) finds the OCILobIsTemporary definition (T) not only in libocijdbc8.so, but also in libclntsh.so and a few other libs: OCILobIsTemporary| | U | 0008 ^^^ ./lib/libsql8.a OCILobIsTemporary| 0004396969863776 | T | 0008 ^^^ ./lib/libnjni8.so OCILobIsTemporary| 5408 | T | 0008 ^^^ ./lib/libclient8.a OCILobIsTemporary| 5408 | T | 0008 OCILobIsTemporary| | U | 0008 ^^^ ./lib/libclntst8.a OCILobIsTemporary| 0004396969227952 | T | 0008 ^^^ ./lib/libocijdbc8.so OCILobIsTemporary| 0004396962545744 | T | 0008 ^^^ ./lib/libocijdbc8_g.so OCILobIsTemporary| | U | 0008 ^^^ ./lib/libsqlplus.a OCILobIsTemporary| | U | 0008 ^^^ ./lib/libordim8.a OCILobIsTemporary| 0004396966909952 | T | 0008 ^^^ ./lib/libclntsh.so This is on the Compaq/HP test drive with Tru64 5.1 and Oracle 8.1.7. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] OCI8 link failure (Tru64/AIX) (#22324)
I still think that the best solution would be to check if linking with -lcntsh alone is enough to get OCILobIsTemporary, and if not, check if it works with -locijdbc8. i think that makes sense. re, tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] OCI8 link failure (Tru64/AIX) (#22324)
I still don't think we should be linking with libocijdbc8 in any case. Can you ask some Oracle support why their libs differ with same version but in different OSes?? --Jani On Sat, 8 Mar 2003, Michael Mauch wrote: Hi, this is a repost of my article from Monday, 03 March. Perhaps it has gone unnoticed because of the discussion about OnUpdateInt()? If it was noticed, but the patch just sucks, please say so. My older patch for the link problems with OCI8 on Tru64 broke the build on AIX and maybe other systems, so Jani commented it out. Here comes a better patch. Instead of just linking to libocijdbc8/9 if it is available, it tries to find the OCILobIsTemporary function in the normal libclntsh first, and does nothing if it's there. Only if OCILobIsTemporary is not in libclntsh, another check is done to search it in libocijdbc8/9. I tested it on Linux with Oracle 8.1.6, Tru64 with 8.1.6, 8.1.7 and 9.0.1, and made sure that libocijdb8/9 is linked only when necessary. The patch is not yet tested on AIX, though. I'll ask the two people who reported bug #22324 after the patch has been applied (or should I ask them before the patch is applied, and send them the new configure and main/php_config.h.in built here?). Just before posting this, I became aware that at least here (Linux, Oracle 8.1.6), the line AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) results in a core dump at startup, if I use --with-oci8=shared. This is a separate problem (#22521), it also happens without my patch. Setting OCI_USE_EMALLOC to 1 in oci8.c doesn't change it. Regards... Michael Index: ext/oci8/config.m4 === RCS file: /repository/php4/ext/oci8/config.m4,v retrieving revision 1.37.2.3 diff -u -B -b -r1.37.2.3 config.m4 --- ext/oci8/config.m4 25 Feb 2003 04:37:08 - 1.37.2.3 +++ ext/oci8/config.m4 3 Mar 2003 20:45:03 - @@ -89,14 +89,20 @@ 8.1) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) -dnl This breaks build on some systems (AIX at least). -dnl if test -f $OCI8_DIR/lib/libocijdbc8.so ; then -dnl PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) -dnl fi - PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD) + + php_save=$LDFLAGS + LDFLAGS=-L$OCI8_DIR/lib $LDFLAGS + AC_CHECK_LIB(clntsh, OCILobIsTemporary, [ ], [ +AC_CHECK_LIB(ocijdbc8, OCILobIsTemporary, [ + PHP_ADD_LIBRARY_WITH_PATH(ocijdbc8, $OCI8_DIR/lib, OCI8_SHARED_LIBADD) +], [ ]) + ]) + LDFLAGS=$php_save + AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) - AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) + + dnl AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) dnl dnl OCI_ATTR_STATEMENT is not available in all 8.1.x versions @@ -107,12 +113,17 @@ 9.0) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) -dnl This breaks build on some systems (AIX at least) -dnl if test -f $OCI8_DIR/lib/libocijdbc8.so ; then -dnl PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) -dnl fi - PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD) + + php_save=$LDFLAGS + LDFLAGS=-L$OCI8_DIR/lib $LDFLAGS + AC_CHECK_LIB(clntsh, OCILobIsTemporary, [ ], [ +AC_CHECK_LIB(ocijdbc9, OCILobIsTemporary, [ + PHP_ADD_LIBRARY_WITH_PATH(ocijdbc9, $OCI8_DIR/lib, OCI8_SHARED_LIBADD) +], [ ]) + ]) + LDFLAGS=$php_save + AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) -- - For Sale! - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] OCI8 link failure (Tru64/AIX) (#22324)
Hi, this is a repost of my article from Monday, 03 March. Perhaps it has gone unnoticed because of the discussion about OnUpdateInt()? If it was noticed, but the patch just sucks, please say so. My older patch for the link problems with OCI8 on Tru64 broke the build on AIX and maybe other systems, so Jani commented it out. Here comes a better patch. Instead of just linking to libocijdbc8/9 if it is available, it tries to find the OCILobIsTemporary function in the normal libclntsh first, and does nothing if it's there. Only if OCILobIsTemporary is not in libclntsh, another check is done to search it in libocijdbc8/9. I tested it on Linux with Oracle 8.1.6, Tru64 with 8.1.6, 8.1.7 and 9.0.1, and made sure that libocijdb8/9 is linked only when necessary. The patch is not yet tested on AIX, though. I'll ask the two people who reported bug #22324 after the patch has been applied (or should I ask them before the patch is applied, and send them the new configure and main/php_config.h.in built here?). Just before posting this, I became aware that at least here (Linux, Oracle 8.1.6), the line AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) results in a core dump at startup, if I use --with-oci8=shared. This is a separate problem (#22521), it also happens without my patch. Setting OCI_USE_EMALLOC to 1 in oci8.c doesn't change it. Regards... Michael Index: ext/oci8/config.m4 === RCS file: /repository/php4/ext/oci8/config.m4,v retrieving revision 1.37.2.3 diff -u -B -b -r1.37.2.3 config.m4 --- ext/oci8/config.m4 25 Feb 2003 04:37:08 - 1.37.2.3 +++ ext/oci8/config.m4 3 Mar 2003 20:45:03 - @@ -89,14 +89,20 @@ 8.1) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) -dnl This breaks build on some systems (AIX at least). -dnl if test -f $OCI8_DIR/lib/libocijdbc8.so ; then -dnl PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) -dnl fi - PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD) + + php_save=$LDFLAGS + LDFLAGS=-L$OCI8_DIR/lib $LDFLAGS + AC_CHECK_LIB(clntsh, OCILobIsTemporary, [ ], [ +AC_CHECK_LIB(ocijdbc8, OCILobIsTemporary, [ + PHP_ADD_LIBRARY_WITH_PATH(ocijdbc8, $OCI8_DIR/lib, OCI8_SHARED_LIBADD) +], [ ]) + ]) + LDFLAGS=$php_save + AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) - AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) + + dnl AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) dnl dnl OCI_ATTR_STATEMENT is not available in all 8.1.x versions @@ -107,12 +113,17 @@ 9.0) PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD) -dnl This breaks build on some systems (AIX at least) -dnl if test -f $OCI8_DIR/lib/libocijdbc8.so ; then -dnl PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD) -dnl fi - PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD) + + php_save=$LDFLAGS + LDFLAGS=-L$OCI8_DIR/lib $LDFLAGS + AC_CHECK_LIB(clntsh, OCILobIsTemporary, [ ], [ +AC_CHECK_LIB(ocijdbc9, OCILobIsTemporary, [ + PHP_ADD_LIBRARY_WITH_PATH(ocijdbc9, $OCI8_DIR/lib, OCI8_SHARED_LIBADD) +], [ ]) + ]) + LDFLAGS=$php_save + AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ]) AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ]) AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ]) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php