summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-21 14:02:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-21 22:20:54 +0100
commit781eaa955dce5deab47371c25dae72b36c011900 (patch)
tree8c5e18c1e060c1ad04b14b1c1f91b30d31b45acc /meta/recipes-devtools/rust
parent66ff1fb3a164fa794ee186960809e3fa9e938b48 (diff)
downloadpoky-781eaa955dce5deab47371c25dae72b36c011900.tar.gz
rust-common: Drop LLVM_TARGET and simplify
This all seems over complicated for something which is basically always one of two values. This might even help cross-canadian work on something which isn't x86-64. (From OE-Core rev: bd36593ba3db758b3eacc974e48468a665967961) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust')
-rw-r--r--meta/recipes-devtools/rust/rust-common.inc23
-rw-r--r--meta/recipes-devtools/rust/rust-cross-canadian-common.inc1
2 files changed, 5 insertions, 19 deletions
diff --git a/meta/recipes-devtools/rust/rust-common.inc b/meta/recipes-devtools/rust/rust-common.inc
index 984fe9099e..3cdce36439 100644
--- a/meta/recipes-devtools/rust/rust-common.inc
+++ b/meta/recipes-devtools/rust/rust-common.inc
@@ -120,7 +120,6 @@ def llvm_features(d):
120 120
121## arm-unknown-linux-gnueabihf 121## arm-unknown-linux-gnueabihf
122DATA_LAYOUT[arm] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" 122DATA_LAYOUT[arm] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
123LLVM_TARGET[arm] = "${RUST_TARGET_SYS}"
124TARGET_ENDIAN[arm] = "little" 123TARGET_ENDIAN[arm] = "little"
125TARGET_POINTER_WIDTH[arm] = "32" 124TARGET_POINTER_WIDTH[arm] = "32"
126TARGET_C_INT_WIDTH[arm] = "32" 125TARGET_C_INT_WIDTH[arm] = "32"
@@ -129,7 +128,6 @@ FEATURES[arm] = "+v6,+vfp2"
129 128
130## armv7-unknown-linux-gnueabihf 129## armv7-unknown-linux-gnueabihf
131DATA_LAYOUT[armv7-eabi] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" 130DATA_LAYOUT[armv7-eabi] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
132LLVM_TARGET[armv7-eabi] = "${RUST_TARGET_SYS}"
133TARGET_ENDIAN[armv7-eabi] = "little" 131TARGET_ENDIAN[armv7-eabi] = "little"
134TARGET_POINTER_WIDTH[armv7-eabi] = "32" 132TARGET_POINTER_WIDTH[armv7-eabi] = "32"
135TARGET_C_INT_WIDTH[armv7-eabi] = "32" 133TARGET_C_INT_WIDTH[armv7-eabi] = "32"
@@ -138,7 +136,6 @@ FEATURES[armv7-eabi] = "+v7,+vfp2,+thumb2"
138 136
139## aarch64-unknown-linux-{gnu, musl} 137## aarch64-unknown-linux-{gnu, musl}
140DATA_LAYOUT[aarch64] = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" 138DATA_LAYOUT[aarch64] = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
141LLVM_TARGET[aarch64] = "${RUST_TARGET_SYS}"
142TARGET_ENDIAN[aarch64] = "little" 139TARGET_ENDIAN[aarch64] = "little"
143TARGET_POINTER_WIDTH[aarch64] = "64" 140TARGET_POINTER_WIDTH[aarch64] = "64"
144TARGET_C_INT_WIDTH[aarch64] = "32" 141TARGET_C_INT_WIDTH[aarch64] = "32"
@@ -146,7 +143,6 @@ MAX_ATOMIC_WIDTH[aarch64] = "128"
146 143
147## x86_64-unknown-linux-{gnu, musl} 144## x86_64-unknown-linux-{gnu, musl}
148DATA_LAYOUT[x86_64] = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 145DATA_LAYOUT[x86_64] = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
149LLVM_TARGET[x86_64] = "${RUST_TARGET_SYS}"
150TARGET_ENDIAN[x86_64] = "little" 146TARGET_ENDIAN[x86_64] = "little"
151TARGET_POINTER_WIDTH[x86_64] = "64" 147TARGET_POINTER_WIDTH[x86_64] = "64"
152TARGET_C_INT_WIDTH[x86_64] = "32" 148TARGET_C_INT_WIDTH[x86_64] = "32"
@@ -154,7 +150,6 @@ MAX_ATOMIC_WIDTH[x86_64] = "64"
154 150
155## x86_64-unknown-linux-gnux32 151## x86_64-unknown-linux-gnux32
156DATA_LAYOUT[x86_64-x32] = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 152DATA_LAYOUT[x86_64-x32] = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
157LLVM_TARGET[x86_64-x32] = "${RUST_TARGET_SYS}"
158TARGET_ENDIAN[x86_64-x32] = "little" 153TARGET_ENDIAN[x86_64-x32] = "little"
159TARGET_POINTER_WIDTH[x86_64-x32] = "32" 154TARGET_POINTER_WIDTH[x86_64-x32] = "32"
160TARGET_C_INT_WIDTH[x86_64-x32] = "32" 155TARGET_C_INT_WIDTH[x86_64-x32] = "32"
@@ -162,7 +157,6 @@ MAX_ATOMIC_WIDTH[x86_64-x32] = "64"
162 157
163## i686-unknown-linux-{gnu, musl} 158## i686-unknown-linux-{gnu, musl}
164DATA_LAYOUT[i686] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" 159DATA_LAYOUT[i686] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
165LLVM_TARGET[i686] = "${RUST_TARGET_SYS}"
166TARGET_ENDIAN[i686] = "little" 160TARGET_ENDIAN[i686] = "little"
167TARGET_POINTER_WIDTH[i686] = "32" 161TARGET_POINTER_WIDTH[i686] = "32"
168TARGET_C_INT_WIDTH[i686] = "32" 162TARGET_C_INT_WIDTH[i686] = "32"
@@ -170,7 +164,6 @@ MAX_ATOMIC_WIDTH[i686] = "64"
170 164
171## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-{gnu, musl} above 165## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-{gnu, musl} above
172DATA_LAYOUT[i586] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" 166DATA_LAYOUT[i586] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
173LLVM_TARGET[i586] = "${RUST_TARGET_SYS}"
174TARGET_ENDIAN[i586] = "little" 167TARGET_ENDIAN[i586] = "little"
175TARGET_POINTER_WIDTH[i586] = "32" 168TARGET_POINTER_WIDTH[i586] = "32"
176TARGET_C_INT_WIDTH[i586] = "32" 169TARGET_C_INT_WIDTH[i586] = "32"
@@ -178,7 +171,6 @@ MAX_ATOMIC_WIDTH[i586] = "64"
178 171
179## mips-unknown-linux-{gnu, musl} 172## mips-unknown-linux-{gnu, musl}
180DATA_LAYOUT[mips] = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" 173DATA_LAYOUT[mips] = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
181LLVM_TARGET[mips] = "${RUST_TARGET_SYS}"
182TARGET_ENDIAN[mips] = "big" 174TARGET_ENDIAN[mips] = "big"
183TARGET_POINTER_WIDTH[mips] = "32" 175TARGET_POINTER_WIDTH[mips] = "32"
184TARGET_C_INT_WIDTH[mips] = "32" 176TARGET_C_INT_WIDTH[mips] = "32"
@@ -186,7 +178,6 @@ MAX_ATOMIC_WIDTH[mips] = "32"
186 178
187## mipsel-unknown-linux-{gnu, musl} 179## mipsel-unknown-linux-{gnu, musl}
188DATA_LAYOUT[mipsel] = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" 180DATA_LAYOUT[mipsel] = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
189LLVM_TARGET[mipsel] = "${RUST_TARGET_SYS}"
190TARGET_ENDIAN[mipsel] = "little" 181TARGET_ENDIAN[mipsel] = "little"
191TARGET_POINTER_WIDTH[mipsel] = "32" 182TARGET_POINTER_WIDTH[mipsel] = "32"
192TARGET_C_INT_WIDTH[mipsel] = "32" 183TARGET_C_INT_WIDTH[mipsel] = "32"
@@ -194,7 +185,6 @@ MAX_ATOMIC_WIDTH[mipsel] = "32"
194 185
195## mips64-unknown-linux-{gnu, musl} 186## mips64-unknown-linux-{gnu, musl}
196DATA_LAYOUT[mips64] = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" 187DATA_LAYOUT[mips64] = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"
197LLVM_TARGET[mips64] = "${RUST_TARGET_SYS}"
198TARGET_ENDIAN[mips64] = "big" 188TARGET_ENDIAN[mips64] = "big"
199TARGET_POINTER_WIDTH[mips64] = "64" 189TARGET_POINTER_WIDTH[mips64] = "64"
200TARGET_C_INT_WIDTH[mips64] = "64" 190TARGET_C_INT_WIDTH[mips64] = "64"
@@ -202,7 +192,6 @@ MAX_ATOMIC_WIDTH[mips64] = "64"
202 192
203## mips64el-unknown-linux-{gnu, musl} 193## mips64el-unknown-linux-{gnu, musl}
204DATA_LAYOUT[mips64el] = "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" 194DATA_LAYOUT[mips64el] = "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"
205LLVM_TARGET[mips64el] = "${RUST_TARGET_SYS}"
206TARGET_ENDIAN[mips64el] = "little" 195TARGET_ENDIAN[mips64el] = "little"
207TARGET_POINTER_WIDTH[mips64el] = "64" 196TARGET_POINTER_WIDTH[mips64el] = "64"
208TARGET_C_INT_WIDTH[mips64el] = "64" 197TARGET_C_INT_WIDTH[mips64el] = "64"
@@ -210,7 +199,6 @@ MAX_ATOMIC_WIDTH[mips64el] = "64"
210 199
211## powerpc-unknown-linux-{gnu, musl} 200## powerpc-unknown-linux-{gnu, musl}
212DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-i64:64-n32" 201DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-i64:64-n32"
213LLVM_TARGET[powerpc] = "${RUST_TARGET_SYS}"
214TARGET_ENDIAN[powerpc] = "big" 202TARGET_ENDIAN[powerpc] = "big"
215TARGET_POINTER_WIDTH[powerpc] = "32" 203TARGET_POINTER_WIDTH[powerpc] = "32"
216TARGET_C_INT_WIDTH[powerpc] = "32" 204TARGET_C_INT_WIDTH[powerpc] = "32"
@@ -218,7 +206,6 @@ MAX_ATOMIC_WIDTH[powerpc] = "32"
218 206
219## powerpc64-unknown-linux-{gnu, musl} 207## powerpc64-unknown-linux-{gnu, musl}
220DATA_LAYOUT[powerpc64] = "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512" 208DATA_LAYOUT[powerpc64] = "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512"
221LLVM_TARGET[powerpc64] = "${RUST_TARGET_SYS}"
222TARGET_ENDIAN[powerpc64] = "big" 209TARGET_ENDIAN[powerpc64] = "big"
223TARGET_POINTER_WIDTH[powerpc64] = "64" 210TARGET_POINTER_WIDTH[powerpc64] = "64"
224TARGET_C_INT_WIDTH[powerpc64] = "64" 211TARGET_C_INT_WIDTH[powerpc64] = "64"
@@ -226,7 +213,6 @@ MAX_ATOMIC_WIDTH[powerpc64] = "64"
226 213
227## powerpc64le-unknown-linux-{gnu, musl} 214## powerpc64le-unknown-linux-{gnu, musl}
228DATA_LAYOUT[powerpc64le] = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512" 215DATA_LAYOUT[powerpc64le] = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512"
229LLVM_TARGET[powerpc64le] = "${RUST_TARGET_SYS}"
230TARGET_ENDIAN[powerpc64le] = "little" 216TARGET_ENDIAN[powerpc64le] = "little"
231TARGET_POINTER_WIDTH[powerpc64le] = "64" 217TARGET_POINTER_WIDTH[powerpc64le] = "64"
232TARGET_C_INT_WIDTH[powerpc64le] = "64" 218TARGET_C_INT_WIDTH[powerpc64le] = "64"
@@ -234,7 +220,6 @@ MAX_ATOMIC_WIDTH[powerpc64le] = "64"
234 220
235## riscv32-unknown-linux-{gnu, musl} 221## riscv32-unknown-linux-{gnu, musl}
236DATA_LAYOUT[riscv32] = "e-m:e-p:32:32-i64:64-n32-S128" 222DATA_LAYOUT[riscv32] = "e-m:e-p:32:32-i64:64-n32-S128"
237LLVM_TARGET[riscv32] = "${RUST_TARGET_SYS}"
238TARGET_ENDIAN[riscv32] = "little" 223TARGET_ENDIAN[riscv32] = "little"
239TARGET_POINTER_WIDTH[riscv32] = "32" 224TARGET_POINTER_WIDTH[riscv32] = "32"
240TARGET_C_INT_WIDTH[riscv32] = "32" 225TARGET_C_INT_WIDTH[riscv32] = "32"
@@ -242,7 +227,6 @@ MAX_ATOMIC_WIDTH[riscv32] = "32"
242 227
243## riscv64-unknown-linux-{gnu, musl} 228## riscv64-unknown-linux-{gnu, musl}
244DATA_LAYOUT[riscv64] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" 229DATA_LAYOUT[riscv64] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
245LLVM_TARGET[riscv64] = "${RUST_TARGET_SYS}"
246TARGET_ENDIAN[riscv64] = "little" 230TARGET_ENDIAN[riscv64] = "little"
247TARGET_POINTER_WIDTH[riscv64] = "64" 231TARGET_POINTER_WIDTH[riscv64] = "64"
248TARGET_C_INT_WIDTH[riscv64] = "64" 232TARGET_C_INT_WIDTH[riscv64] = "64"
@@ -325,7 +309,10 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""):
325 309
326 # build tspec 310 # build tspec
327 tspec = {} 311 tspec = {}
328 tspec['llvm-target'] = d.getVarFlag('LLVM_TARGET', arch_abi) 312 if bb.data.inherits_class('cross-canadian', d):
313 tspec['llvm-target'] = d.getVar('RUST_HOST_SYS', arch_abi)
314 else:
315 tspec['llvm-target'] = d.getVar('RUST_TARGET_SYS', arch_abi)
329 tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) 316 tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi)
330 tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi)) 317 tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi))
331 tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) 318 tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi)
@@ -360,7 +347,7 @@ def rust_gen_target(d, thing, wd, features, cpu, arch, abi=""):
360 with open(wd + sys + '.json', 'w') as f: 347 with open(wd + sys + '.json', 'w') as f:
361 json.dump(tspec, f, indent=4) 348 json.dump(tspec, f, indent=4)
362 349
363do_rust_gen_targets[vardeps] += "DATA_LAYOUT LLVM_TARGET TARGET_ENDIAN TARGET_POINTER_WIDTH TARGET_C_INT_WIDTH MAX_ATOMIC_WIDTH FEATURES" 350do_rust_gen_targets[vardeps] += "DATA_LAYOUT TARGET_ENDIAN TARGET_POINTER_WIDTH TARGET_C_INT_WIDTH MAX_ATOMIC_WIDTH FEATURES"
364 351
365python do_rust_gen_targets () { 352python do_rust_gen_targets () {
366 wd = d.getVar('WORKDIR') + '/targets/' 353 wd = d.getVar('WORKDIR') + '/targets/'
diff --git a/meta/recipes-devtools/rust/rust-cross-canadian-common.inc b/meta/recipes-devtools/rust/rust-cross-canadian-common.inc
index 827000f7bd..1f21c8af26 100644
--- a/meta/recipes-devtools/rust/rust-cross-canadian-common.inc
+++ b/meta/recipes-devtools/rust/rust-cross-canadian-common.inc
@@ -25,7 +25,6 @@ DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDP
25 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ 25 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
26 " 26 "
27 27
28LLVM_TARGET[x86_64] = "${RUST_HOST_SYS}"
29python do_rust_gen_targets () { 28python do_rust_gen_targets () {
30 wd = d.getVar('WORKDIR') + '/targets/' 29 wd = d.getVar('WORKDIR') + '/targets/'
31 rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH')) 30 rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH'))