Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#27378 closed defect (fixed)

lua dlopen error @5.1.4

Reported by: anddam (Andrea D'Amore) Owned by: pmq@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: lua dlopen dyld malloc Cc: patrick@…
Port: lua

Description

lua 5.1.4 use of DL_DYLD raises malloc error when loading lua packages, cf. this issue and this one.

lua should use POSIX dlopen rather than DL_DYLD, cf. point 2 of this message and this solution.

Also lua is building an ar archive rather than a Mach-O dylib.

I'm attaching a patch from the message above, I used -install_name @executable_path/../lib/liblua5.1.dylib when linking lua executable to replace the explicit /usr/local/lib, this should be fine with mp image activation.

After rebuilding the port with attached patch, otool -L $(which lua) correctly shows liblua while it didn't before and the modules I've tested are not having the malloc error anymore.

Interesting enough lua50 has support for dylib, you may want to follow the existing patch way that only affects main Makefile.

Attachments (1)

patch-lua-dlopen.diff (2.7 KB) - added by anddam (Andrea D'Amore) 13 years ago.

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by anddam (Andrea D'Amore)

Attachment: patch-lua-dlopen.diff added

comment:1 Changed 13 years ago by patrick@…

Cc: patrick@… added

Cc Me!

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

There was already a separate ticket requesting a lua dylib: #18402.

The patch attached here has the version number hardcoded in many places; this will make port updates tedious. Can you restrict hardcoding the version number to a single variable, and then use that variable everywhere? Even better would be to write the patches with "@VERSION@" placeholders, and to reinplace that placeholder with the actual version in the portfile, so that no updates to the version number in the makefile will be needed at all in the future.

comment:3 in reply to:  2 Changed 13 years ago by anddam (Andrea D'Amore)

Resolution: fixed
Status: newclosed

Replying to ryandesign@…:

Can you restrict hardcoding the version number to a single variable, and then use that variable everywhere? Even better would be to write the patches with "@VERSION@" placeholders, and to reinplace that placeholder with the actual version in the portfile

Yes I can. I went with reinplace and committed in r76094.

Closing this ticket and #18402

comment:4 Changed 13 years ago by anddam (Andrea D'Amore)

Not closing #18402 as fixed, it asks for both static and dynamic library, this patch only builds dylib.

comment:5 Changed 13 years ago by m.thon@…

The install_name needs to be set to ${prefix}/lib/liblua5.1.dylib and not @executable_path... The current setting breaks everything that links to lua and does not sit in ${prefix}/*/.

I opened a new ticket #28726 for this.

Note: See TracTickets for help on using tickets.