Gentoo Archives: gentoo-catalyst

From: Sebastian Pipping <sping@g.o>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [rfc] simplifying arch classes
Date: Mon, 27 Jun 2011 17:42:19
Message-Id: 4E08C0DD.5010003@gentoo.org
In Reply to: [gentoo-catalyst] [rfc] simplifying arch classes by Matt Turner
1 On 06/27/2011 07:15 AM, Matt Turner wrote:
2 > class arch_mips(generic):
3 > "MIPS class"
4 > def __init__(self, Olevel, arch, additional_cflags, include_workarounds):
5 > generic.__init__(self)
6 >
7 > self.settings["CFLAGS"] = "-O" + Olevel
8 > self.settings["CFLAGS"] += " -march=" + arch
9 > if additional_cflags != "":
10 > self.settings["CFLAGS"] += " " + additional_cflags
11 > if include_workarounds:
12 > if arch == "mips3":
13 > self.settings["CFLAGS"] += " -mfix-r4000 -mfix-r4400"
14 > elif arch == "r4000" or arch == "r4k":
15 > self.settings["CFLAGS"] += " -mfix-r4000"
16 > elif arch == "r4300":
17 > self.settings["CFLAGS"] += " -mfix-r4300"
18 > elif arch == "r10000" or arch == "r10k":
19 > self.settings["CFLAGS"] += " -mfix-r10000"
20 > self.settings["CFLAGS"] += " -pipe"
21
22 Thoughts:
23
24 - How are you going to ensure that such refactoring keeps all
25 ~50 cases working without writing 50 explicit, data-duplicating
26 test cases? Would you be willing to write these?
27
28 - The code above adds flexibility but is less obvious than
29 the current code. So while it improves on one aspect
30 it worsens on another.
31
32 - Such refactoring would have to be done on both 2.x and 3.x branches.
33 Better wait until we are clear on their future.
34
35 Best,
36
37
38
39 Sebastian

Replies

Subject Author
Re: [gentoo-catalyst] [rfc] simplifying arch classes Matt Turner <mattst88@g.o>