liblua dependency missing, causing Perl Inline to fail

Bug #1454294 reported by Jari Turkia
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lua-bitop (Ubuntu)
New
Undecided
Unassigned

Bug Description

1) System info:
Description: Ubuntu 14.04.1 LTS
Release: 14.04

2) Package info:
lua-bitop:
  Installed: 1.0.2-2

3) Shared library dependencies for LUA 5.1-version:
$ ldd 5.1-bitop/bit.so
        linux-vdso.so.1 => (0x00007fffe4bfc000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f36f1bdc000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f36f21b7000)

Notice how liblua5.1.so is missing from the list. On a Perl-script running Inline::LUA following error message will be emitted:
"error: error loading module 'bit' from file '/usr/lib/x86_64-linux-gnu/lua/5.1/bit.so':
        /usr/lib/x86_64-linux-gnu/lua/5.1/bit.so: undefined symbol: lua_gettop"

Info: Perl doesn't use LUA 5.2 in it's bindings, only LUA 5.1.

4) Build warnings gone, Perl-script working:
dpkg-shlibdeps: warning: symbol lua_gettop used by debian/lua-bitop/usr/lib/x86_64-linux-gnu/liblua5.1-bitop.so.0.0.0 found in none of the libraries

5) This is what I'd like to happen:
$ ldd /usr/lib/x86_64-linux-gnu/liblua5.1-bitop.so.0.0.0
        liblua5.1.so.0 => /usr/lib/x86_64-linux-gnu/liblua5.1.so.0 (0x00007fdc61c2d000)

I managed to manually build a library with linker options:
CLIB_CFLAGS=-Wl,--no-as-needed -llua5.1
and that fixes the issue.

Revision history for this message
Jari Turkia (jari-e) wrote :

This is affecting Ubuntu 16 also.

Here is a proof of failure:
#!/usr/bin/perl -w --

use strict;
use warnings;
use Inline;

# Sample LUA-code
my $lua = <<END_OF_CODE
require('bit')
require('math')

function lua_bitop_tester()
  test_vars = {}
  test_vars['bitmap'] = 1

  print(bit.band(test_vars['bitmap'], bit.lshift(1, 0)))
  print(tonumber((bit.band(test_vars['bitmap'], bit.lshift(1, 0))) or 0) > 0)
end
END_OF_CODE
;

# Introduce the lua_bitop_tester() function into Perl-world
Inline->bind( Lua => $lua );

# Call LUA-code
lua_bitop_tester();

# Should output
#1
#true
# ... if working correctly
# Will output:
# error: error loading module 'bit' from file '/usr/lib/x86_64-linux-gnu/lua/5.1/bit.so':
# ... when using Ubuntu package

That piece of Perl-code will fail with default package and run successfully when rebuilt with proper dynamic dependencies.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.