Skip to content

Commit

Permalink
Merge branch 'jb54225-2' into 'master'
Browse files Browse the repository at this point in the history
[sailfishos] Workaround aarch64 target selection issues in string matching....

See merge request mer-core/gecko-dev!344
  • Loading branch information
xfade committed Jun 14, 2021
2 parents 46c617e + befd4ab commit 66249d1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build/moz.configure/rust.configure
Expand Up @@ -190,9 +190,15 @@ def rust_triple_alias(host_or_target):
die("Don't know how to translate {} for rustc".format(
host_or_target.alias))

# Quick hack to fix aarch64 build
if rustc_target.alias == 'aarch64_be-unknown-linux-gnu':
hack_alias = 'aarch64-unknown-linux-gnu'
else:
hack_alias = rustc_target.alias

# Check to see whether our rustc has a reasonably functional stdlib
# for our chosen target.
target_arg = '--target=' + rustc_target.alias
target_arg = '--target=' + hack_alias
in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs')
out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib')
os.close(out_fd)
Expand Down Expand Up @@ -220,7 +226,7 @@ def rust_triple_alias(host_or_target):
a rust std library for that target installed. Try:
rustup target add {}
'''.format(host_or_target.alias, rustc, rustc_target.alias)))
'''.format(host_or_target.alias, rustc, hack_alias)))
check_cmd_output(*cmd, onerror=failed)
if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
failed()
Expand All @@ -229,7 +235,7 @@ def rust_triple_alias(host_or_target):
os.remove(out_path)

# This target is usable.
return rustc_target.alias
return hack_alias

return rust_target

Expand Down

0 comments on commit 66249d1

Please sign in to comment.