Bug 193884 - Review Request: tolua++ - A tool to integrate C/C++ code with Lua
Review Request: tolua++ - A tool to integrate C/C++ code with Lua
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Hans de Goede
Fedora Package Reviews List
:
Depends On:
Blocks: FE-ACCEPT 193342
  Show dependency treegraph
 
Reported: 2006-06-02 13:42 EDT by Ian Chapman
Modified: 2014-12-15 08:16 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-06-04 20:37:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
limburgher: fedora‑cvs+


Attachments (Terms of Use)

  None (edit)
Description Ian Chapman 2006-06-02 13:42:00 EDT
Spec URL: http://dribble.org.uk/tolua++.spec
SRPM URL: http://dribble.org.uk/tolua++-1.0.92-1.iss.src.rpm
Description:

tolua++ is an extended version of tolua, a tool to integrate C/C++ code with
Lua. tolua++ includes new features oriented to c++
Comment 1 Hans de Goede 2006-06-02 15:19:22 EDT
MUST:
=====
* rpmlint output is:
W: tolua++ no-soname /usr/lib64/libtolua++-5.1.so
W: tolua++-devel no-documentation
The no-soname warning must be fixed (see below) the other one is no problem
* Package and spec file named appropriately
* Packaged according to packaging guidelines
* License (Freeware) ok, license file included (but see should fix)
* spec file is legible and in Am. English.
* Source matches upstream
* Compiles and builds on devel-x86_64
* BR: ok
* No locales
* ldconfig properly run for shared libraries
* Not relocatable
* Package owns / or requires all dirs
* No duplicate files & Permissions ok
* %clean & macro usage OK
* Contains code only
* %doc does not affect runtime, and isn't large enough to warrent a sub package
* -devel package as needed (see should fix though)
* no gui -> no .desktop file required


MUST fix:
=========
* The rpmlint soname warning, you can fix this by adding:
 "LINKFLAGS="-Wl,-soname,lib%{solib}.so"

Should fix:
===========
* Replace "License: Freeware Style" with just "License: Freeware"
* The tolua++ binary is a parser/compiler only used when building tolua++
 using programs as such it belongs in the -devel subpackage IMHO.

Remarks:
========
* "BuildRequires:  lua-devel => 5.1" shouldn't that be:
  "BuildRequires:  lua-devel >= 5.1" I'm surprised this even works?
Comment 2 Ian Chapman 2006-06-02 17:02:18 EDT
Thanks a lot, this should fix all those issues.

Spec URL: http://dribble.org.uk/tolua++.spec
SRPM URL: http://dribble.org.uk/tolua++-1.0.92-2.src.rpm
Comment 3 Hans de Goede 2006-06-03 02:54:52 EDT
Looks good, approved!

One remark though, my soname fix also adds an ELF SONAME tag to the tolua++
executable. I don't think this can do harm and I don't know enough scons to fix
it, so lets leave it this way for now. But this is not how things should be.
Comment 4 Ian Chapman 2006-06-03 09:51:45 EDT
In a future release it might be possible to patch the build process so scons
doesn't actually link the executable but is handled outside of scons, although
this sort of thing can get quite messy.
Comment 5 Ian Chapman 2006-06-03 17:37:05 EDT
Just noticed Hans, those link flags DO break tolua++. I'm currently
investigating a fix, but it appears to be because the exe has the same 'soname'
as the library.

With those link flags, do an ldd on the tolua++ binary, you get:

        linux-gate.so.1 =>  (0x004df000)
        liblua-5.1.so => /usr/lib/liblua-5.1.so (0x0063c000)
        libdl.so.2 => /lib/libdl.so.2 (0x00111000)
        libm.so.6 => /lib/libm.so.6 (0x00115000)
        libc.so.6 => /lib/libc.so.6 (0x004fe000)
        /lib/ld-linux.so.2 (0x004e0000)

Strange I thought, it isn't dynamically linked to libtolua++-5.1.so. Checking
the build, it certainly does link it to this library so why isn't it showing. I
checked the exe and if you try and do anything useful with it you get:

tolua++: symbol lookup error: tolua++: undefined symbol: tolua_open

which sort of confirms that ld isn't dynamically linking it. Now if you remove
those LINK flags rebuild and do an ldd, you get:

        linux-gate.so.1 =>  (0x004df000)
        libtolua++-5.1.so => /usr/lib/libtolua++-5.1.so (0x00200000)
        liblua-5.1.so => /usr/lib/liblua-5.1.so (0x0067a000)
        libdl.so.2 => /lib/libdl.so.2 (0x00650000)
        libm.so.6 => /lib/libm.so.6 (0x00629000)
        libc.so.6 => /lib/libc.so.6 (0x004fe000)
        /lib/ld-linux.so.2 (0x004e0000)

Notice, libtolua++-5.1.so shows this time?

I think because ld is using the 'soname', it already discovers this 'soname' in
the exe itself, so it assumes the appropriate library has been found and doesn't
look any further. Without the LINK flags, neither the exe nor the library has an
'soname' so ld falls back to the library name, ie libtolua++-5.1.so and finds
it. Somehow I need to get scons to use the soname for the library only. What do
you think?
Comment 6 Hans de Goede 2006-06-03 17:39:47 EDT
(In reply to comment #5)
> Somehow I need to get scons to use the soname for the library only. What do
> you think?

I agree, setting status back to FE-REVIEW in the mean time.
Comment 7 Ian Chapman 2006-06-03 18:41:07 EDT
This version applies an soname to the lib, whilst ensuring the binary doesn't
get one. It's a somewhat ugly hack, calling gcc again after the main build, to
compile the binary but the result is good. I've been sofar unable to patch the
scons package to use separate flags for the lib and bin, whatever I do they both
end up using the same flags :-). Perhaps this is acceptable enough (in the
meantime).

http://dribble.org.uk/tolua++.spec
http://dribble.org.uk/tolua++-1.0.92-3.src.rpm
Comment 8 Hans de Goede 2006-06-04 01:04:55 EDT
Looks good, its only one line in the specfile, I've seen far worse hacks.
Approving again.
Comment 9 Tim Niemueller 2010-11-05 17:15:44 EDT
Package Change Request
======================
Package Name: tolua++
New Branches: el5 el6
Owners: timn

I'm the Fedora maintainer and would like to import this package into RHEL because another package relies on it. Works fine on a local CentOS 5.4 machine.
Comment 10 Jason Tibbitts 2010-11-05 17:41:14 EDT
Git done (by process-git-requests).
Comment 11 Mosaab Alzoubi 2014-12-14 10:03:15 EST
Package Change Request
======================
Package Name: tolua++
New Branches: epel7
Owners: moceap timn
Comment 12 Jon Ciesla 2014-12-15 08:16:10 EST
Git done (by process-git-requests).

Note You need to log in before you can comment on or make changes to this bug.