[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Bug in BSD/UNIX Makefiles
- From: Matthias Andree <mandree@...>
- Date: Sun, 06 Jan 2013 18:53:47 +0100
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.
Details on the bug are at:
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
 As-needed useful pointers, besides the GNU ld manual page:
Description: OpenPGP digital signature