PDA

View Full Version : ./build multiple symbol error minor fix



artichoke
02-26-2007, 05:33 AM
On a CentOS 4.4 system that has MySQL 4.1.22 rpms installed, i was encountering multiple symbol errors when './build all' tried to rebuild php. The problem was caused due to this version of MySQL containing its own versions of some functions that are already provided by mhash also. And the php Makefile has a symbol EXTRA_LIBS that mentions '-lz' a large number of times (when once should have been enough).

The following patch to the /usr/local/directadmin/customapache/build script let the build complete without errors:



===================================================================
RCS file: RCS/build,v
retrieving revision 1.1
diff -u -r1.1 build
--- build 2007/02/20 18:29:57 1.1
+++ build 2007/02/26 13:05:24
@@ -577,6 +577,10 @@

while
echo "Trying to make php..."
+
+ # Multiple symbol fix -- replace multiple -lz with just one. R.D.
+ perl -pi.bak -e '/^EXTRA_LIBS/ && s/\s+\-lz\b//g && s/$/ -lz/;' Makefile
+
do
{
C_INCLUDE_PATH=/usr/kerberos/include make



Rahul

DirectAdmin Support
02-26-2007, 03:25 PM
Hello,

Does this actually break the compile? Are you using any special compiler/linker that didn't come with the OS ... we have not had any other reports of this, hence I ask. If anyone else is experiencing, let us know.

John

artichoke
02-26-2007, 04:01 PM
This is a stock CentOS 4.0 system that after successive applications of "yum update" is now reporting itself (in /etc/issue) as CentOS 4.4. No foreign compiler/linker has been installed.

I am using php 4.4.5 as downloaded by "./build clean" followed by "./build update".

The "./build all" was definitely stopping with a load error when php was being rebuilt. This was due to duplicate symbols conflicting between libz that came with MySQL 4.1.22 and DirectAdmin's mhash 0.9.1. E.g., the adler32() function was showing as multiply defined.

The conflict was resolved by making sure that php-4.4.5/Makefile mentioned "-lz" only once in the definition of EXTRA_LIBS.

Rahul

artichoke
02-28-2007, 05:56 PM
Exactly the same problem was observed on a second machine, which started as CentOS 4.2 and reached Centos 4.4 after successive applications of "yum update". And the same fix worked.

Rahul

NVarra
03-05-2007, 11:49 AM
I'll confirm this on at least 2 machines.

One CentOS 3.8, and one CentOS 4.4

A "perl -pi.bak -e '/^EXTRA_LIBS/ && s/\s+\-lz\b//g && s/$/ -lz/;' Makefile" does the trick...

DirectAdmin Support
03-05-2007, 11:54 AM
Hello,

Added to the build script.

John

NVarra
03-05-2007, 11:55 AM
Egad that was fast! LOL


Thanks John. :)