First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 122128
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Tom Payne (RETIRED) <twp@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Benjamin Schindler (RETIRED) <config@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
lua-5.0.2-LDFLAGS_and_as-needed.patch files/lua-5.0.2-LDFLAGS_and_as-needed.patch patch TGL 2006-05-07 09:51 0000 1.79 KB Details | Diff
lua-5.0.2-ebuild.patch lua-5.0.2-ebuild.patch patch TGL 2006-05-07 09:52 0000 669 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 122128 depends on: Show dependency tree
Bug 122128 blocks: 129413
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-02-08 07:28 0000
I just started writing an ebuild for a game using lua, and it fails to
configure when --as-needed is specified. 

I found that, doing the following sed:

sed -i -e 's:^\(.*-shared.*\):\1 $(DLLIB) $(EXTRA_LIBS):' Makefile

Fixes the problem. It's needed because the -ldl and -lm libraries get a NEEDED
entry in the so file. Programs that link against liblua without adding -lm -ldl
themselves fail get unresolved symbols, like:

/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../lib64/liblualib.so:
undefined reference to `log'
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../lib64/liblualib.so:
undefined reference to `sqrt'
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../lib64/liblualib.so:
undefined reference to `dlerror'

------- Comment #1 From TGL 2006-05-07 09:51:25 0000 -------
I will attach patches for lua-5.0.2 and its ebuild which do the following:
 * make lua respect user's LDFLAGS when linking binaries or libs (in addition,
the default -Wl,-E is still used for the binaries).
 * fix unresolved symbols of liblualib by linking it to liblua and the other
libs it needs.

I don't know much packages to test this, but according to "ldd -r" the libs
should be sane now. Does it work for your game too?

------- Comment #2 From TGL 2006-05-07 09:51:59 0000 -------
Created an attachment (id=86374) [edit]
files/lua-5.0.2-LDFLAGS_and_as-needed.patch

------- Comment #3 From TGL 2006-05-07 09:52:53 0000 -------
Created an attachment (id=86375) [edit]
lua-5.0.2-ebuild.patch

patch is for -5.0.2.ebuild, not the masked -r1 (i've not looked at this one)

------- Comment #4 From Benjamin Schindler (RETIRED) 2006-05-15 12:04:19 0000 -------
The game is currently in a broken state so I cannot comment, but looking at lib
the ebuild produces, it looks correct

------- Comment #5 From Stefan Schweizer 2006-06-25 09:55:53 0000 -------
twp allowe3d me to apply this one. It makes xmoto work with as-needed for me,
thank you!

+  25 Jun 2006; Stefan Schweizer <genstef@gentoo.org>
+  +files/lua-5.0.2-LDFLAGS_and_as-needed.patch, lua-5.0.2.ebuild:
+  as-needed patch thanks to TGL <degrenier@easyconnect.fr> in bug 122128 from
+  Benjamin Schindler <config@gentoo.org>

------- Comment #6 From Emanuele Giaquinta (RETIRED) 2006-10-14 01:55:25 0000 -------
This patch is wrong; you add "-L$(LIB) -llua" for liblualib.so.50 but the
liblua.so symlink to liblua.so.50 is created only after liblualib.so.50 is
generated so ld links the static archive, liblua.a; in fact you can check with
'scanelf -n' that liblualib.so has no NEEDED on liblua.so. Do you understand
what this imply?

------- Comment #7 From Emanuele Giaquinta (RETIRED) 2006-10-15 09:10:56 0000 -------
I have disabled the patch in lua-5.0.2, because the right one depends on the
libs having an soname; it is already fixed in lua-5.0.3 which will be soon
unmasked.

First Last Prev Next    No search results available      Search page      Enter new bug