1 |
commit: 976ef028d3a1c18cfa64f3880a8a2754da35afea |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 11 14:59:37 2020 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 11 15:01:57 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=976ef028 |
7 |
|
8 |
multilib*.eclass: Add support for rv32 abi |
9 |
|
10 |
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> |
11 |
|
12 |
eclass/multilib-build.eclass | 14 +++++++++++--- |
13 |
eclass/multilib.eclass | 30 +++++++++++++++++++++++++++--- |
14 |
2 files changed, 38 insertions(+), 6 deletions(-) |
15 |
|
16 |
diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass |
17 |
index 620bdcedce5..dc4f8a2bd15 100644 |
18 |
--- a/eclass/multilib-build.eclass |
19 |
+++ b/eclass/multilib-build.eclass |
20 |
@@ -49,6 +49,8 @@ _MULTILIB_FLAGS=( |
21 |
# abi_ppc_64:ppc64 |
22 |
abi_riscv_lp64d:lp64d |
23 |
abi_riscv_lp64:lp64 |
24 |
+ abi_riscv_ilp32d:ilp32d |
25 |
+ abi_riscv_ilp32:ilp32 |
26 |
abi_s390_32:s390 |
27 |
abi_s390_64:s390x |
28 |
) |
29 |
@@ -492,12 +494,18 @@ multilib_prepare_wrappers() { |
30 |
# error "abi_mips_o32 not supported by the package." |
31 |
# endif |
32 |
#elif defined(__riscv) |
33 |
-# if defined(__riscv_float_abi_double) |
34 |
+# if (__WORDSIZE == 64) && defined(__riscv_float_abi_double) |
35 |
# error "abi_riscv_lp64d not supported by the package." |
36 |
-# elif defined(__riscv_float_abi_single) |
37 |
+# elif (__WORDSIZE == 64) && defined(__riscv_float_abi_single) |
38 |
# error "abi_riscv_lp64f not supported by the package." |
39 |
-# else |
40 |
+# elif (__WORDSIZE == 64) |
41 |
# error "abi_riscv_lp64 not supported by the package." |
42 |
+# elif (__WORDSIZE == 32) && defined(__riscv_float_abi_double) |
43 |
+# error "abi_riscv_ilp32d not supported by the package." |
44 |
+# elif (__WORDSIZE == 32) && defined(__riscv_float_abi_single) |
45 |
+# error "abi_riscv_ilp32f not supported by the package." |
46 |
+# else |
47 |
+# error "abi_riscv_ilp32 not supported by the package." |
48 |
# endif |
49 |
#elif defined(__sparc__) |
50 |
# if defined(__arch64__) |
51 |
|
52 |
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass |
53 |
index 342d21a2e1c..9c7042fcd29 100644 |
54 |
--- a/eclass/multilib.eclass |
55 |
+++ b/eclass/multilib.eclass |
56 |
@@ -397,19 +397,43 @@ multilib_env() { |
57 |
: ${DEFAULT_ABI=ppc64} |
58 |
;; |
59 |
riscv64*) |
60 |
- export CFLAGS_lp64d=${CFLAGS_lp64d--mabi=lp64d} |
61 |
+ export CFLAGS_lp64d=${CFLAGS_lp64d--mabi=lp64d -march=rv64imafdc} |
62 |
export CHOST_lp64d=${CTARGET} |
63 |
export CTARGET_lp64d=${CTARGET} |
64 |
export LIBDIR_lp64d="lib64/lp64d" |
65 |
|
66 |
- export CFLAGS_lp64=${CFLAGS_lp64--mabi=lp64} |
67 |
+ export CFLAGS_lp64=${CFLAGS_lp64--mabi=lp64 -march=rv64imac} |
68 |
export CHOST_lp64=${CTARGET} |
69 |
export CTARGET_lp64=${CTARGET} |
70 |
export LIBDIR_lp64="lib64/lp64" |
71 |
|
72 |
- : ${MULTILIB_ABIS=lp64d lp64} |
73 |
+ export CFLAGS_ilp32d=${CFLAGS_ilp32d--mabi=ilp32d -march=rv32imafdc} |
74 |
+ export CHOST_ilp32d=${CTARGET/riscv64/riscv32} |
75 |
+ export CTARGET_ilp32d=${CTARGET/riscv64/riscv32} |
76 |
+ export LIBDIR_ilp32d="lib32/ilp32d" |
77 |
+ |
78 |
+ export CFLAGS_ilp32=${CFLAGS_ilp32--mabi=ilp32 -march=rv32imac} |
79 |
+ export CHOST_ilp32=${CTARGET/riscv64/riscv32} |
80 |
+ export CTARGET_ilp32=${CTARGET/riscv64/riscv32} |
81 |
+ export LIBDIR_ilp32="lib32/ilp32" |
82 |
+ |
83 |
+ : ${MULTILIB_ABIS=lp64d lp64 ilp32d ilp32} |
84 |
: ${DEFAULT_ABI=lp64d} |
85 |
;; |
86 |
+ riscv32*) |
87 |
+ export CFLAGS_ilp32d=${CFLAGS_ilp32d--mabi=ilp32d} |
88 |
+ export CHOST_ilp32d=${CTARGET} |
89 |
+ export CTARGET_ilp32d=${CTARGET} |
90 |
+ export LIBDIR_ilp32d="lib32/ilp32d" |
91 |
+ |
92 |
+ export CFLAGS_ilp32=${CFLAGS_ilp32--mabi=ilp32 -march=rv32imac} |
93 |
+ export CHOST_ilp32=${CTARGET} |
94 |
+ export CTARGET_ilp32=${CTARGET} |
95 |
+ export LIBDIR_ilp32="lib32/ilp32" |
96 |
+ |
97 |
+ : ${MULTILIB_ABIS=ilp32d ilp32} |
98 |
+ : ${DEFAULT_ABI=ilp32d} |
99 |
+ ;; |
100 |
s390x*) |
101 |
export CFLAGS_s390=${CFLAGS_s390--m31} # the 31 is not a typo |
102 |
export CHOST_s390=${CTARGET/s390x/s390} |