Opened 20 years ago

Closed 19 years ago

#2972 closed defect (fixed)

BUG: OpenSSL makefile error

Reported by: pubnelle@… Owned by: mww@…
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc: mww@…, voorhees@…, daniel+dp@…
Port:

Description

The aim was to obtain php5 running with apache2, mysql, postgresql, and gd. When starting Apache2, we got the following error : Syntax error on line 275 of /opt/local/apache2/conf/httpd.conf: Cannot load /opt/local/apache2/modules/libphp5.so into server: dyld: /opt/local/apache2/bin/httpd version mismatch for library: /opt/local/lib/libssl.0.9.7.dylib (compatibility version of user: 0.9.7 greater than library's version: 0.9.0)\n

We found out that the problem comes from an error in the Makefile.org in the OpenSSL dist files, at the lines defining the compatibility.

-compatibility_version ${SHLIB_MAJOR}.echo ${SHLIB_MINOR} | cut -d. -f1 \

we replaced it by :

-compatibility_version 0.9.7 \

between the "extract" and the "configure" step, and it's working.

Attachments (1)

compat-version.patch (1.2 KB) - added by daniel+dp@… 20 years ago.
Make compatibility version more specific

Download all attachments as: .zip

Change History (21)

comment:1 Changed 20 years ago by mww@…

Owner: changed from darwinports-bugs@… to ssen@…

assign to port maintainer

comment:2 Changed 20 years ago by ssen@…

Resolution: worksforme
Status: newclosed

It's not a bug with OpenSSL. You're running a program that is linked against multiple version of openssl (either directly or indirectly). Apple's OpenSSL is compatibility 0.9.7, so parts of apache's dependency tree are linked against that, and parts are linked against DP's OpenSSL

I suggest deleting your DP tree, explicitly installing the OpenSSL port, and then install apache 2 and its dependencies.

comment:3 Changed 20 years ago by pubnelle@…

I started from scratch, I spent a whole day determing the dependencies of everything, building one step after another, again and again. Twice, I deleted everything in the DP tree (clean --all each of the ports that were installed!), took the latest CVS for Ports and for DarwinPort, and this version of OpenSSL is the only one, so if one of the intermediate software in the tree is linked to the wrong openssl, it is in your distribution. But in fact, the error message I got is hinting to a bug in the MakeFile.org, I did not have this idea out of nothing. It's not apache2 but php5 that made the error message to appear (when not loading the php5 module, apache2 was running fine). Please test and tell me if starting from scratch you don't have the problem (if the dist files of OpenSSL did not change since Saturday ...)? Here running an Xserve box, Mc OSX server 10.3.9.

comment:4 Changed 20 years ago by edko@…

Resolution: worksforme
Status: closedreopened

comment:5 Changed 20 years ago by edko@…

Status: reopenednew

comment:6 Changed 20 years ago by edko@…

(In reply to comment #3)

I also have a 10.3.9 machine which apparently does not compile openssl correctly. The package compiles and installs correctly, but when I try to use other darwinport packages which try to depend on this openssl, then I get the dyld errors.

I have done the following research:

  1. I found an old openssl bug report describing Nelle's problems and resolution

http://www.mail-archive.com/openssl-dev@openssl.org/msg16791.html

  1. I did a 'port patch openssl' and verified the Makefile.org file had the original line

' -compatibility_version ${SHLIB_MAJOR}.echo ${SHLIB_MINOR} | cut -d. -f1 \'

at line 326 or so.

  1. I did the following at the command line to see what happens and I appear to validate

that the original openssl bug is still not fixed

$ export SHLIB_MAJOR=0 $export SHLIB_MINOR=9.7 $ ${SHLIB_MAJOR}.echo ${SHLIB_MINOR} | cut -d. -f1

bash: 0.9: command not found

Now I admit there might be a certain machine configuration issue here that happened to manifest itself on both my machine and Nelle's machine, but I have no idea what or how it happened.

I would propose seeing what the openssl community has come up with regard to their bug #796. In the meantime, I can think of two ways of addressing this...

  1. Issue a patch against Makefile.org making the change the openssl bug report suggests (and what

Nelle tested)

  1. Make a deicision to leave the port as is, but somehow get word out to other darwinports users who

might see this problem occur?

I apologize for reopening this bug, but I'm really at a loss as what the root cause might be, and I'm concerned other darwinport users MIGHT compile openssl and have problems without realizing it. I guess I feel it'll be best if we somehow get the word out.

Then again, maybe it really just affects only two darwinport users??? :-{

Thanks,

ed

comment:7 Changed 20 years ago by pubnelle@…

Hi Ed, I couldn't believe that this old openssl bug was not corrected, and I assumed that it had been introducted again in a latest version, or that something in the latest version of mc os x server interperted wrongly the makefile lines, I don't know. btw we have been testing the configuration these last two days, Apache, PHP, MySQL, and everything is fine, so ... Maybe to be really sure nobody will install all this in the meantime and have big problems, issue that simple even if rude patch, while waiting for openssl to react.

Thanks again, Nelle

comment:8 Changed 20 years ago by mww@…

Cc: mww@… added

is there a reason that Apples libssl sets compatibility to v0.9.7?

$ otool -L /usr/lib/libssl.dylib /usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)

$ otool -L /opt/local/lib/libssl.dylib /opt/local/lib/libssl.0.9.7.dylib (compatibility version 0.9.0, current version 0.9.7)

comment:9 Changed 20 years ago by edko@…

(In reply to comment #6)

is there a reason that Apples libssl sets compatibility to v0.9.7?

I'm not sure... but if they changed the Makefile.org file as the old openssl bug suggests as a fix, then I believe the compatibility version will be forced to 0.9.7?

Sorry, I'm not sure.

ed

comment:10 Changed 20 years ago by mww@…

Summary: OpenSSL makefile errorBUG: OpenSSL makefile error

Changed 20 years ago by daniel+dp@…

Attachment: compat-version.patch added

Make compatibility version more specific

comment:11 Changed 20 years ago by daniel+dp@…

Cc: daniel+dp@… added

comment:12 Changed 20 years ago by daniel+dp@…

If I follow the links, I find:

/opt/local/apache2/modules/libphp5.so /usr/lib/libiodbc.2.dylib /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ColorSync.framework/Versions/A/ColorSync /usr/lib/libcrypto.0.9.7.dylib

It appears that there is no iodbc package in DP, so it seems that there is no way to solve this problem by just building packages in the right order. I'm not clear on whether this would be considered a bug in php5 or in openssl.

(I read about this on the mailing list, but I can't find the post now.)

I think my earlier point (comment #8) stands, though.

comment:13 Changed 19 years ago by ken.collins@…

So is there a fix for this. I am new to DP and I have the following ports installed. My goal is to get Apache2 with PHP4.3.10 but I cannot get past this error when starting apache.

apache2 2.0.53_1 (active) apr 0.9.6_0 (active) apr-util 0.9.6_0 (active) DarwinPortsStartup 1.1_0 (active) db4 4.2.52_0 (active) expat 1.95.8_1 (active) freetype 2.1.9_1 (active) gettext 0.14.3_1 (active) ImageMagick 6.2.0-6_0 (active) jpeg 6b_0 (active) libiconv 1.9.2_1 (active) libmcrypt 2.5.7_2 (active) libpng 1.2.8_1 (active) mhash 0.9.2_0 (active) openldap 2.2.23_1+ssl+tcpd (active) openssl 0.9.7g_0 (active) php4 4.3.10_0+apache2+macosx (active) sablotron 1.0.1_0 (active) tiff 3.7.1_0 (active) XFree86 4.3.0_2 zlib 1.2.2_1 (active)

comment:14 Changed 19 years ago by ken.collins@…

Specifically, this is the error that I get:

Failed to start apache : Syntax error on line 275 of /opt/local/apache2/conf/httpd.conf: Cannot load /opt/local/apache2/modules/libphp4.so into server: Library not loaded: /usr/lib/libcrypto. 0.9.7.dylib\n Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ Frameworks/ColorSync.framework/Versions/A/ColorSync\n Reason: Incompatible library version: ColorSync requires version 0.9.7 or later, but libcrypto.0.9.7.dylib provides version 0.9.0

comment:15 Changed 19 years ago by ken.collins@…

I deleted my packages for openssl and then deleted the and reinstalled dports directories, then I resynced the dpots directories with mine. But for the life of me I do not know how to apply this patch. I read as much as I could of the FM and I'm just a newbie at this, so I manually went into my "Portfile" and Patch-Makefile.org" to make the changes, I did it line by line and when I went to install openssl with DP, this is waht I get. Can someone tellme how to use the patch above or can the author simply just fix the file so that I can easy sync to them?

Error: Target com.apple.patch returned: shell command "cd "/opt/local/var/db/dports/build/ file._opt_local_var_db_dports_sources_rsync.rsync.opendarwin.org_dpupdate_dports_devel_openssl/ work/openssl-0.9.7g" && patch -p0 < "/opt/local/var/db/dports/sources/ rsync.rsync.opendarwin.org_dpupdate_dports/devel/openssl/files/patch-Makefile.org"" returned error 2 Command output: patching file Makefile.org patch: malformed patch at line 12: libs="-lbasename $$i${SHLIB_EXT} .dylib $$libs"; \

comment:16 Changed 19 years ago by daniel+dp@…

I believe I built it by doing this:

$ cp -R /opt/local/var/db/dports/sources/rsync.rsync.opendarwin.org_dpupdate_dports/devel/ openssl ~ $ cd ~ $ patch -p0 <Desktop/compat-version.patch.txt patching file openssl/Portfile patching file openssl/files/patch-Makefile.org $ cd openssl $ sudo port install

Of course, your darwinport path and path to the patch may be different.

I'm not sure that building a new version of openssl like this is a good idea, but it seems to have worked for me. I suspect that if I needed to rebuild openssl it might become problematic.

comment:17 Changed 19 years ago by mww@…

Owner: changed from ssen@… to mww@…

the new openssl version 0.9.8 dylibs carry version 0.9.8 for both compat & current; does this solve this problem?

comment:18 Changed 19 years ago by mww@…

Cc: voorhees@… added

comment:19 Changed 19 years ago by mww@…

* Bug 3842 has been marked as a duplicate of this bug. *

comment:20 Changed 19 years ago by mww@…

Resolution: fixed
Status: newclosed

assuming this problem has been solved by openssl 0.9.8;

Note: See TracTickets for help on using tickets.