lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Greetings,

I am one of three maintainers for the FreeBSD "main" lua port, lang/lua.

I'd like to relay a subtle bug that was reported against the FreeBSD
port of Lua 5.1.5 and affected 5.2.1, too, and seek the Lua maintainers
out to fix it.

The issue is that liblua.so's linker command line does not specify that
liblua is to link against -lm. This can cause failures when liblua.so is
linked into an application on a system that is under an "ld --as-needed"
regime, for instance, Wireshark, EVEN IF the application mentions -lm.

This might also affect newer major Linux distributions (openSUSE,
Fedora, Debian/Ubuntu, but not currently Gentoo), and is a problem that,
while unfixed, may grow more painful over time, as more distros strive
to reduce dependencies/rebuilds and go for --as-needed solutions.[1]

Details on the bug are at:
<http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/174964>

The proposed - and for FreeBSD confirmed - fix is to add -lm to the
LDFLAGS, or to the linker command line.

Please change the Makefiles of all supported Lua branches to link
liblua.so against -lm.  That way, and application linked with -llua but
does not call maths functions by itself need not add -lm to the linker
command line.

Thank you.

[1] As-needed useful pointers, besides the GNU ld manual page:
<http://www.gentoo.org/proj/en/qa/asneeded.xml>
<http://www.bnikolic.co.uk/blog/gnu-ld-as-needed.html>

Best regards
Matthias Andree

Attachment: signature.asc
Description: OpenPGP digital signature