diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-10-07 11:03:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 11:03:59 +0000 |
commit | bef31ea273689021f0fc8168f417edf386060512 (patch) | |
tree | fab6e519636bbfa69207b7b5faff4bbfe61eaef7 /gcc/rust/backend/rust-compile.cc | |
parent | e623ee314fbc9503067bbb379a4055dd4d5d245b (diff) | |
parent | bb5efc657ae66a96cf83604efa069ca76b5dd8e4 (diff) | |
download | gcc-bef31ea273689021f0fc8168f417edf386060512.zip gcc-bef31ea273689021f0fc8168f417edf386060512.tar.gz gcc-bef31ea273689021f0fc8168f417edf386060512.tar.bz2 |
Merge #1543
1543: Reintroduce targetrustm hooks without the maze of macro definitions in target headers r=CohenArthur a=ibuclaw
- Adds skeleton support and documentation for targetrustm hooks.
- Re-adds previously reverted `TARGET_RUST_CPU_INFO` target hook.
- Re-adds the previously reverted `TARGET_RUST_OS_INFO` target hook.
- Implements `TARGET_RUST_CPU_INFO` hook for x86 (only a subset of the original i386-rust.cc was re-added)
- Implements `TARGET_RUST_OS_INFO` hook for darwin (covers both x86 and powerpc).
There's quite a bit to unpick from what was removed, but I hope this shows how firstly `rust-target.h` and `tm_rust.h` should be kept as empty as possible for the `default-rust.cc` source file that pulls in these headers; secondly all rust macros and declarations be put in rust-specific headers, then pulled into tm_rust.h as-needed. From every other `${target}-rust.cc` file, you can include as much as you like in order to pry out the information you need to get at.
I've verified this does work as expected with the `-frust-dump-target_options` switch, e.g with `-mavx2`
```
target_endian: "little"
target_pointer_width: "64"
target_feature: "fxsr"
target_feature: "popcnt"
target_feature: "avx2"
target_feature: "ssse3"
target_feature: "sse4.1"
target_feature: "sse3"
target_feature: "avx"
target_feature: "sse"
target_feature: "xsave"
target_feature: "sse4.2"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
I've also built a few darwin cross compilers with the following results on i686-darwin
```
target_pointer_width: "32"
target_env: ""
target_vendor: "apple"
target_endian: "little"
target_os: "macos"
target_family: "unix"
target_feature: "sse3"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86"
```
and on powerpc64-darwin
```
target_pointer_width: "64"
target_env: ""
target_vendor: "apple"
target_endian: "big"
target_os: "macos"
target_family: "unix"
```
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
0 files changed, 0 insertions, 0 deletions