1 /* Linux support needed only by Rust front-end.
2 Copyright (C) 2022-2024 Free Software Foundation, Inc.
4 GCC is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 3, or (at your option) any later
9 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with GCC; see the file COPYING3. If not see
16 <http://www.gnu.org/licenses/>. */
20 #include "coretypes.h"
23 #include "rust/rust-target.h"
24 #include "rust/rust-target-def.h"
26 /* `-mandroid' is not available as an command-line option. */
27 #ifndef TARGET_ANDROID
28 #define TARGET_ANDROID 0
31 /* Implement TARGET_RUST_OS_INFO for Linux targets. */
34 linux_rust_target_os_info (void)
36 rust_add_target_info ("target_family", "unix");
37 rust_add_target_info ("target_vendor", "unknown");
40 rust_add_target_info ("target_os", "android");
42 rust_add_target_info ("target_os", "linux");
45 rust_add_target_info ("target_env", "gnu");
47 rust_add_target_info ("target_env", "musl");
48 else if (OPTION_UCLIBC
)
49 rust_add_target_info ("target_env", "uclibc");
51 rust_add_target_info ("target_env", "");
54 #undef TARGET_RUST_OS_INFO
55 #define TARGET_RUST_OS_INFO linux_rust_target_os_info
57 struct gcc_targetrustm targetrustm
= TARGETRUSTM_INITIALIZER
;