Gentoo Archives: gentoo-dev

From: Ned Ludd <solar@g.o>
To: Troy Dack <troy@××××××.com>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] LDFLAGS & KDE ebuild
Date: Fri, 23 Apr 2004 19:10:13
Message-Id: 1082747365.24268.610.camel@simple
In Reply to: [gentoo-dev] LDFLAGS & KDE ebuild by Troy Dack
1 On Tue, 2004-04-13 at 09:48, Troy Dack wrote:
2 > Hi peoples,
3 > I'm presently putting together an ebuild for synce-kcemirror
4 > (http://synce.sourceforge.net/synce/kde/pdamirror.php).
5 >
6 > For some reason the ./configure does not seem to pass on to ld that the
7 > kde libs are in a non-standard location, resulting in:
8 >
9 > /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lkdeprint
10 >
11 > I've managed to get it to build and install, however I don't think the
12 > following is really the best:
13 >
14 > src_compile() {
15 > cd ${S}
16 > LDFLAGS="-L/usr/kde/cvs/lib" econf || die
17 > LDFLAGS="-L/usr/kde/src/lib" emake || die
18 > }
19
20
21 Please never completely override LDFLAGS= like in the above example,
22 the hardened use makes heavy use of them.
23 Instead please try.
24
25 inherit flag-o-matic
26
27 src_compile() {
28 append-ldflags -L/usr/kde/cvs/lib
29 ...
30 ..
31 .
32 }
33
34 # or the likes..
35 Thanks.
36
37 > So, how can I:
38 > a) work out where the kde libs are installed
39 > b) pass this nicely to ./configure and make
40 >
41 > Any advice greatly appreciated.
42
43 KDE/QT really needs to be careful with linking. I've done a rather quick
44 audit of ELF RPATH and KDE/QT is keeps RPATH's set to /var/tmp/portage*.
45 This is very bad.. If say a user would do something as silly as symlink
46 /var/tmp and /tmp then complete control of the system could be gained by
47 almost any user with half a brain. So for example.. If one were to run
48 this script and find anything printed to the screen then she/he can kiss
49 her/his sweet arse goodbye.
50 http://dev.gentoo.org/~solar/audit/audit.rpath 'man 1 ld' for more info
51
52 >
53 > Thanks
54 --
55 Ned Ludd <solar@g.o>
56 Gentoo Linux Developer

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] LDFLAGS & KDE ebuild Spider <spider@g.o>