Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 260008 - incorrect libtool usage in dev-lang/lua-5.1
Summary: incorrect libtool usage in dev-lang/lua-5.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Matti Bickel (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-23 13:47 UTC by Michael Haubenwallner (RETIRED)
Modified: 2009-04-08 08:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch creating new lua-5.1-make-r1.patch and lua-5.1-make_static-r1.patch (lua-libtool.patch,4.35 KB, patch)
2009-02-23 13:49 UTC, Michael Haubenwallner (RETIRED)
Details | Diff
real diff between *-r0.patch and *-r1.patch (lua-libtool.diff,1.93 KB, patch)
2009-02-23 13:49 UTC, Michael Haubenwallner (RETIRED)
Details | Diff
patch for files used in lua-5.1.4-r1.ebuild (lua-5.1.4-r1.libtool.patch,3.17 KB, patch)
2009-03-26 13:13 UTC, Michael Haubenwallner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haubenwallner (RETIRED) gentoo-dev 2009-02-23 13:47:27 UTC
There are a few mistakes in libtool usage in lua-5.1-make.patch, which bite me in Prefix on AIX, because shared/static libraries are different there, although properly handled by libtool.

*) Why is 'liblua.a' explicitly installed in addition to 'liblua.la'?
AIX' shared libs are inside 'lib.a' - explicitly creating/installing 'lib.a' nukes the "shared library" (whatever this means on AIX).

And on Linux, libtool installs both shared and static library anyway.

*) Do not use '.o' with libtool, only use '.lo' - libtool knows best.
On AIX, libtool does not create "*.o", just ".libs/*.o" - even for static libraries (there's no difference between pic and non-pic).

*) '-Wl,-E' is not portable, use libtool's '-export-dynamic' flag instead.
We do/can not use GNU linker on AIX/others.
Comment 1 Michael Haubenwallner (RETIRED) gentoo-dev 2009-02-23 13:49:00 UTC
Created attachment 182888 [details, diff]
patch creating new lua-5.1-make-r1.patch and lua-5.1-make_static-r1.patch

The *-r1.patch files are to not break existing ebuilds also using same patchfiles.
Comment 2 Michael Haubenwallner (RETIRED) gentoo-dev 2009-02-23 13:49:30 UTC
Created attachment 182889 [details, diff]
real diff between *-r0.patch and *-r1.patch
Comment 3 Matti Bickel (RETIRED) gentoo-dev 2009-03-22 07:30:33 UTC
hmm, dunno why i haven't seen this bug. i have fixed the last two issues locally and will upload them shortly. Still thinking about implications of the first suggestion. But i hope i'll be able to release a 5.1.4-r1 pretty soon with your fixes in it. Thanks!
Comment 4 Matti Bickel (RETIRED) gentoo-dev 2009-03-22 09:28:33 UTC
Doh, my libtool foo is still very weak. I now discovered i could even remove the building of the static liblua.a and libtool will take care of that. I just didn't know that.

Well i guess you're right - libtool knows it best.
The reason for this complicated build process was that there was a request to build not only shared but static libs, too. So i obeyed and installed static libs alongside.

Please check lua-5.1.4-r1 which will be on the mirrors shortly.
Comment 5 Matti Bickel (RETIRED) gentoo-dev 2009-03-22 09:46:10 UTC
Just committed lua-5.1.4-r1. Let's see if it helps. If i failed at it, please reopen this bug.
Comment 6 Michael Haubenwallner (RETIRED) gentoo-dev 2009-03-26 13:01:24 UTC
Still doesn't work as expected on AIX.

Btw: Why is 'luac' linked statically regardless of 'static' useflag (which only applies to 'lua') ?
Comment 7 Michael Haubenwallner (RETIRED) gentoo-dev 2009-03-26 13:13:32 UTC
Created attachment 186317 [details, diff]
patch for files used in lua-5.1.4-r1.ebuild

On AIX, I do have these problems, described along the patch hunks:

Index: files/lua-5.1-make-r1.patch
Hunk 1:
Even if the make-target commands are overwritten, the dependencies still apply. But libtool does not create *.o in current directory, it just has .libs/*.o.
These single-line-hunks rename the existing targets, so they don't infer with the gentoo-added ones.
This also fixes that makefile-warnings 'overriding commands for target ...'.

Hunk 2:
Link '$(LIB_NAME)' instead of '-llua'. This isn't a problem per se (although I'm missing the '-L.'), but for consistency with the other binaries.

Hunk 3:
Building $(LIB_NAME) also creates the static library, no need to depend on liblua.a explicitly. There is no liblua.a in current directory, just .libs/liblua.a, handled by libtool.

Index: files/lua-5.1-make_static-r1.patch
Updated to apply again, no real difference otherways.
Comment 8 Matti Bickel (RETIRED) gentoo-dev 2009-04-05 23:18:58 UTC
applied your patch with the latest commit. thanks for your patience!
Comment 9 Michael Haubenwallner (RETIRED) gentoo-dev 2009-04-08 08:34:07 UTC
Works now, thank you!