Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: "Andreas K. Huettel" <dilfridge@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Moving CPU flags into USE_EXPAND
Date: Thu, 15 Jan 2015 08:13:52
Message-Id: 20150115091336.260547a3@gentoo.org
In Reply to: Re: [gentoo-dev] Moving CPU flags into USE_EXPAND by "Andreas K. Huettel"
1 On Wed, 14 Jan 2015 21:59:37 +0100
2 "Andreas K. Huettel" <dilfridge@g.o> wrote:
3
4 > That said, long time ago I was taught that "instruction set
5 > use-flags" should be avoided as much as possible. I don't remember
6 > the source for that anymore.
7 >
8 > Question to all, is that documented anywhere, and what are the
9 > specifics? I suspect "use flags that only switch CFLAGS etc" are
10 > forbidden, "useflags that enable assembler code etc" are allowed?
11 >
12
13 I don't think this is documented besides the fact that forcing cflags
14 is forbidden.
15
16 For asm code you don't have much choice: either your package compiles
17 all asm and has some kind of cpu detection so that it choses the best
18 implementation at runtime (wasting a bit of resources), either if you
19 enable something your cpu doesn't support then your program gets killed
20 by SIGILL.
21 Also, this is not the case for x86* but iirc on arm, if your cflags
22 have some -march or -mcpu then gcc forwards it to as which in turns
23 refuses any instruction not supported by your cpu: you must disable
24 forbidden instructions in order to build your package.
25
26 Alexis.