diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-05-21 14:02:47 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-05-21 22:20:54 +0100 |
commit | 781eaa955dce5deab47371c25dae72b36c011900 (patch) | |
tree | 8c5e18c1e060c1ad04b14b1c1f91b30d31b45acc /meta/recipes-devtools/rust | |
parent | 66ff1fb3a164fa794ee186960809e3fa9e938b48 (diff) | |
download | poky-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.inc | 23 | ||||
-rw-r--r-- | meta/recipes-devtools/rust/rust-cross-canadian-common.inc | 1 |
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 |
122 | DATA_LAYOUT[arm] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" | 122 | DATA_LAYOUT[arm] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" |
123 | LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" | ||
124 | TARGET_ENDIAN[arm] = "little" | 123 | TARGET_ENDIAN[arm] = "little" |
125 | TARGET_POINTER_WIDTH[arm] = "32" | 124 | TARGET_POINTER_WIDTH[arm] = "32" |
126 | TARGET_C_INT_WIDTH[arm] = "32" | 125 | TARGET_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 |
131 | DATA_LAYOUT[armv7-eabi] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" | 130 | DATA_LAYOUT[armv7-eabi] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" |
132 | LLVM_TARGET[armv7-eabi] = "${RUST_TARGET_SYS}" | ||
133 | TARGET_ENDIAN[armv7-eabi] = "little" | 131 | TARGET_ENDIAN[armv7-eabi] = "little" |
134 | TARGET_POINTER_WIDTH[armv7-eabi] = "32" | 132 | TARGET_POINTER_WIDTH[armv7-eabi] = "32" |
135 | TARGET_C_INT_WIDTH[armv7-eabi] = "32" | 133 | TARGET_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} |
140 | DATA_LAYOUT[aarch64] = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" | 138 | DATA_LAYOUT[aarch64] = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
141 | LLVM_TARGET[aarch64] = "${RUST_TARGET_SYS}" | ||
142 | TARGET_ENDIAN[aarch64] = "little" | 139 | TARGET_ENDIAN[aarch64] = "little" |
143 | TARGET_POINTER_WIDTH[aarch64] = "64" | 140 | TARGET_POINTER_WIDTH[aarch64] = "64" |
144 | TARGET_C_INT_WIDTH[aarch64] = "32" | 141 | TARGET_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} |
148 | DATA_LAYOUT[x86_64] = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | 145 | DATA_LAYOUT[x86_64] = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
149 | LLVM_TARGET[x86_64] = "${RUST_TARGET_SYS}" | ||
150 | TARGET_ENDIAN[x86_64] = "little" | 146 | TARGET_ENDIAN[x86_64] = "little" |
151 | TARGET_POINTER_WIDTH[x86_64] = "64" | 147 | TARGET_POINTER_WIDTH[x86_64] = "64" |
152 | TARGET_C_INT_WIDTH[x86_64] = "32" | 148 | TARGET_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 |
156 | DATA_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" | 152 | DATA_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" |
157 | LLVM_TARGET[x86_64-x32] = "${RUST_TARGET_SYS}" | ||
158 | TARGET_ENDIAN[x86_64-x32] = "little" | 153 | TARGET_ENDIAN[x86_64-x32] = "little" |
159 | TARGET_POINTER_WIDTH[x86_64-x32] = "32" | 154 | TARGET_POINTER_WIDTH[x86_64-x32] = "32" |
160 | TARGET_C_INT_WIDTH[x86_64-x32] = "32" | 155 | TARGET_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} |
164 | DATA_LAYOUT[i686] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" | 159 | DATA_LAYOUT[i686] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" |
165 | LLVM_TARGET[i686] = "${RUST_TARGET_SYS}" | ||
166 | TARGET_ENDIAN[i686] = "little" | 160 | TARGET_ENDIAN[i686] = "little" |
167 | TARGET_POINTER_WIDTH[i686] = "32" | 161 | TARGET_POINTER_WIDTH[i686] = "32" |
168 | TARGET_C_INT_WIDTH[i686] = "32" | 162 | TARGET_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 |
172 | DATA_LAYOUT[i586] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" | 166 | DATA_LAYOUT[i586] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" |
173 | LLVM_TARGET[i586] = "${RUST_TARGET_SYS}" | ||
174 | TARGET_ENDIAN[i586] = "little" | 167 | TARGET_ENDIAN[i586] = "little" |
175 | TARGET_POINTER_WIDTH[i586] = "32" | 168 | TARGET_POINTER_WIDTH[i586] = "32" |
176 | TARGET_C_INT_WIDTH[i586] = "32" | 169 | TARGET_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} |
180 | DATA_LAYOUT[mips] = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" | 173 | DATA_LAYOUT[mips] = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" |
181 | LLVM_TARGET[mips] = "${RUST_TARGET_SYS}" | ||
182 | TARGET_ENDIAN[mips] = "big" | 174 | TARGET_ENDIAN[mips] = "big" |
183 | TARGET_POINTER_WIDTH[mips] = "32" | 175 | TARGET_POINTER_WIDTH[mips] = "32" |
184 | TARGET_C_INT_WIDTH[mips] = "32" | 176 | TARGET_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} |
188 | DATA_LAYOUT[mipsel] = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" | 180 | DATA_LAYOUT[mipsel] = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" |
189 | LLVM_TARGET[mipsel] = "${RUST_TARGET_SYS}" | ||
190 | TARGET_ENDIAN[mipsel] = "little" | 181 | TARGET_ENDIAN[mipsel] = "little" |
191 | TARGET_POINTER_WIDTH[mipsel] = "32" | 182 | TARGET_POINTER_WIDTH[mipsel] = "32" |
192 | TARGET_C_INT_WIDTH[mipsel] = "32" | 183 | TARGET_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} |
196 | DATA_LAYOUT[mips64] = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" | 187 | DATA_LAYOUT[mips64] = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" |
197 | LLVM_TARGET[mips64] = "${RUST_TARGET_SYS}" | ||
198 | TARGET_ENDIAN[mips64] = "big" | 188 | TARGET_ENDIAN[mips64] = "big" |
199 | TARGET_POINTER_WIDTH[mips64] = "64" | 189 | TARGET_POINTER_WIDTH[mips64] = "64" |
200 | TARGET_C_INT_WIDTH[mips64] = "64" | 190 | TARGET_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} |
204 | DATA_LAYOUT[mips64el] = "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" | 194 | DATA_LAYOUT[mips64el] = "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" |
205 | LLVM_TARGET[mips64el] = "${RUST_TARGET_SYS}" | ||
206 | TARGET_ENDIAN[mips64el] = "little" | 195 | TARGET_ENDIAN[mips64el] = "little" |
207 | TARGET_POINTER_WIDTH[mips64el] = "64" | 196 | TARGET_POINTER_WIDTH[mips64el] = "64" |
208 | TARGET_C_INT_WIDTH[mips64el] = "64" | 197 | TARGET_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} |
212 | DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-i64:64-n32" | 201 | DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-i64:64-n32" |
213 | LLVM_TARGET[powerpc] = "${RUST_TARGET_SYS}" | ||
214 | TARGET_ENDIAN[powerpc] = "big" | 202 | TARGET_ENDIAN[powerpc] = "big" |
215 | TARGET_POINTER_WIDTH[powerpc] = "32" | 203 | TARGET_POINTER_WIDTH[powerpc] = "32" |
216 | TARGET_C_INT_WIDTH[powerpc] = "32" | 204 | TARGET_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} |
220 | DATA_LAYOUT[powerpc64] = "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512" | 208 | DATA_LAYOUT[powerpc64] = "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512" |
221 | LLVM_TARGET[powerpc64] = "${RUST_TARGET_SYS}" | ||
222 | TARGET_ENDIAN[powerpc64] = "big" | 209 | TARGET_ENDIAN[powerpc64] = "big" |
223 | TARGET_POINTER_WIDTH[powerpc64] = "64" | 210 | TARGET_POINTER_WIDTH[powerpc64] = "64" |
224 | TARGET_C_INT_WIDTH[powerpc64] = "64" | 211 | TARGET_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} |
228 | DATA_LAYOUT[powerpc64le] = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512" | 215 | DATA_LAYOUT[powerpc64le] = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512" |
229 | LLVM_TARGET[powerpc64le] = "${RUST_TARGET_SYS}" | ||
230 | TARGET_ENDIAN[powerpc64le] = "little" | 216 | TARGET_ENDIAN[powerpc64le] = "little" |
231 | TARGET_POINTER_WIDTH[powerpc64le] = "64" | 217 | TARGET_POINTER_WIDTH[powerpc64le] = "64" |
232 | TARGET_C_INT_WIDTH[powerpc64le] = "64" | 218 | TARGET_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} |
236 | DATA_LAYOUT[riscv32] = "e-m:e-p:32:32-i64:64-n32-S128" | 222 | DATA_LAYOUT[riscv32] = "e-m:e-p:32:32-i64:64-n32-S128" |
237 | LLVM_TARGET[riscv32] = "${RUST_TARGET_SYS}" | ||
238 | TARGET_ENDIAN[riscv32] = "little" | 223 | TARGET_ENDIAN[riscv32] = "little" |
239 | TARGET_POINTER_WIDTH[riscv32] = "32" | 224 | TARGET_POINTER_WIDTH[riscv32] = "32" |
240 | TARGET_C_INT_WIDTH[riscv32] = "32" | 225 | TARGET_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} |
244 | DATA_LAYOUT[riscv64] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" | 229 | DATA_LAYOUT[riscv64] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" |
245 | LLVM_TARGET[riscv64] = "${RUST_TARGET_SYS}" | ||
246 | TARGET_ENDIAN[riscv64] = "little" | 230 | TARGET_ENDIAN[riscv64] = "little" |
247 | TARGET_POINTER_WIDTH[riscv64] = "64" | 231 | TARGET_POINTER_WIDTH[riscv64] = "64" |
248 | TARGET_C_INT_WIDTH[riscv64] = "64" | 232 | TARGET_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 | ||
363 | do_rust_gen_targets[vardeps] += "DATA_LAYOUT LLVM_TARGET TARGET_ENDIAN TARGET_POINTER_WIDTH TARGET_C_INT_WIDTH MAX_ATOMIC_WIDTH FEATURES" | 350 | do_rust_gen_targets[vardeps] += "DATA_LAYOUT TARGET_ENDIAN TARGET_POINTER_WIDTH TARGET_C_INT_WIDTH MAX_ATOMIC_WIDTH FEATURES" |
364 | 351 | ||
365 | python do_rust_gen_targets () { | 352 | python 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 | ||
28 | LLVM_TARGET[x86_64] = "${RUST_HOST_SYS}" | ||
29 | python do_rust_gen_targets () { | 28 | python 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')) |