Opened 19 years ago

Closed 16 years ago

Last modified 16 years ago

#4103 closed enhancement (worksforme)

BUG: Ruby incompatibility /w non-MP openssl

Reported by: purestorm@… Owned by: kimuraw (kimura wataru)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: ruby

Description (last modified by blb@…)

Hi.

I have just upgraded some packages (postgres, ruby, rb-postgres, openssl) and it seems that while they compile pretty smooth, there is a "dynamic linking" problem:

manuel@localhost 23:25:55 demo $> ruby script/server 
dyld: NSLinkModule() error
dyld: Symbol not found: _ENGINE_load_aep
  Referenced from: /opt/local/lib/ruby/1.8/powerpc-darwin8.2.0/openssl.bundle
  Expected in: flat namespace

Trace/BPT trap

I am not the only one experiencing this problem, seemingly, for I read in IRC (#darwinports on freenode) today:

[21:49] 	[NICKNAME]	having an issue with darwinports compiled version of ruby not executing...
[21:50] 	[NICKNAME]	dyld: NSLinkModule() error
[21:50] 	[NICKNAME]	dyld: Symbol not found: _ENGINE_load_aep
[21:50] 	[NICKNAME]	  Referenced from: /opt/local/lib/ruby/1.8/powerpc-darwin8.2.0/openssl.bundle

Attachments (2)

Portfile (1.9 KB) - added by purestorm@… 19 years ago.
Adding a patch to the Portfile of ruby.
patch-ext-openssl-ossl_engine.c (1.0 KB) - added by purestorm@… 19 years ago.
A crude hack to ruby that is a workaround to this bug.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 19 years ago by benwill@…

looks like ruby has some problems with openssl 0.9.8. issue #2 here looks to be highly relevant: http://www.mail-archive.com/openssl-dev@openssl.org/msg15904.html

but see also: http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-core/5399

comment:2 Changed 19 years ago by purestorm@…

http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-core/5399

This patch is already in the distribution, as far as I can see.

However, I can imagine, that the problem has to be fixed on the ruby side of things.

Changed 19 years ago by purestorm@…

Attachment: Portfile added

Adding a patch to the Portfile of ruby.

Changed 19 years ago by purestorm@…

A crude hack to ruby that is a workaround to this bug.

comment:3 Changed 19 years ago by mww@…

ok, I've just submitted the patch for ossl_engine.c - leaving this one open for now since this is a crude workaround and shouldn't be needed - in a perfect world(TM)

comment:4 Changed 19 years ago by mww@…

Summary: Ruby incompatibility with opensslBUG: Ruby incompatibility with openssl

comment:5 Changed 19 years ago by jberry@…

Resolution: fixed
Status: newclosed

Changing to status fixed.

comment:6 Changed 18 years ago by openmacnews@…

Resolution: fixed
Status: closedreopened
it's unclear to me whether this was purportedly 'fixed' in trunk, or in release (1.8.5?) ... still requires a workaround, as well as a fix to openssl links not being picked up.

as of 23 Sep 06,

building, ruby 1.8.5 "out-of-the-box" on osx 10.4.7 w/ external instance of openssl 0.9.8c,

though 'make' is successful, 'make install' dies (still?) @:

...
install -c -p -m 0644 ruby.1 /usr/local/man/man1/ruby.1
./miniruby ./ext/extmk.rb --dest-dir="" --make="make" --mflags="" --make-flags="" --extout=".ext" --extension  --extstatic  -- install
cp -r ./.ext/. /usr/local/ruby/lib/ruby/1.8
Generating RDoc documentation
./miniruby ./runruby.rb --extout=.ext -- "./bin/rdoc" --all --ri --op "/usr/local/ruby/share/ri/1.8/system" "."
dyld: NSLinkModule() error
dyld: Symbol not found: _ENGINE_load_aep
  Referenced from: /usr/ports/ruby-1.8.5/.ext/powerpc-darwin8.7.0/openssl.bundle
  Expected in: flat namespace


per earlier post, noting in:

	/usr/ports/ruby-1.8.5/ext/openssl/ossl_engine.c

the current check (@ ~ line#64) for:

	#ifndef OPENSSL_NO_STATIC_ENGINE

and, hence, adding to CPPFLAGS:

	-DOPENSSL_NO_STATIC_ENGINE

and, after 'make', despite:

	setenv LDFLAGS "-L/usr/local/lib -lreadline -L/usr/local/ssl/lib -lssl -lcrypto"
	setenv CPPGLAGS "-I/usr/local/include -I/usr/local/ssl/include -DOPENSSL_NO_STATIC_ENGINE"

this is still required to pick up external openssl:

	/usr/ports/ruby-1.8.5/ext/openssl/Makefile
	==========================================
	@82
	---	LIBS = $(LIBRUBYARG_SHARED) -lssl -lcrypto  -lpthread -ldl -lcrypt -lobjc
	+++	LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lcrypt -lobjc -L/usr/local/ssl/lib -lssl -lcrypto
	==========================================

then, a subsequent:

	% cd /usr/ports/ruby-1.8.5/ext/openssl
	% make clean
	% make
	% cd /usr/ports/ruby-1.8.5
	% rm -rf /usr/local/ruby
	% make install

finishes successfully:

	...
	Generating RI...
	
	Files:   494
	Classes: 1369
	Modules: 721
	Methods: 7750
	Elapsed: 758.811s
	%

and checking:

	% rehash
	% which ruby
		/usr/local/ruby/bin/ruby
	% ruby --version
		ruby 1.8.5 (2006-08-25) [powerpc-darwin8.7.0]

	% otool -L /usr/local/ruby/lib/ruby/1.8/powerpc-darwin8.5.0/openssl.bundle 
		/usr/local/ruby/lib/libruby.dylib (compatibility version 1.8.0, current version 1.8.5)
		/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.6)
		/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
		/usr/local/ssl/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
		/usr/local/ssl/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
		/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

	% otool -L /usr/local/ruby/bin/ruby
		/usr/local/lib/libreadline.5.1.dylib (compatibility version 5.0.0, current version 5.1.0)
		/usr/local/ssl/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
		/usr/local/ssl/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
		/usr/local/ruby/lib/libruby.dylib (compatibility version 1.8.0, current version 1.8.5)
		/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.6)
		/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
		/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

all, now, looks OK.

comment:7 Changed 18 years ago by openmacnews@…

as of 19 Jan 07, and ruby 1.8.5-p12, this is still an issue.

despite the LDFLAGS addition, it's still req'd to modify "ruby-1.8.5-p12/ext/openssl/Makefile", as above.

can this be checked/fixed?

comment:8 Changed 18 years ago by pipping@…

Milestone: Available Ports

comment:9 Changed 18 years ago by markd@…

Summary: BUG: Ruby incompatibility with opensslBUG: Ruby incompatibility /w non-MP openssl

comment:10 Changed 18 years ago by pipping@…

Milestone: Available PortsPort Bugs

comment:11 Changed 17 years ago by nox@…

Priority: ExpectedNormal
Type: defectenhancement
Version: 1.0

comment:12 Changed 16 years ago by dbevans (David B. Evans)

Description: modified (diff)
Owner: changed from macports-tickets@… to kimuraw@…
Port: ruby added
Status: reopenednew

Assigning to maintainer for resolution.

comment:13 Changed 16 years ago by kimuraw (kimura wataru)

I cannot reproduce the problem with current MacPorts ruby 1.8.7-p72_2.

  • ruby and libruby not linking openssl
  • extention module openssl.bundle linking ${prefix}/lib/libssl,libcrypt
% otool -L /opt/local/bin/ruby /opt/local/lib/libruby.1.8.7.dylib /opt/local/lib/ruby/1.8/i686-darwin9/openssl.bundle 
/opt/local/bin/ruby:
	/opt/local/lib/libruby.dylib (compatibility version 1.8.0, current version 1.8.7)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.1)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libruby.1.8.7.dylib:
	/opt/local/lib/libruby.dylib (compatibility version 1.8.0, current version 1.8.7)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.1)
/opt/local/lib/ruby/1.8/i686-darwin9/openssl.bundle:
	/opt/local/lib/libruby.dylib (compatibility version 1.8.0, current version 1.8.7)
	/opt/local/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
	/opt/local/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.1)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

comment:14 Changed 16 years ago by blb@…

Description: modified (diff)
Resolution: worksforme
Status: newclosed

Closing, looks good here as well, no response otherwise.

comment:15 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.