Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Re: [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/
Date: Tue, 26 May 2020 01:09:29
Message-Id: CAJ0EP411xSzU=4kcsMtRYG=1vPt+1jVWaQgXXmCKvPsSp-X9WA@mail.gmail.com
In Reply to: Re: [gentoo-dev] Re: [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/ by Alexis Ballier
1 On Mon, May 25, 2020 at 7:35 PM Alexis Ballier <aballier@g.o> wrote:
2 >
3 > On Mon, 2020-05-25 at 17:04 -0400, Mike Gilbert wrote:
4 > > On Mon, May 25, 2020 at 3:18 PM Michał Górny <mgorny@g.o>
5 > > wrote:
6 > > > On Mon, 2020-05-25 at 19:49 +0200, Alexis Ballier wrote:
7 > > > > On Mon, 25 May 2020 11:26:26 -0400
8 > > > > Mike Gilbert <floppym@g.o> wrote:
9 > > > >
10 > > > > > On Mon, May 25, 2020 at 9:13 AM Alexis Ballier <
11 > > > > > aballier@g.o>
12 > > > > > wrote:
13 > > > > > > On Sun, 24 May 2020 20:25:11 +0000 (UTC)
14 > > > > > > "Thomas Deutschmann" <whissi@g.o> wrote:
15 > > > > > >
16 > > > > > > > commit: 6e149596cc76f1bbcee6720828c8c8c92420f2a3
17 > > > > > > > Author: Thomas Deutschmann <whissi <AT> gentoo <DOT>
18 > > > > > > > org>
19 > > > > > > > AuthorDate: Sun May 24 19:47:08 2020 +0000
20 > > > > > > > Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT>
21 > > > > > > > org>
22 > > > > > > > CommitDate: Sun May 24 20:23:53 2020 +0000
23 > > > > > > > URL:
24 > > > > > > > https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e149596
25 > > > > > > >
26 > > > > > > > media-libs/x265: drop USE=pic
27 > > > > > > >
28 > > > > > > > Gentoo's toolchain uses PIC by default. Since USE=asm was
29 > > > > > > > added,
30 > > > > > > > we no longer need a USE flag to control that behavior.
31 > > > > > >
32 > > > > > > You got it wrong here it seems: USE=pic does not control
33 > > > > > > whether
34 > > > > > > the toolchain produces PIC or not. Shared libs always are,
35 > > > > > > and have
36 > > > > > > always been, built that way on Gentoo.
37 > > > > > > In this case, USE=pic means "no matter what it costs, I do
38 > > > > > > not want
39 > > > > > > textrels", for the cases of hand written assembly that has to
40 > > > > > > be
41 > > > > > > rewritten to support PIC. And, still in this case, this costs
42 > > > > > > a lot
43 > > > > > > of performance, so it is enabled by default on hardened
44 > > > > > > profiles
45 > > > > > > and not others.
46 > > > > > > Textrels work fine (on some architectures), they disallow W^X
47 > > > > > > and
48 > > > > > > force each process using the shared lib to make a "copy" at
49 > > > > > > runtime
50 > > > > > > in order to resolve relocations, so are not desirable but
51 > > > > > > sometimes
52 > > > > > > the cost outweights the gain.
53 > > > > > >
54 > > > > > > Plus, profiles/features/hardened enables pic by default but
55 > > > > > > knows
56 > > > > > > nothing about USE=asm so this is a regression for them.
57 > > > > >
58 > > > > > The USE flag toggles use of assembly, not use of PIC. The
59 > > > > > default USE
60 > > > > > value in the hardened profile should not drive decisions on
61 > > > > > what we
62 > > > > > name USE flags.
63 > > > >
64 > > > > ... but using a global well documented useflag instead of a local
65 > > > > invention should drive such decisions.
66 > > >
67 > > > What 'global well documented useflag'?
68 > >
69 > > It's neither global, nor well-documented, but several packages do
70 > > define it locally.
71 > >
72 >
73 > https://gitweb.gentoo.org/repo/gentoo/historical.git/commit/profiles/use.desc?id=103236c295aa30e5e42cfc8a7429e4eea5f0d680
74 >
75 > https://gitweb.gentoo.org/repo/gentoo/historical.git/commit/profiles/use.desc?id=784deb7134b9d430546557a8f8a0877bf35c02ba
76 >
77 > I guess this hasn't been really discussed back then.
78 >
79 > It is also used in a global way in profiles (make.defaults).
80 >
81 > > Personally, I think it should be renamed to "asm" or something
82 > > similar
83 > > in the majority of cases where it actually disables all use of
84 > > assembly code.
85 >
86 > Thankfully these days there's usually no need to disable asm to have
87 > pic. hardened has no mention of that flag, and I think that e.g. for
88 > openssl they would have noticed long ago.
89 > And again, 'asm' as a useflag makes no sense: if it works and simply
90 > replaces a C function by a faster one then it shouldn't even be an
91 > useflag. 'pic' on the other hand conveys the tradeoff idea.
92
93 If I understand you correctly, we should just drop the USE="pic" logic
94 from the remaining packages that have it? Or are you trying to say
95 something else?

Replies