First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 215085
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Games <games@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: James Le Cuirot <chewi@aura-online.co.uk>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
ogre-1.4.7.ebuild ogre-1.4.7.ebuild text/plain James Le Cuirot 2008-03-27 17:44 0000 2.21 KB Details
ogre-1.4.7-as-needed.patch ogre-1.4.7-as-needed.patch patch James Le Cuirot 2008-04-09 17:16 0000 428 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 215085 depends on: Show dependency tree
Bug 215085 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: 2008-03-27 17:43 0000
Because of the way NVIDIA linked their Cg toolkit, building Ogre with the cg
USE flag enabled and -Wl,--as-needed in your LDFLAGS doesn't work. Here's a new
ebuild that filters the flags.

------- Comment #1 From James Le Cuirot 2008-03-27 17:44:29 0000 -------
Created an attachment (id=147461) [details]
ogre-1.4.7.ebuild

Probably no point in incrementing the revision number.

------- Comment #2 From Mr. Bones. 2008-04-08 16:47:40 0000 -------
in portage.  thanks for the bug report and patch.

------- Comment #3 From Sander Sweers 2008-04-08 17:00:42 0000 -------
Filtering --as-needed is just hiding a bug. It should either be left open or
fixed.

------- Comment #4 From Mr. Bones. 2008-04-08 17:04:37 0000 -------
talk is cheap - patches welcome.

------- Comment #5 From James Le Cuirot 2008-04-08 17:24:18 0000 -------
The command that causes the error is...

gcc -o conftest <CFLAGS> -Wl,--as-needed conftest.c -lCg -lILU -lIL -lpthread
-lz -lm -ldl

If you add (or move) -lpthread and -lm before the -Wl,--as-needed option then
it works. Maybe you could do some trick with -Wl,--no-as-needed but you'd have
to make sure that -Wl,--as-needed is added again afterwards and ONLY when it is
wanted. It could be done but it wouldn't be too pretty.

There are two lines in the configure script that add the -lCg option and they
read LIBS="-lCg $LIBS". Maybe something could be done with this.

------- Comment #6 From Sander Sweers 2008-04-08 18:43:22 0000 -------
(In reply to comment #4)
> talk is cheap - patches welcome.

Sigh...

(In reply to comment #5)
> The command that causes the error is...
> 
> gcc -o conftest <CFLAGS> -Wl,--as-needed conftest.c -lCg -lILU -lIL -lpthread
> -lz -lm -ldl
> 
> If you add (or move) -lpthread and -lm before the -Wl,--as-needed option then
> it works. 
> 
> There are two lines in the configure script that add the -lCg option and they
> read LIBS="-lCg $LIBS". Maybe something could be done with this.

Probably changing the linking order from LIBS="-lCg $LIBS" to LIBS="$LIBS -lCg"
will fix it. But I am not able to test that for another week. Could you have a
go at it?

------- Comment #7 From James Le Cuirot 2008-04-08 19:12:36 0000 -------
I tried putting -lCg in various places before but that didn't work. It makes
sense that you have to move -lm and -lpthread because Cg doesn't reference them
when it should and so they must be linked regardless of whether they appear to
be needed.

------- Comment #8 From James Le Cuirot 2008-04-09 17:16:58 0000 -------
Created an attachment (id=149213) [details]
ogre-1.4.7-as-needed.patch

Okay I've come up with a very simple patch. We can get away with only modifying
the configure test because libm and libpthread are actually "needed" by OGRE
itself any other time that libCg is linked. Thanks to the way AC_CHECK_LIB
works, it is easy to add extra arguments to the test. Apply this patch before
the ce-gui patch. "-Xlinker --no-as-needed" was used rather than
"-Wl,--no-as-needed" because the comma confuses autoconf. Sorry for the extra
work, Mr Bones!

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