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: Mon, 25 May 2020 21:05:01
Message-Id: CAJ0EP41oe0H8odiku3J-os9ojgnjdzJXrmDHHGGRCvyefu-YWg@mail.gmail.com
In Reply to: Re: [gentoo-dev] Re: [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/ by "Michał Górny"
1 On Mon, May 25, 2020 at 3:18 PM Michał Górny <mgorny@g.o> wrote:
2 >
3 > On Mon, 2020-05-25 at 19:49 +0200, Alexis Ballier wrote:
4 > > On Mon, 25 May 2020 11:26:26 -0400
5 > > Mike Gilbert <floppym@g.o> wrote:
6 > >
7 > > > On Mon, May 25, 2020 at 9:13 AM Alexis Ballier <aballier@g.o>
8 > > > wrote:
9 > > > > On Sun, 24 May 2020 20:25:11 +0000 (UTC)
10 > > > > "Thomas Deutschmann" <whissi@g.o> wrote:
11 > > > >
12 > > > > > commit: 6e149596cc76f1bbcee6720828c8c8c92420f2a3
13 > > > > > Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
14 > > > > > AuthorDate: Sun May 24 19:47:08 2020 +0000
15 > > > > > Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
16 > > > > > CommitDate: Sun May 24 20:23:53 2020 +0000
17 > > > > > URL:
18 > > > > > https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e149596
19 > > > > >
20 > > > > > media-libs/x265: drop USE=pic
21 > > > > >
22 > > > > > Gentoo's toolchain uses PIC by default. Since USE=asm was added,
23 > > > > > we no longer need a USE flag to control that behavior.
24 > > > >
25 > > > > You got it wrong here it seems: USE=pic does not control whether
26 > > > > the toolchain produces PIC or not. Shared libs always are, and have
27 > > > > always been, built that way on Gentoo.
28 > > > > In this case, USE=pic means "no matter what it costs, I do not want
29 > > > > textrels", for the cases of hand written assembly that has to be
30 > > > > rewritten to support PIC. And, still in this case, this costs a lot
31 > > > > of performance, so it is enabled by default on hardened profiles
32 > > > > and not others.
33 > > > > Textrels work fine (on some architectures), they disallow W^X and
34 > > > > force each process using the shared lib to make a "copy" at runtime
35 > > > > in order to resolve relocations, so are not desirable but sometimes
36 > > > > the cost outweights the gain.
37 > > > >
38 > > > > Plus, profiles/features/hardened enables pic by default but knows
39 > > > > nothing about USE=asm so this is a regression for them.
40 > > >
41 > > > The USE flag toggles use of assembly, not use of PIC. The default USE
42 > > > value in the hardened profile should not drive decisions on what we
43 > > > name USE flags.
44 > >
45 > > ... but using a global well documented useflag instead of a local
46 > > invention should drive such decisions.
47 >
48 > What 'global well documented useflag'?
49
50 It's neither global, nor well-documented, but several packages do
51 define it locally.
52
53 profiles % grep ":pic " use.local.desc
54 app-arch/gzip:pic - disable optimized assembly code that is not PIC friendly
55 app-benchmarks/ramspeed:pic - Force shared libraries to be built as
56 PIC (this is slower)
57 dev-libs/gmp:pic - Force static libraries to be built as PIC to avoid TEXTRELs.
58 gnome-base/orbit:pic - Force libname-server-2 to be built as PIC;
59 needed on hardened systems
60 media-libs/x264:pic - disable optimized assembly code that is not PIC friendly
61 media-libs/x265:pic - Disable optimized assembly code that is not PIC friendly
62 media-libs/xvid:pic - disable optimized assembly code that is not PIC friendly
63 media-video/ffmpeg:pic - Force shared libraries to be built as PIC
64 (this is slower)
65 media-video/transcode:pic - disable optimized assembly code that is
66 not PIC friendly
67 www-client/chromium:pic - Disable optimized assembly code that is not
68 PIC friendly
69
70 I suspect this flag got copy/pasted between various packages related
71 to ffmpeg. That's certainly how chromium ended up with it.
72
73 Personally, I think it should be renamed to "asm" or something similar
74 in the majority of cases where it actually disables all use of
75 assembly code.

Replies