From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id A86893858C53; Mon, 10 Oct 2022 07:34:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A86893858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665387243; bh=0pNCg+iwL1dqRIYo2nsAgNnM47mLCpUeBSSOVvjTyiQ=; h=From:To:Subject:Date:From; b=CGvGz7U5XaOq7ZTYQsub3+FDrOTP71nJSqTJmjO6mFmb7cJfZnZ8vrr/GeDqtQi60 fdCR4kCEz2F5FxQ4TA2iFDOUvREHZuQ5NR6EattzWrIXIEFX+QFFfMc6d9BR1Qg8Qn hC/eY6ms46Y8bGqaJyzgW3EHHzH++kMuovXmyjQo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Merge #1543 X-Act-Checkin: gcc X-Git-Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: e623ee314fbc9503067bbb379a4055dd4d5d245b X-Git-Newrev: bef31ea273689021f0fc8168f417edf386060512 Message-Id: <20221010073403.A86893858C53@sourceware.org> Date: Mon, 10 Oct 2022 07:34:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:bef31ea273689021f0fc8168f417edf386060512 commit bef31ea273689021f0fc8168f417edf386060512 Merge: e623ee314fb bb5efc657ae Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Fri Oct 7 11:03:59 2022 +0000 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 Diff: .github/bors_log_expected_warnings | 8 +-- gcc/Makefile.in | 34 +++++++++- gcc/config.gcc | 27 ++++++++ gcc/config/darwin-rust.cc | 44 +++++++++++++ gcc/config/default-rust.cc | 29 +++++++++ gcc/config/i386/i386-rust.cc | 129 +++++++++++++++++++++++++++++++++++++ gcc/config/i386/i386-rust.h | 22 +++++++ gcc/config/i386/t-i386 | 4 ++ gcc/config/t-darwin | 4 ++ gcc/configure | 21 +++++- gcc/configure.ac | 14 ++++ gcc/doc/tm.texi | 26 ++++++++ gcc/doc/tm.texi.in | 17 +++++ gcc/genhooks.cc | 1 + gcc/rust/rust-lang.cc | 2 - gcc/rust/rust-session-manager.cc | 8 ++- gcc/rust/rust-target-def.h | 20 ++++++ gcc/rust/rust-target.def | 52 +++++++++++++++ gcc/rust/rust-target.h | 35 ++++++++++ 19 files changed, 487 insertions(+), 10 deletions(-)