From 8e1110d23a9a0aac51ac6b2d6634c92fdf93e49a Mon Sep 17 00:00:00 2001 From: yangxiaojuan Date: Tue, 11 Apr 2023 19:39:43 +0800 Subject: [PATCH] Add loongarch64 support for rust-1.60.0 --- ...-loongarch64-support-for-rust-1.60.0.patch | 526 ++-- ...-loongarch64-support-for-rust-1.60.0.patch | 2122 +++++++++++++++-- ...64_unknown_linux_gnuf64-to-loongarch.patch | 122 - rust.spec | 11 +- 4 files changed, 2164 insertions(+), 617 deletions(-) rename 0001-Add-loongarch64-support-for-rust-1.57.patch => 0001-Add-base-loongarch64-support-for-rust-1.60.0.patch (79%) rename 0002-vendor-Add-loongarch64-support.patch => 0002-vendor-Add-loongarch64-support-for-rust-1.60.0.patch (45%) delete mode 100644 0003-Rename-loongarch64_unknown_linux_gnuf64-to-loongarch.patch diff --git a/0001-Add-loongarch64-support-for-rust-1.57.patch b/0001-Add-base-loongarch64-support-for-rust-1.60.0.patch similarity index 79% rename from 0001-Add-loongarch64-support-for-rust-1.57.patch rename to 0001-Add-base-loongarch64-support-for-rust-1.60.0.patch index 58b8588..43f33d7 100644 --- a/0001-Add-loongarch64-support-for-rust-1.57.patch +++ b/0001-Add-base-loongarch64-support-for-rust-1.60.0.patch @@ -1,15 +1,15 @@ -From ac473f6e945bab2355a797f8a2112a1ba66844c6 Mon Sep 17 00:00:00 2001 +From 14bbaa0f488457ce39ef7f7f730a73693a593611 Mon Sep 17 00:00:00 2001 From: yangxiaojuan -Date: Thu, 29 Dec 2022 16:04:09 +0800 -Subject: [PATCH 1/2] Add loongarch64 support for rust-1.57 +Date: Mon, 10 Apr 2023 19:57:28 +0800 +Subject: [PATCH 1/2] Add base loongarch64 support for rust-1.60.0 --- + compiler/rustc_ast_lowering/src/asm.rs | 1 + .../example/alloc_system.rs | 1 + - .../rustc_codegen_cranelift/src/metadata.rs | 1 + .../rustc_codegen_gcc/example/alloc_system.rs | 1 + compiler/rustc_codegen_gcc/src/asm.rs | 5 + compiler/rustc_codegen_llvm/src/asm.rs | 6 + - compiler/rustc_codegen_ssa/src/back/link.rs | 8 + + .../rustc_codegen_ssa/src/back/metadata.rs | 5 + .../rustc_codegen_ssa/src/target_features.rs | 7 + compiler/rustc_feature/src/active.rs | 1 + compiler/rustc_llvm/build.rs | 1 + @@ -18,9 +18,9 @@ Subject: [PATCH 1/2] Add loongarch64 support for rust-1.57 compiler/rustc_span/src/symbol.rs | 1 + .../rustc_target/src/abi/call/loongarch.rs | 342 ++++++++++++++++++ compiler/rustc_target/src/abi/call/mod.rs | 2 + - compiler/rustc_target/src/asm/loongarch.rs | 130 +++++++ - compiler/rustc_target/src/asm/mod.rs | 25 ++ - .../spec/loongarch64_unknown_linux_gnuf64.rs | 18 + + compiler/rustc_target/src/asm/loongarch.rs | 131 +++++++ + compiler/rustc_target/src/asm/mod.rs | 29 ++ + .../src/spec/loongarch64_unknown_linux_gnu.rs | 17 + compiler/rustc_target/src/spec/mod.rs | 1 + compiler/rustc_typeck/src/collect.rs | 1 + library/core/src/lib.rs | 1 + @@ -31,13 +31,11 @@ Subject: [PATCH 1/2] Add loongarch64 support for rust-1.57 library/unwind/src/libunwind.rs | 3 + src/bootstrap/bootstrap.py | 1 + src/bootstrap/native.rs | 2 +- - src/ci/github-actions/ci.yml | 3 + src/doc/rustc/src/platform-support.md | 1 + src/librustdoc/clean/cfg.rs | 1 + src/test/assembly/asm/loongarch-types.rs | 194 ++++++++++ .../codegen/abi-main-signature-16bit-c-int.rs | 1 + src/test/codegen/call-llvm-intrinsics.rs | 1 + - src/test/codegen/fastcall-inreg.rs | 1 + src/test/codegen/global_asm.rs | 1 + src/test/codegen/global_asm_include.rs | 1 + src/test/codegen/global_asm_x2.rs | 1 + @@ -48,29 +46,33 @@ Subject: [PATCH 1/2] Add loongarch64 support for rust-1.57 src/test/codegen/stack-probes.rs | 1 + .../atomic-lock-free/Makefile | 4 + src/test/ui/abi/stack-probes-lto.rs | 1 + - src/test/ui/borrowck/borrowck-asm.rs | 1 + src/test/ui/cfg/conditional-compile-arch.rs | 3 + src/test/ui/empty_global_asm.rs | 3 + - src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs | 1 + - .../ui/llvm-asm/llvm-asm-in-bad-modifier.rs | 1 + - .../ui/llvm-asm/llvm-asm-misplaced-option.rs | 1 + - .../ui/llvm-asm/llvm-asm-out-assign-imm.rs | 1 + - .../ui/llvm-asm/llvm-asm-out-no-modifier.rs | 1 + - .../ui/llvm-asm/llvm-asm-out-read-uninit.rs | 1 + src/test/ui/target-feature/gate.rs | 2 + .../ui/target-feature/invalid-attribute.rs | 1 + src/tools/build-manifest/src/main.rs | 2 + src/tools/clippy/tests/ui/asm_syntax.rs | 1 + - src/tools/compiletest/src/json.rs | 4 +- src/tools/compiletest/src/util.rs | 3 +- src/tools/miri/src/shims/foreign_items.rs | 2 +- - 60 files changed, 846 insertions(+), 5 deletions(-) + 50 files changed, 834 insertions(+), 3 deletions(-) create mode 100644 compiler/rustc_target/src/abi/call/loongarch.rs create mode 100644 compiler/rustc_target/src/asm/loongarch.rs - create mode 100644 compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnuf64.rs + create mode 100644 compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs create mode 100644 src/test/assembly/asm/loongarch-types.rs create mode 100644 src/test/codegen/loongarch-abi/call-llvm-intrinsics.rs +diff --git a/compiler/rustc_ast_lowering/src/asm.rs b/compiler/rustc_ast_lowering/src/asm.rs +index 18fcc99ff..6c59dbbad 100644 +--- a/compiler/rustc_ast_lowering/src/asm.rs ++++ b/compiler/rustc_ast_lowering/src/asm.rs +@@ -30,6 +30,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { + | asm::InlineAsmArch::AArch64 + | asm::InlineAsmArch::RiscV32 + | asm::InlineAsmArch::RiscV64 ++ | asm::InlineAsmArch::LoongArch64 + ); + if !is_stable && !self.sess.features_untracked().asm_experimental_arch { + feature_err( diff --git a/compiler/rustc_codegen_cranelift/example/alloc_system.rs b/compiler/rustc_codegen_cranelift/example/alloc_system.rs index 5f66ca67f..c11979acd 100644 --- a/compiler/rustc_codegen_cranelift/example/alloc_system.rs @@ -83,18 +85,6 @@ index 5f66ca67f..c11979acd 100644 target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64")))] -diff --git a/compiler/rustc_codegen_cranelift/src/metadata.rs b/compiler/rustc_codegen_cranelift/src/metadata.rs -index 1c8fd0b01..c06876ad2 100644 ---- a/compiler/rustc_codegen_cranelift/src/metadata.rs -+++ b/compiler/rustc_codegen_cranelift/src/metadata.rs -@@ -31,6 +31,7 @@ pub(crate) fn new_metadata_object( - target_lexicon::Architecture::Arm(_) => object::Architecture::Arm, - target_lexicon::Architecture::Avr => object::Architecture::Avr, - target_lexicon::Architecture::Hexagon => object::Architecture::Hexagon, -+ target_lexicon::Architecture::LoongArch64(_) => object::Architecture::LoongArch64, - target_lexicon::Architecture::Mips32(_) => object::Architecture::Mips, - target_lexicon::Architecture::Mips64(_) => object::Architecture::Mips64, - target_lexicon::Architecture::Msp430 => object::Architecture::Msp430, diff --git a/compiler/rustc_codegen_gcc/example/alloc_system.rs b/compiler/rustc_codegen_gcc/example/alloc_system.rs index 5f66ca67f..c11979acd 100644 --- a/compiler/rustc_codegen_gcc/example/alloc_system.rs @@ -108,48 +98,48 @@ index 5f66ca67f..c11979acd 100644 target_arch = "s390x", target_arch = "sparc64")))] diff --git a/compiler/rustc_codegen_gcc/src/asm.rs b/compiler/rustc_codegen_gcc/src/asm.rs -index 3b77097e9..6016ca480 100644 +index 8a74c4c07..ec8f680cf 100644 --- a/compiler/rustc_codegen_gcc/src/asm.rs +++ b/compiler/rustc_codegen_gcc/src/asm.rs -@@ -572,6 +572,8 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister { - | InlineAsmRegClass::Arm(ArmInlineAsmRegClass::qreg) => unimplemented!(), +@@ -558,6 +558,8 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister { + InlineAsmRegClass::Avr(_) => unimplemented!(), InlineAsmRegClass::Bpf(_) => unimplemented!(), InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => unimplemented!(), + InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::reg) => unimplemented!(), + InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::freg) => unimplemented!(), InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => unimplemented!(), InlineAsmRegClass::Mips(MipsInlineAsmRegClass::freg) => unimplemented!(), - InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg16) => unimplemented!(), -@@ -634,6 +636,8 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl - } + InlineAsmRegClass::Msp430(_) => unimplemented!(), +@@ -621,6 +623,8 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl + InlineAsmRegClass::Avr(_) => unimplemented!(), InlineAsmRegClass::Bpf(_) => unimplemented!(), InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => cx.type_i32(), + InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::reg) => cx.type_i32(), + InlineAsmRegClass::LoongArch(LoongArchInlineAsmRegClass::freg) => cx.type_f32(), InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => cx.type_i32(), InlineAsmRegClass::Mips(MipsInlineAsmRegClass::freg) => cx.type_f32(), - InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg16) => cx.type_i16(), -@@ -742,6 +746,7 @@ fn modifier_to_gcc(arch: InlineAsmArch, reg: InlineAsmRegClass, modifier: Option - } + InlineAsmRegClass::Msp430(_) => unimplemented!(), +@@ -730,6 +734,7 @@ fn modifier_to_gcc(arch: InlineAsmArch, reg: InlineAsmRegClass, modifier: Option + InlineAsmRegClass::Avr(_) => unimplemented!(), InlineAsmRegClass::Bpf(_) => unimplemented!(), InlineAsmRegClass::Hexagon(_) => unimplemented!(), + InlineAsmRegClass::LoongArch(_) => unimplemented!(), InlineAsmRegClass::Mips(_) => unimplemented!(), + InlineAsmRegClass::Msp430(_) => unimplemented!(), InlineAsmRegClass::Nvptx(_) => unimplemented!(), - InlineAsmRegClass::PowerPC(_) => unimplemented!(), diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs -index 341a88824..95db9af9d 100644 +index e22bec249..2b6d95c29 100644 --- a/compiler/rustc_codegen_llvm/src/asm.rs +++ b/compiler/rustc_codegen_llvm/src/asm.rs -@@ -318,6 +318,7 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> { - InlineAsmArch::SpirV => {} - InlineAsmArch::Wasm32 => {} - InlineAsmArch::Bpf => {} +@@ -235,6 +235,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { + InlineAsmArch::Msp430 => { + constraints.push("~{sr}".to_string()); + } + InlineAsmArch::LoongArch64 => {} } } if !options.contains(InlineAsmOptions::NOMEM) { -@@ -643,6 +644,8 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'tcx>>) +@@ -587,6 +588,8 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) -> InlineAsmRegClass::SpirV(SpirVInlineAsmRegClass::reg) => { bug!("LLVM backend does not support SPIR-V") } @@ -158,7 +148,7 @@ index 341a88824..95db9af9d 100644 InlineAsmRegClass::Err => unreachable!(), } .to_string(), -@@ -722,6 +725,7 @@ fn modifier_to_llvm( +@@ -674,6 +677,7 @@ fn modifier_to_llvm( InlineAsmRegClass::SpirV(SpirVInlineAsmRegClass::reg) => { bug!("LLVM backend does not support SPIR-V") } @@ -166,7 +156,7 @@ index 341a88824..95db9af9d 100644 InlineAsmRegClass::Err => unreachable!(), } } -@@ -786,6 +790,8 @@ fn dummy_output_type(cx: &CodegenCx<'ll, 'tcx>, reg: InlineAsmRegClass) -> &'ll +@@ -743,6 +747,8 @@ fn dummy_output_type<'ll>(cx: &CodegenCx<'ll, '_>, reg: InlineAsmRegClass) -> &' InlineAsmRegClass::SpirV(SpirVInlineAsmRegClass::reg) => { bug!("LLVM backend does not support SPIR-V") } @@ -175,37 +165,34 @@ index 341a88824..95db9af9d 100644 InlineAsmRegClass::Err => unreachable!(), } } -diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index cf1c60588..926eb8d57 100644 ---- a/compiler/rustc_codegen_ssa/src/back/link.rs -+++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -392,6 +392,7 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>( - "aarch64" => Architecture::Aarch64, - "x86" => Architecture::I386, - "s390x" => Architecture::S390x, -+ "loongarch64" => Architecture::LoongArch64, - "mips" => Architecture::Mips, - "mips64" => Architecture::Mips64, - "x86_64" => { -@@ -447,6 +448,13 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>( - let mut file = Object::new(BinaryFormat::Elf, architecture, endianness); - - match &sess.target.arch[..] { -+ // copied from `loongarch64-linux-gnu-gcc foo.c -c` and -+ // inspecting the resulting `e_flags` field. -+ "loongarch64" => { -+ let e_flags = elf::EF_LOONGARCH_OBJABI_V1 | elf::EF_LOONGARCH_ABI_DOUBLE_FLOAT; -+ file.flags = FileFlags::Elf { e_flags }; -+ } -+ - // copied from `mipsel-linux-gnu-gcc foo.c -c` and - // inspecting the resulting `e_flags` field. - "mips" => { +diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs +index 9ebbcac76..c1382b75b 100644 +--- a/compiler/rustc_codegen_ssa/src/back/metadata.rs ++++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs +@@ -119,6 +119,7 @@ fn create_object_file(sess: &Session) -> Option> { + "riscv32" => Architecture::Riscv32, + "riscv64" => Architecture::Riscv64, + "sparc64" => Architecture::Sparc64, ++ "loongarch64" => Architecture::LoongArch64, + // Unsupported architecture. + _ => return None, + }; +@@ -162,6 +163,10 @@ fn create_object_file(sess: &Session) -> Option> { + let e_flags = elf::EF_RISCV_RVC | elf::EF_RISCV_FLOAT_ABI_DOUBLE; + file.flags = FileFlags::Elf { e_flags }; + } ++ Architecture::LoongArch64 => { ++ let e_flags = elf::EF_LOONGARCH_OBJABI_V1 | elf::EF_LOONGARCH_ABI_DOUBLE_FLOAT; ++ file.flags = FileFlags::Elf { e_flags }; ++ } + _ => {} + }; + Some(file) diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs -index 8d7e9612f..1bd2ea2f6 100644 +index f31b0ee59..6c0d55e59 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs -@@ -181,6 +181,11 @@ const HEXAGON_ALLOWED_FEATURES: &[(&str, Option)] = &[ +@@ -198,6 +198,11 @@ const HEXAGON_ALLOWED_FEATURES: &[(&str, Option)] = &[ ("hvx-length128b", Some(sym::hexagon_target_feature)), ]; @@ -217,7 +204,7 @@ index 8d7e9612f..1bd2ea2f6 100644 const POWERPC_ALLOWED_FEATURES: &[(&str, Option)] = &[ ("altivec", Some(sym::powerpc_target_feature)), ("power8-altivec", Some(sym::powerpc_target_feature)), -@@ -225,6 +230,7 @@ pub fn all_known_features() -> impl Iterator impl Iterator &'static [(&'static str, Opt +@@ -256,6 +262,7 @@ pub fn supported_target_features(sess: &Session) -> &'static [(&'static str, Opt "riscv32" | "riscv64" => RISCV_ALLOWED_FEATURES, "wasm32" | "wasm64" => WASM_ALLOWED_FEATURES, "bpf" => BPF_ALLOWED_FEATURES, @@ -234,19 +221,19 @@ index 8d7e9612f..1bd2ea2f6 100644 } } diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs -index 0ba764021..fa0ca0fe1 100644 +index 5545abc60..7d1ae530d 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs -@@ -271,6 +271,7 @@ declare_features! ( - (active, riscv_target_feature, "1.45.0", Some(44839), None), +@@ -242,6 +242,7 @@ declare_features! ( (active, ermsb_target_feature, "1.49.0", Some(44839), None), - (active, bpf_target_feature, "1.54.0", Some(44839), None), + (active, f16c_target_feature, "1.36.0", Some(44839), None), + (active, hexagon_target_feature, "1.27.0", Some(44839), None), + //(active, loongarch64_target_feature, "1.57.0", Some(44839), None), - - // ------------------------------------------------------------------------- - // feature-group-end: actual feature gates (target features) + (active, mips_target_feature, "1.27.0", Some(44839), None), + (active, movbe_target_feature, "1.34.0", Some(44839), None), + (active, powerpc_target_feature, "1.27.0", Some(44839), None), diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs -index 36a6d2cc3..052da337d 100644 +index 3b6808d69..1908f4a7a 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -76,6 +76,7 @@ fn main() { @@ -258,10 +245,10 @@ index 36a6d2cc3..052da337d 100644 "mips", "powerpc", diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -index 87f423fb2..39e946511 100644 +index 7030fd537..286b03368 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp -@@ -251,6 +251,12 @@ void LLVMRustAddLastExtensionPasses( +@@ -257,6 +257,12 @@ void LLVMRustAddLastExtensionPasses( #define SUBTARGET_HEXAGON #endif @@ -274,7 +261,7 @@ index 87f423fb2..39e946511 100644 #define GEN_SUBTARGETS \ SUBTARGET_X86 \ SUBTARGET_ARM \ -@@ -264,6 +270,7 @@ void LLVMRustAddLastExtensionPasses( +@@ -270,6 +276,7 @@ void LLVMRustAddLastExtensionPasses( SUBTARGET_SPARC \ SUBTARGET_HEXAGON \ SUBTARGET_RISCV \ @@ -283,7 +270,7 @@ index 87f423fb2..39e946511 100644 #define SUBTARGET(x) \ namespace llvm { \ diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs -index 6493bd91c..7fff370c7 100644 +index 8476c2bfc..259cfbc08 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -102,6 +102,14 @@ pub fn initialize_available_targets() { @@ -302,10 +289,10 @@ index 6493bd91c..7fff370c7 100644 llvm_component = "mips", LLVMInitializeMipsTargetInfo, diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs -index 16205ad1c..389cf6b28 100644 +index c746255e9..a33f16e45 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs -@@ -785,6 +785,7 @@ symbols! { +@@ -836,6 +836,7 @@ symbols! { log_syntax, logf32, logf64, @@ -662,10 +649,10 @@ index 000000000..fbe7f7e29 + } +} diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs -index d9eb299e2..362d0e6fe 100644 +index 34324a582..3bd7b808e 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs -@@ -9,6 +9,7 @@ mod arm; +@@ -10,6 +10,7 @@ mod arm; mod avr; mod bpf; mod hexagon; @@ -673,7 +660,7 @@ index d9eb299e2..362d0e6fe 100644 mod m68k; mod mips; mod mips64; -@@ -657,6 +658,7 @@ impl<'a, Ty> FnAbi<'a, Ty> { +@@ -686,6 +687,7 @@ impl<'a, Ty> FnAbi<'a, Ty> { "amdgpu" => amdgpu::compute_abi_info(cx, self), "arm" => arm::compute_abi_info(cx, self), "avr" => avr::compute_abi_info(self), @@ -683,12 +670,13 @@ index d9eb299e2..362d0e6fe 100644 "mips64" => mips64::compute_abi_info(cx, self), diff --git a/compiler/rustc_target/src/asm/loongarch.rs b/compiler/rustc_target/src/asm/loongarch.rs new file mode 100644 -index 000000000..262d80eab +index 000000000..f1b879662 --- /dev/null +++ b/compiler/rustc_target/src/asm/loongarch.rs -@@ -0,0 +1,130 @@ +@@ -0,0 +1,131 @@ +use super::{InlineAsmArch, InlineAsmType}; +use rustc_macros::HashStable_Generic; ++use rustc_span::Symbol; +use std::fmt; + +def_reg_class! { @@ -722,7 +710,7 @@ index 000000000..262d80eab + pub fn supported_types( + self, + arch: InlineAsmArch, -+ ) -> &'static [(InlineAsmType, Option<&'static str>)] { ++ ) -> &'static [(InlineAsmType, Option)] { + match (self, arch) { + (Self::reg, InlineAsmArch::LoongArch64) => types! { _: I8, I16, I32, I64, F32, F64; }, + (Self::reg, _) => types! { _: I8, I16, I32, F32; }, @@ -818,34 +806,34 @@ index 000000000..262d80eab + } +} diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs -index 99699c50d..e23d23b77 100644 +index fd95b0338..2b29a8b2f 100644 --- a/compiler/rustc_target/src/asm/mod.rs +++ b/compiler/rustc_target/src/asm/mod.rs -@@ -150,6 +150,7 @@ mod aarch64; - mod arm; +@@ -152,6 +152,7 @@ mod arm; + mod avr; mod bpf; mod hexagon; +mod loongarch; mod mips; + mod msp430; mod nvptx; - mod powerpc; -@@ -163,6 +164,7 @@ pub use aarch64::{AArch64InlineAsmReg, AArch64InlineAsmRegClass}; - pub use arm::{ArmInlineAsmReg, ArmInlineAsmRegClass}; +@@ -167,6 +168,7 @@ pub use arm::{ArmInlineAsmReg, ArmInlineAsmRegClass}; + pub use avr::{AvrInlineAsmReg, AvrInlineAsmRegClass}; pub use bpf::{BpfInlineAsmReg, BpfInlineAsmRegClass}; pub use hexagon::{HexagonInlineAsmReg, HexagonInlineAsmRegClass}; +pub use loongarch::{LoongArchInlineAsmReg, LoongArchInlineAsmRegClass}; pub use mips::{MipsInlineAsmReg, MipsInlineAsmRegClass}; + pub use msp430::{Msp430InlineAsmReg, Msp430InlineAsmRegClass}; pub use nvptx::{NvptxInlineAsmReg, NvptxInlineAsmRegClass}; - pub use powerpc::{PowerPCInlineAsmReg, PowerPCInlineAsmRegClass}; -@@ -190,6 +192,7 @@ pub enum InlineAsmArch { - SpirV, - Wasm32, +@@ -198,6 +200,7 @@ pub enum InlineAsmArch { Bpf, + Avr, + Msp430, + LoongArch64, } impl FromStr for InlineAsmArch { -@@ -207,6 +210,7 @@ impl FromStr for InlineAsmArch { +@@ -215,6 +218,7 @@ impl FromStr for InlineAsmArch { "powerpc" => Ok(Self::PowerPC), "powerpc64" => Ok(Self::PowerPC64), "hexagon" => Ok(Self::Hexagon), @@ -853,7 +841,7 @@ index 99699c50d..e23d23b77 100644 "mips" => Ok(Self::Mips), "mips64" => Ok(Self::Mips64), "s390x" => Ok(Self::S390x), -@@ -238,6 +242,7 @@ pub enum InlineAsmReg { +@@ -249,6 +253,7 @@ pub enum InlineAsmReg { Nvptx(NvptxInlineAsmReg), PowerPC(PowerPCInlineAsmReg), Hexagon(HexagonInlineAsmReg), @@ -861,7 +849,7 @@ index 99699c50d..e23d23b77 100644 Mips(MipsInlineAsmReg), S390x(S390xInlineAsmReg), SpirV(SpirVInlineAsmReg), -@@ -256,6 +261,7 @@ impl InlineAsmReg { +@@ -269,6 +274,7 @@ impl InlineAsmReg { Self::RiscV(r) => r.name(), Self::PowerPC(r) => r.name(), Self::Hexagon(r) => r.name(), @@ -869,7 +857,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.name(), Self::S390x(r) => r.name(), Self::Bpf(r) => r.name(), -@@ -271,6 +277,7 @@ impl InlineAsmReg { +@@ -286,6 +292,7 @@ impl InlineAsmReg { Self::RiscV(r) => InlineAsmRegClass::RiscV(r.reg_class()), Self::PowerPC(r) => InlineAsmRegClass::PowerPC(r.reg_class()), Self::Hexagon(r) => InlineAsmRegClass::Hexagon(r.reg_class()), @@ -877,17 +865,21 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => InlineAsmRegClass::Mips(r.reg_class()), Self::S390x(r) => InlineAsmRegClass::S390x(r.reg_class()), Self::Bpf(r) => InlineAsmRegClass::Bpf(r.reg_class()), -@@ -309,6 +316,9 @@ impl InlineAsmReg { - InlineAsmArch::Hexagon => { - Self::Hexagon(HexagonInlineAsmReg::parse(arch, has_feature, target, &name)?) - } -+ InlineAsmArch::LoongArch64 => { -+ Self::LoongArch(LoongArchInlineAsmReg::parse(arch, has_feature, target, &name)?) -+ } - InlineAsmArch::Mips | InlineAsmArch::Mips64 => { - Self::Mips(MipsInlineAsmReg::parse(arch, has_feature, target, &name)?) - } -@@ -342,6 +352,7 @@ impl InlineAsmReg { +@@ -339,6 +346,13 @@ impl InlineAsmReg { + is_clobber, + name, + )?), ++ InlineAsmArch::LoongArch64 => Self::LoongArch(LoongArchInlineAsmReg::parse( ++ arch, ++ target_features, ++ target, ++ is_clobber, ++ name, ++ )?), + InlineAsmArch::Mips | InlineAsmArch::Mips64 => Self::Mips(MipsInlineAsmReg::parse( + arch, + target_features, +@@ -398,6 +412,7 @@ impl InlineAsmReg { Self::RiscV(r) => r.emit(out, arch, modifier), Self::PowerPC(r) => r.emit(out, arch, modifier), Self::Hexagon(r) => r.emit(out, arch, modifier), @@ -895,7 +887,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.emit(out, arch, modifier), Self::S390x(r) => r.emit(out, arch, modifier), Self::Bpf(r) => r.emit(out, arch, modifier), -@@ -357,6 +368,7 @@ impl InlineAsmReg { +@@ -415,6 +430,7 @@ impl InlineAsmReg { Self::RiscV(_) => cb(self), Self::PowerPC(r) => r.overlapping_regs(|r| cb(Self::PowerPC(r))), Self::Hexagon(r) => r.overlapping_regs(|r| cb(Self::Hexagon(r))), @@ -903,7 +895,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(_) => cb(self), Self::S390x(_) => cb(self), Self::Bpf(r) => r.overlapping_regs(|r| cb(Self::Bpf(r))), -@@ -385,6 +397,7 @@ pub enum InlineAsmRegClass { +@@ -445,6 +461,7 @@ pub enum InlineAsmRegClass { Nvptx(NvptxInlineAsmRegClass), PowerPC(PowerPCInlineAsmRegClass), Hexagon(HexagonInlineAsmRegClass), @@ -911,7 +903,7 @@ index 99699c50d..e23d23b77 100644 Mips(MipsInlineAsmRegClass), S390x(S390xInlineAsmRegClass), SpirV(SpirVInlineAsmRegClass), -@@ -404,6 +417,7 @@ impl InlineAsmRegClass { +@@ -466,6 +483,7 @@ impl InlineAsmRegClass { Self::Nvptx(r) => r.name(), Self::PowerPC(r) => r.name(), Self::Hexagon(r) => r.name(), @@ -919,7 +911,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.name(), Self::S390x(r) => r.name(), Self::SpirV(r) => r.name(), -@@ -425,6 +439,7 @@ impl InlineAsmRegClass { +@@ -489,6 +507,7 @@ impl InlineAsmRegClass { Self::Nvptx(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Nvptx), Self::PowerPC(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::PowerPC), Self::Hexagon(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Hexagon), @@ -927,7 +919,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Mips), Self::S390x(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::S390x), Self::SpirV(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::SpirV), -@@ -453,6 +468,7 @@ impl InlineAsmRegClass { +@@ -519,6 +538,7 @@ impl InlineAsmRegClass { Self::Nvptx(r) => r.suggest_modifier(arch, ty), Self::PowerPC(r) => r.suggest_modifier(arch, ty), Self::Hexagon(r) => r.suggest_modifier(arch, ty), @@ -935,7 +927,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.suggest_modifier(arch, ty), Self::S390x(r) => r.suggest_modifier(arch, ty), Self::SpirV(r) => r.suggest_modifier(arch, ty), -@@ -477,6 +493,7 @@ impl InlineAsmRegClass { +@@ -545,6 +565,7 @@ impl InlineAsmRegClass { Self::Nvptx(r) => r.default_modifier(arch), Self::PowerPC(r) => r.default_modifier(arch), Self::Hexagon(r) => r.default_modifier(arch), @@ -943,7 +935,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.default_modifier(arch), Self::S390x(r) => r.default_modifier(arch), Self::SpirV(r) => r.default_modifier(arch), -@@ -500,6 +517,7 @@ impl InlineAsmRegClass { +@@ -570,6 +591,7 @@ impl InlineAsmRegClass { Self::Nvptx(r) => r.supported_types(arch), Self::PowerPC(r) => r.supported_types(arch), Self::Hexagon(r) => r.supported_types(arch), @@ -951,7 +943,7 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.supported_types(arch), Self::S390x(r) => r.supported_types(arch), Self::SpirV(r) => r.supported_types(arch), -@@ -524,6 +542,7 @@ impl InlineAsmRegClass { +@@ -596,6 +618,7 @@ impl InlineAsmRegClass { Self::PowerPC(PowerPCInlineAsmRegClass::parse(arch, name)?) } InlineAsmArch::Hexagon => Self::Hexagon(HexagonInlineAsmRegClass::parse(arch, name)?), @@ -959,7 +951,7 @@ index 99699c50d..e23d23b77 100644 InlineAsmArch::Mips | InlineAsmArch::Mips64 => { Self::Mips(MipsInlineAsmRegClass::parse(arch, name)?) } -@@ -545,6 +564,7 @@ impl InlineAsmRegClass { +@@ -621,6 +644,7 @@ impl InlineAsmRegClass { Self::Nvptx(r) => r.valid_modifiers(arch), Self::PowerPC(r) => r.valid_modifiers(arch), Self::Hexagon(r) => r.valid_modifiers(arch), @@ -967,59 +959,58 @@ index 99699c50d..e23d23b77 100644 Self::Mips(r) => r.valid_modifiers(arch), Self::S390x(r) => r.valid_modifiers(arch), Self::SpirV(r) => r.valid_modifiers(arch), -@@ -710,6 +730,11 @@ pub fn allocatable_registers( - hexagon::fill_reg_map(arch, has_feature, target, &mut map); +@@ -788,6 +812,11 @@ pub fn allocatable_registers( + hexagon::fill_reg_map(arch, target_features, target, &mut map); map } + InlineAsmArch::LoongArch64 => { + let mut map = loongarch::regclass_map(); -+ loongarch::fill_reg_map(arch, has_feature, target, &mut map); ++ loongarch::fill_reg_map(arch, target_features, target, &mut map); + map + } InlineAsmArch::Mips | InlineAsmArch::Mips64 => { let mut map = mips::regclass_map(); - mips::fill_reg_map(arch, has_feature, target, &mut map); -diff --git a/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnuf64.rs b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnuf64.rs + mips::fill_reg_map(arch, target_features, target, &mut map); +diff --git a/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs new file mode 100644 -index 000000000..83114e3e5 +index 000000000..a751cbfaa --- /dev/null -+++ b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnuf64.rs -@@ -0,0 +1,18 @@ -+use crate::spec::{CodeModel, Target, TargetOptions}; ++++ b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs +@@ -0,0 +1,17 @@ ++use crate::spec::{Target, TargetOptions}; + +pub fn target() -> Target { + Target { -+ llvm_target: "loongarch64-unknown-linux-gnuf64".into(), ++ llvm_target: "loongarch64-unknown-linux-gnu".to_string(), + pointer_width: 64, -+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(), -+ arch: "loongarch64".into(), ++ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(), ++ arch: "loongarch64".to_string(), + options: TargetOptions { -+ code_model: Some(CodeModel::Medium), -+ cpu: "la464".into(), -+ features: "+d".into(), -+ llvm_abiname: "lp64d".into(), ++ cpu: "generic-la64".to_string(), ++ features: "+f,+d".to_string(), ++ llvm_abiname: "lp64d".to_string(), + max_atomic_width: Some(64), + ..super::linux_gnu_base::opts() + }, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index ff5dfa3f7..772cc4274 100644 +index 92678aed5..7574d32f3 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs -@@ -790,6 +790,7 @@ supported_targets! { +@@ -852,6 +852,7 @@ supported_targets! { ("mips64-unknown-linux-muslabi64", mips64_unknown_linux_muslabi64), ("mips64el-unknown-linux-muslabi64", mips64el_unknown_linux_muslabi64), ("hexagon-unknown-linux-musl", hexagon_unknown_linux_musl), -+ ("loongarch64-unknown-linux-gnuf64", loongarch64_unknown_linux_gnuf64), ++ ("loongarch64-unknown-linux-gnu", loongarch64_unknown_linux_gnu), ("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc), ("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc), diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs -index df7f2aea9..7c86565f0 100644 +index 18f54eb22..6d4df66c7 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs -@@ -2602,6 +2602,7 @@ fn from_target_feature( +@@ -2694,6 +2694,7 @@ fn from_target_feature( Some(sym::arm_target_feature) => rust_features.arm_target_feature, Some(sym::aarch64_target_feature) => rust_features.aarch64_target_feature, Some(sym::hexagon_target_feature) => rust_features.hexagon_target_feature, @@ -1028,10 +1019,10 @@ index df7f2aea9..7c86565f0 100644 Some(sym::mips_target_feature) => rust_features.mips_target_feature, Some(sym::riscv_target_feature) => rust_features.riscv_target_feature, diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs -index 13b80c05d..4801f5043 100644 +index aa1ad9362..cb95e2d00 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs -@@ -197,6 +197,7 @@ +@@ -209,6 +209,7 @@ #![feature(cmpxchg16b_target_feature)] #![feature(f16c_target_feature)] #![feature(hexagon_target_feature)] @@ -1040,10 +1031,10 @@ index 13b80c05d..4801f5043 100644 #![feature(powerpc_target_feature)] #![feature(rtm_target_feature)] diff --git a/library/panic_unwind/src/gcc.rs b/library/panic_unwind/src/gcc.rs -index 9d6ede73e..f7a2ce8cf 100644 +index a0297b4b2..24a70e1c0 100644 --- a/library/panic_unwind/src/gcc.rs +++ b/library/panic_unwind/src/gcc.rs -@@ -123,6 +123,9 @@ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1 +@@ -126,6 +126,9 @@ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1 #[cfg(any(target_arch = "riscv64", target_arch = "riscv32"))] const UNWIND_DATA_REG: (i32, i32) = (10, 11); // x10, x11 @@ -1054,10 +1045,10 @@ index 9d6ede73e..f7a2ce8cf 100644 // https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/libsupc++/eh_personality.cc // https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c diff --git a/library/std/src/env.rs b/library/std/src/env.rs -index 40b46878c..748874eea 100644 +index 5ed9fa9d6..753fbf2ff 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs -@@ -879,6 +879,7 @@ pub mod consts { +@@ -894,6 +894,7 @@ pub mod consts { /// - x86_64 /// - arm /// - aarch64 @@ -1066,7 +1057,7 @@ index 40b46878c..748874eea 100644 /// - mips /// - mips64 diff --git a/library/std/src/os/linux/raw.rs b/library/std/src/os/linux/raw.rs -index cd92dcabd..1a38e97de 100644 +index d78049bce..fb3e0f4e2 100644 --- a/library/std/src/os/linux/raw.rs +++ b/library/std/src/os/linux/raw.rs @@ -232,6 +232,7 @@ mod arch { @@ -1078,22 +1069,22 @@ index cd92dcabd..1a38e97de 100644 target_arch = "s390x", target_arch = "sparc64", diff --git a/library/std/src/sys/common/alloc.rs b/library/std/src/sys/common/alloc.rs -index 576667c01..5ace3e48a 100644 +index e06eaf6db..b9dc3108d 100644 --- a/library/std/src/sys/common/alloc.rs +++ b/library/std/src/sys/common/alloc.rs -@@ -24,6 +24,7 @@ pub const MIN_ALIGN: usize = 8; - target_arch = "mips64", - target_arch = "s390x", +@@ -26,6 +26,7 @@ pub const MIN_ALIGN: usize = 8; target_arch = "sparc64", + target_arch = "riscv64", + target_arch = "wasm64", + target_arch = "loongarch64", - target_arch = "riscv64" )))] pub const MIN_ALIGN: usize = 16; + // The allocator on the esp-idf platform guarentees 4 byte alignment. diff --git a/library/unwind/src/libunwind.rs b/library/unwind/src/libunwind.rs -index 5e15fe75a..11f1c34c4 100644 +index c8c5528b1..f01ade4c0 100644 --- a/library/unwind/src/libunwind.rs +++ b/library/unwind/src/libunwind.rs -@@ -66,6 +66,9 @@ pub const unwinder_private_data_size: usize = 20; +@@ -69,6 +69,9 @@ pub const unwinder_private_data_size: usize = 20; #[cfg(all(target_arch = "hexagon", target_os = "linux"))] pub const unwinder_private_data_size: usize = 35; @@ -1104,10 +1095,10 @@ index 5e15fe75a..11f1c34c4 100644 pub struct _Unwind_Exception { pub exception_class: _Unwind_Exception_Class, diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py -index 0170be967..952b77768 100644 +index 6c1128b39..37c6413c4 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py -@@ -277,6 +277,7 @@ def default_build_triple(verbose): +@@ -318,6 +318,7 @@ def default_build_triple(verbose): 'i486': 'i686', 'i686': 'i686', 'i786': 'i686', @@ -1116,10 +1107,10 @@ index 0170be967..952b77768 100644 'powerpc': 'powerpc', 'powerpc64': 'powerpc64', diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs -index 27c9bb250..4bfb4e45b 100644 +index 8b13fb721..87a268220 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs -@@ -158,7 +158,7 @@ impl Step for Llvm { +@@ -182,7 +182,7 @@ impl Step for Llvm { let llvm_targets = match &builder.config.llvm_targets { Some(s) => s, None => { @@ -1128,37 +1119,23 @@ index 27c9bb250..4bfb4e45b 100644 Sparc;SystemZ;WebAssembly;X86" } }; -diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml -index eb16cf3c7..775f9cbf0 100644 ---- a/src/ci/github-actions/ci.yml -+++ b/src/ci/github-actions/ci.yml -@@ -335,6 +335,9 @@ jobs: - - name: dist-i686-linux - <<: *job-linux-xl - -+ - name: dist-loongarch64-linux -+ <<: *job-linux-xl -+ - - name: dist-mips-linux - <<: *job-linux-xl - diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md -index bbeab598f..3cb8ecaed 100644 +index d4a5f0e5a..c895166ab 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -83,6 +83,7 @@ target | notes `arm-unknown-linux-gnueabi` | ARMv6 Linux (kernel 3.2, glibc 2.17) `arm-unknown-linux-gnueabihf` | ARMv6 Linux, hardfloat (kernel 3.2, glibc 2.17) `armv7-unknown-linux-gnueabihf` | ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) -+`loongarch64-unknown-linux-gnuf64` | LOONGARCH64 Linux (kernel 4.19, glibc 2.28) ++`loongarch64-unknown-linux-gnu` | LOONGARCH64 Linux (kernel 4.19, glibc 2.28) `mips-unknown-linux-gnu` | MIPS Linux (kernel 4.4, glibc 2.23) `mips64-unknown-linux-gnuabi64` | MIPS64 Linux, n64 ABI (kernel 4.4, glibc 2.23) `mips64el-unknown-linux-gnuabi64` | MIPS64 (LE) Linux, n64 ABI (kernel 4.4, glibc 2.23) diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs -index 9b5ca0684..55b856c6c 100644 +index b72d26241..b3bb70fd3 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs -@@ -491,6 +491,7 @@ impl<'a> fmt::Display for Display<'a> { +@@ -514,6 +514,7 @@ impl<'a> fmt::Display for Display<'a> { "aarch64" => "AArch64", "arm" => "ARM", "asmjs" => "JavaScript", @@ -1168,16 +1145,16 @@ index 9b5ca0684..55b856c6c 100644 "mips64" => "MIPS-64", diff --git a/src/test/assembly/asm/loongarch-types.rs b/src/test/assembly/asm/loongarch-types.rs new file mode 100644 -index 000000000..34973b942 +index 000000000..9c116f730 --- /dev/null +++ b/src/test/assembly/asm/loongarch-types.rs @@ -0,0 +1,194 @@ +// min-llvm-version: 10.0.1 +// assembly-output: emit-asm -+// compile-flags: --target loongarch64-unknown-linux-gnuf64 ++// compile-flags: --target loongarch64-unknown-linux-gnu +// needs-llvm-components: loongarch + -+#![feature(no_core, lang_items, rustc_attrs)] ++#![feature(no_core, lang_items, rustc_attrs, asm_sym)] +#![crate_type = "rlib"] +#![no_core] +#![allow(asm_sub_register)] @@ -1390,20 +1367,8 @@ index 998099c23..77a11ad9f 100644 #![feature(link_llvm_intrinsics)] #![crate_type = "lib"] -diff --git a/src/test/codegen/fastcall-inreg.rs b/src/test/codegen/fastcall-inreg.rs -index adbeae454..deb353d0c 100644 ---- a/src/test/codegen/fastcall-inreg.rs -+++ b/src/test/codegen/fastcall-inreg.rs -@@ -10,6 +10,7 @@ - // ignore-bpfel - // ignore-bpfeb - // ignore-hexagon -+// ignore-loongarch64 - // ignore-mips - // ignore-mips64 - // ignore-msp430 diff --git a/src/test/codegen/global_asm.rs b/src/test/codegen/global_asm.rs -index 57d8aeb16..ac235e02c 100644 +index fab84868f..ab47178b0 100644 --- a/src/test/codegen/global_asm.rs +++ b/src/test/codegen/global_asm.rs @@ -6,6 +6,7 @@ @@ -1415,7 +1380,7 @@ index 57d8aeb16..ac235e02c 100644 // ignore-mips64 // ignore-msp430 diff --git a/src/test/codegen/global_asm_include.rs b/src/test/codegen/global_asm_include.rs -index 44402619c..9a5daa3f3 100644 +index 02ee91645..0eaecfde5 100644 --- a/src/test/codegen/global_asm_include.rs +++ b/src/test/codegen/global_asm_include.rs @@ -6,6 +6,7 @@ @@ -1427,7 +1392,7 @@ index 44402619c..9a5daa3f3 100644 // ignore-mips64 // ignore-msp430 diff --git a/src/test/codegen/global_asm_x2.rs b/src/test/codegen/global_asm_x2.rs -index d632d0dde..67f14e708 100644 +index bdcf0ea84..de2b03336 100644 --- a/src/test/codegen/global_asm_x2.rs +++ b/src/test/codegen/global_asm_x2.rs @@ -6,6 +6,7 @@ @@ -1475,11 +1440,11 @@ index 000000000..74aee760d + } +} diff --git a/src/test/codegen/repr-transparent-aggregates-1.rs b/src/test/codegen/repr-transparent-aggregates-1.rs -index 3017adb44..913ca18db 100644 +index a61dad218..70bd8a497 100644 --- a/src/test/codegen/repr-transparent-aggregates-1.rs +++ b/src/test/codegen/repr-transparent-aggregates-1.rs -@@ -4,6 +4,7 @@ - // min-system-llvm-version: 12.0 +@@ -3,6 +3,7 @@ + // ignore-arm // ignore-aarch64 +// ignore-loongarch64 @@ -1487,10 +1452,10 @@ index 3017adb44..913ca18db 100644 // ignore-mips64 // ignore-powerpc diff --git a/src/test/codegen/repr-transparent-aggregates-2.rs b/src/test/codegen/repr-transparent-aggregates-2.rs -index 429d760b4..901d3031f 100644 +index b68e8e9eb..ffe289105 100644 --- a/src/test/codegen/repr-transparent-aggregates-2.rs +++ b/src/test/codegen/repr-transparent-aggregates-2.rs -@@ -5,6 +5,7 @@ +@@ -4,6 +4,7 @@ // ignore-aarch64 // ignore-emscripten // ignore-mips64 @@ -1522,7 +1487,7 @@ index 9bd351df3..d2bf8a1ba 100644 // ignore-mips64 // ignore-powerpc diff --git a/src/test/run-make-fulldeps/atomic-lock-free/Makefile b/src/test/run-make-fulldeps/atomic-lock-free/Makefile -index 9e8b4fabf..7091371c1 100644 +index 9e8b4fabf..8e9b46ef4 100644 --- a/src/test/run-make-fulldeps/atomic-lock-free/Makefile +++ b/src/test/run-make-fulldeps/atomic-lock-free/Makefile @@ -25,6 +25,10 @@ ifeq ($(filter aarch64,$(LLVM_COMPONENTS)),aarch64) @@ -1530,7 +1495,7 @@ index 9e8b4fabf..7091371c1 100644 nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add endif +ifeq ($(filter loongarch64,$(LLVM_COMPONENTS)),loongarch64) -+ $(RUSTC) --target=loongarch64-unknown-linux-gnuf64 atomic_lock_free.rs ++ $(RUSTC) --target=loongarch64-unknown-linux-gnu atomic_lock_free.rs + nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add +endif ifeq ($(filter mips,$(LLVM_COMPONENTS)),mips) @@ -1548,18 +1513,6 @@ index 90df1f3f5..075a1a124 100644 // ignore-mips // ignore-mips64 // ignore-powerpc -diff --git a/src/test/ui/borrowck/borrowck-asm.rs b/src/test/ui/borrowck/borrowck-asm.rs -index 0d202c1b4..036c2ba6b 100644 ---- a/src/test/ui/borrowck/borrowck-asm.rs -+++ b/src/test/ui/borrowck/borrowck-asm.rs -@@ -6,6 +6,7 @@ - // ignore-riscv64 - // ignore-sparc - // ignore-sparc64 -+// ignore-loongarch64 - - #![feature(llvm_asm)] - #![allow(deprecated)] // llvm_asm! diff --git a/src/test/ui/cfg/conditional-compile-arch.rs b/src/test/ui/cfg/conditional-compile-arch.rs index 7de561df1..34172b8c9 100644 --- a/src/test/ui/cfg/conditional-compile-arch.rs @@ -1575,10 +1528,10 @@ index 7de561df1..34172b8c9 100644 pub fn main() { } diff --git a/src/test/ui/empty_global_asm.rs b/src/test/ui/empty_global_asm.rs -index efbe2b2eb..0675da123 100644 +index dbcc7be05..2e733ba9f 100644 --- a/src/test/ui/empty_global_asm.rs +++ b/src/test/ui/empty_global_asm.rs -@@ -14,6 +14,9 @@ global_asm!(""); +@@ -15,6 +15,9 @@ global_asm!(""); #[cfg(target_arch = "aarch64")] global_asm!(""); @@ -1588,74 +1541,6 @@ index efbe2b2eb..0675da123 100644 #[cfg(target_arch = "mips")] global_asm!(""); -diff --git a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs -index c15009f15..a4e594b45 100644 ---- a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs -+++ b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs -@@ -3,6 +3,7 @@ - // ignore-aarch64 - // ignore-s390x - // ignore-emscripten -+// ignore-loongarch64 - // ignore-powerpc - // ignore-powerpc64 - // ignore-powerpc64le -diff --git a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs -index 1bccb0b73..9e57c1453 100644 ---- a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs -+++ b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs -@@ -1,5 +1,6 @@ - // ignore-s390x - // ignore-emscripten -+// ignore-loongarch64 - // ignore-powerpc - // ignore-powerpc64 - // ignore-powerpc64le -diff --git a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs -index 04f0972ed..a8d50f992 100644 ---- a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs -+++ b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs -@@ -2,6 +2,7 @@ - // ignore-android - // ignore-arm - // ignore-aarch64 -+// ignore-loongarch64 - // ignore-s390x - // ignore-emscripten - // ignore-powerpc -diff --git a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs -index 7f51b50f2..da3838a0c 100644 ---- a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs -+++ b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs -@@ -1,5 +1,6 @@ - // ignore-s390x - // ignore-emscripten -+// ignore-loongarch64 - // ignore-powerpc - // ignore-powerpc64 - // ignore-powerpc64le -diff --git a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs -index c74d156cf..2f6a402b9 100644 ---- a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs -+++ b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs -@@ -1,5 +1,6 @@ - // ignore-s390x - // ignore-emscripten -+// ignore-loongarch64 - // ignore-powerpc - // ignore-powerpc64 - // ignore-powerpc64le -diff --git a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs -index 161add7e5..255187930 100644 ---- a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs -+++ b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs -@@ -1,5 +1,6 @@ - // ignore-s390x - // ignore-emscripten -+// ignore-loongarch64 - // ignore-powerpc - // ignore-powerpc64 - // ignore-powerpc64le diff --git a/src/test/ui/target-feature/gate.rs b/src/test/ui/target-feature/gate.rs index 7cdf40424..d959168c5 100644 --- a/src/test/ui/target-feature/gate.rs @@ -1689,14 +1574,14 @@ index 5ea782155..a091ad8fe 100644 // ignore-mips64 // ignore-powerpc diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs -index c1579ae9a..f90311c58 100644 +index 8a62146ab..0f8f9eff9 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -28,6 +28,7 @@ static HOSTS: &[&str] = &[ "i686-pc-windows-gnu", "i686-pc-windows-msvc", "i686-unknown-linux-gnu", -+ "loongarch64-unknown-linux-gnuf64", ++ "loongarch64-unknown-linux-gnu", "mips-unknown-linux-gnu", "mips64-unknown-linux-gnuabi64", "mips64el-unknown-linux-gnuabi64", @@ -1704,12 +1589,12 @@ index c1579ae9a..f90311c58 100644 "i686-unknown-freebsd", "i686-unknown-linux-gnu", "i686-unknown-linux-musl", -+ "loongarch64-unknown-linux-gnuf64", ++ "loongarch64-unknown-linux-gnu", "m68k-unknown-linux-gnu", "mips-unknown-linux-gnu", "mips-unknown-linux-musl", diff --git a/src/tools/clippy/tests/ui/asm_syntax.rs b/src/tools/clippy/tests/ui/asm_syntax.rs -index 4a62f6f29..b76f18ddd 100644 +index 0220bf333..03748de7b 100644 --- a/src/tools/clippy/tests/ui/asm_syntax.rs +++ b/src/tools/clippy/tests/ui/asm_syntax.rs @@ -1,5 +1,6 @@ @@ -1717,25 +1602,10 @@ index 4a62f6f29..b76f18ddd 100644 // ignore-aarch64 +// ignore-loongarch64 - #![feature(asm)] - -diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs -index dc6d67983..bc3fb38ca 100644 ---- a/src/tools/compiletest/src/json.rs -+++ b/src/tools/compiletest/src/json.rs -@@ -74,8 +74,8 @@ struct DiagnosticSpanMacroExpansion { - struct DiagnosticCode { - /// The code itself. - code: String, -- /// An explanation for the code. -- explanation: Option, -+// /// An explanation for the code. -+// explanation: Option, - } - - pub fn rustfix_diagnostics_only(output: &str) -> String { + #[warn(clippy::inline_asm_x86_intel_syntax)] + mod warn_intel { diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs -index d03c21dc5..46fcd5f28 100644 +index bed509d77..9200a1ac7 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -54,6 +54,7 @@ const ARCH_TABLE: &[(&str, &str)] = &[ @@ -1746,20 +1616,20 @@ index d03c21dc5..46fcd5f28 100644 ("m68k", "m68k"), ("mips", "mips"), ("mips64", "mips64"), -@@ -133,7 +134,7 @@ const BIG_ENDIAN: &[&str] = &[ - ]; +@@ -137,7 +138,7 @@ const BIG_ENDIAN: &[&str] = &[ static ASM_SUPPORTED_ARCHS: &[&str] = &[ -- "x86", "x86_64", "arm", "aarch64", "riscv32", "riscv64", "nvptx64", "hexagon", "mips", -+ "x86", "x86_64", "arm", "aarch64", "riscv32", "riscv64", "nvptx64", "hexagon", "loongarch64", "mips", - "mips64", "spirv", "wasm32", + "x86", "x86_64", "arm", "aarch64", "riscv32", +- "riscv64", ++ "riscv64", "loongarch64", + // These targets require an additional asm_experimental_arch feature. + // "nvptx64", "hexagon", "mips", "mips64", "spirv", "wasm32", ]; - diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs -index 18f167323..25f02182f 100644 +index b07db9535..64c2b3621 100644 --- a/src/tools/miri/src/shims/foreign_items.rs +++ b/src/tools/miri/src/shims/foreign_items.rs -@@ -47,7 +47,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx +@@ -48,7 +48,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx // List taken from `libstd/sys_common/alloc.rs`. let min_align = match this.tcx.sess.target.arch.as_str() { "x86" | "arm" | "mips" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8, diff --git a/0002-vendor-Add-loongarch64-support.patch b/0002-vendor-Add-loongarch64-support-for-rust-1.60.0.patch similarity index 45% rename from 0002-vendor-Add-loongarch64-support.patch rename to 0002-vendor-Add-loongarch64-support-for-rust-1.60.0.patch index 5d541a5..e40f917 100644 --- a/0002-vendor-Add-loongarch64-support.patch +++ b/0002-vendor-Add-loongarch64-support-for-rust-1.60.0.patch @@ -1,40 +1,61 @@ -From 8c2dcad8371ff06b3a716e5f5114cc3c2323f807 Mon Sep 17 00:00:00 2001 +From 7be6472e1eec7d03a36a9aa2e28d6a27bf851ab2 Mon Sep 17 00:00:00 2001 From: yangxiaojuan -Date: Thu, 29 Dec 2022 16:04:41 +0800 -Subject: [PATCH 2/2] vendor: Add loongarch64 support +Date: Tue, 11 Apr 2023 11:35:00 +0800 +Subject: [PATCH 2/2] vendor: Add loongarch64 support for rust-1.60.0 --- - vendor/cc-1.0.69/src/lib.rs | 1 + + vendor/cc/src/lib.rs | 1 + vendor/compiletest_rs/src/util.rs | 1 + + vendor/gimli-0.25.0/src/arch.rs | 82 ++ vendor/gimli/src/arch.rs | 82 ++ + .../src/unix/linux_like/linux/align.rs | 6 +- + .../linux/gnu/b64/loongarch64/align.rs | 7 + + .../linux/gnu/b64/loongarch64/mod.rs | 933 ++++++++++++++++++ + .../src/unix/linux_like/linux/gnu/b64/mod.rs | 5 + + .../src/unix/linux_like/linux/gnu/mod.rs | 7 +- + .../src/unix/linux_like/linux/no_align.rs | 2 + .../libc/src/unix/linux_like/linux/align.rs | 6 +- .../linux/gnu/b64/loongarch64/align.rs | 7 + - .../linux/gnu/b64/loongarch64/mod.rs | 932 ++++++++++++++++++ + .../linux/gnu/b64/loongarch64/mod.rs | 933 ++++++++++++++++++ .../src/unix/linux_like/linux/gnu/b64/mod.rs | 5 + .../libc/src/unix/linux_like/linux/gnu/mod.rs | 7 +- .../src/unix/linux_like/linux/no_align.rs | 2 + + vendor/object-0.26.2/src/common.rs | 2 + + vendor/object-0.26.2/src/elf.rs | 197 ++++ + vendor/object-0.26.2/src/read/elf/file.rs | 1 + + .../object-0.26.2/src/read/elf/relocation.rs | 5 + + vendor/object-0.26.2/src/write/elf.rs | 11 + + vendor/object-0.26.2/tests/round_trip/mod.rs | 1 + + vendor/object-0.28.1/src/common.rs | 2 + + vendor/object-0.28.1/src/elf.rs | 195 ++++ + vendor/object-0.28.1/src/read/elf/file.rs | 1 + + .../object-0.28.1/src/read/elf/relocation.rs | 5 + + vendor/object-0.28.1/src/write/elf/object.rs | 10 + + vendor/object-0.28.1/tests/round_trip/mod.rs | 1 + vendor/object/src/common.rs | 2 + vendor/object/src/elf.rs | 195 ++++ vendor/object/src/read/elf/file.rs | 1 + vendor/object/src/read/elf/relocation.rs | 5 + - vendor/object/src/write/elf.rs | 10 + + vendor/object/src/write/elf/object.rs | 10 + vendor/object/tests/round_trip/mod.rs | 1 + vendor/psm/build.rs | 1 + vendor/psm/src/arch/loongarch64.s | 63 ++ - 17 files changed, 1318 insertions(+), 3 deletions(-) + 36 files changed, 2789 insertions(+), 6 deletions(-) + create mode 100644 vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs + create mode 100644 vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs create mode 100644 vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs create mode 100644 vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs create mode 100644 vendor/psm/src/arch/loongarch64.s -diff --git a/vendor/cc-1.0.69/src/lib.rs b/vendor/cc-1.0.69/src/lib.rs -index b62a1da04..aebf234cd 100644 ---- a/vendor/cc-1.0.69/src/lib.rs -+++ b/vendor/cc-1.0.69/src/lib.rs -@@ -2408,6 +2408,7 @@ impl Build { - "i686-uwp-windows-gnu" => Some("i686-w64-mingw32"), +diff --git a/vendor/cc/src/lib.rs b/vendor/cc/src/lib.rs +index a268fbe71..94ff30d1e 100644 +--- a/vendor/cc/src/lib.rs ++++ b/vendor/cc/src/lib.rs +@@ -2534,6 +2534,7 @@ impl Build { + ]), // explicit None if not found, so caller knows to fall back "i686-unknown-linux-musl" => Some("musl"), "i686-unknown-netbsd" => Some("i486--netbsdelf"), -+ "loongarch64-unknown-linux-gnuf64" => Some("loongarch64-linux-gnuf64"), ++ "loongarch64-unknown-linux-gnu" => Some("loongarch64-linux-gnu"), "mips-unknown-linux-gnu" => Some("mips-linux-gnu"), "mips-unknown-linux-musl" => Some("mips-linux-musl"), "mipsel-unknown-linux-gnu" => Some("mipsel-linux-gnu"), @@ -50,11 +71,101 @@ index fed8f7a52..387f81413 100644 ("mips", "mips"), ("msp430", "msp430"), ("nvptx64", "nvptx64"), -diff --git a/vendor/gimli/src/arch.rs b/vendor/gimli/src/arch.rs +diff --git a/vendor/gimli-0.25.0/src/arch.rs b/vendor/gimli-0.25.0/src/arch.rs index d30c3fc48..6e42dc566 100644 +--- a/vendor/gimli-0.25.0/src/arch.rs ++++ b/vendor/gimli-0.25.0/src/arch.rs +@@ -228,3 +228,85 @@ registers!(X86_64, { + K6 = (124, "k6"), + K7 = (125, "k7"), + }); ++ ++/// LoongArch architecture specific definitions. ++/// ++/// See [LoongArch ELF psABI specification](https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html). ++#[derive(Debug, Clone, Copy)] ++pub struct LoongArch; ++ ++registers!(LoongArch, { ++ R0 = (0, "$r0"), ++ R1 = (1, "$r1"), ++ R2 = (2, "$r2"), ++ R3 = (3, "$r3"), ++ R4 = (4, "$r4"), ++ R5 = (5, "$r5"), ++ R6 = (6, "$r6"), ++ R7 = (7, "$r7"), ++ R8 = (8, "$r8"), ++ R9 = (9, "$r9"), ++ R10 = (10, "$r10"), ++ R11 = (11, "$r11"), ++ R12 = (12, "$r12"), ++ R13 = (13, "$r13"), ++ R14 = (14, "$r14"), ++ R15 = (15, "$r15"), ++ R16 = (16, "$r16"), ++ R17 = (17, "$r17"), ++ R18 = (18, "$r18"), ++ R19 = (19, "$r19"), ++ R20 = (20, "$r20"), ++ R21 = (21, "$r21"), ++ R22 = (22, "$r22"), ++ R23 = (23, "$r23"), ++ R24 = (24, "$r24"), ++ R25 = (25, "$r25"), ++ R26 = (26, "$r26"), ++ R27 = (27, "$r27"), ++ R28 = (28, "$r28"), ++ R29 = (29, "$r29"), ++ R30 = (30, "$r30"), ++ R31 = (31, "$r31"), ++ ++ F0 = (32, "$f0"), ++ F1 = (33, "$f1"), ++ F2 = (34, "$f2"), ++ F3 = (35, "$f3"), ++ F4 = (36, "$f4"), ++ F5 = (37, "$f5"), ++ F6 = (38, "$f6"), ++ F7 = (39, "$f7"), ++ F8 = (40, "$f8"), ++ F9 = (41, "$f9"), ++ F10 = (42, "$f10"), ++ F11 = (43, "$f11"), ++ F12 = (44, "$f12"), ++ F13 = (45, "$f13"), ++ F14 = (46, "$f14"), ++ F15 = (47, "$f15"), ++ F16 = (48, "$f16"), ++ F17 = (49, "$f17"), ++ F18 = (50, "$f18"), ++ F19 = (51, "$f19"), ++ F20 = (52, "$f20"), ++ F21 = (53, "$f21"), ++ F22 = (54, "$f22"), ++ F23 = (55, "$f23"), ++ F24 = (56, "$f24"), ++ F25 = (57, "$f25"), ++ F26 = (58, "$f26"), ++ F27 = (59, "$f27"), ++ F28 = (60, "$f28"), ++ F29 = (61, "$f29"), ++ F30 = (62, "$f30"), ++ F31 = (63, "$f31"), ++ FCC0 = (64, "$fcc0"), ++ FCC1 = (65, "$fcc1"), ++ FCC2 = (66, "$fcc2"), ++ FCC3 = (67, "$fcc3"), ++ FCC4 = (68, "$fcc4"), ++ FCC5 = (69, "$fcc5"), ++ FCC6 = (70, "$fcc6"), ++ FCC7 = (71, "$fcc7"), ++}); +diff --git a/vendor/gimli/src/arch.rs b/vendor/gimli/src/arch.rs +index f5b2e5ed8..cfad7d1f6 100644 --- a/vendor/gimli/src/arch.rs +++ b/vendor/gimli/src/arch.rs -@@ -228,3 +228,85 @@ registers!(X86_64, { +@@ -601,3 +601,85 @@ registers!(X86_64, { K6 = (124, "k6"), K7 = (125, "k7"), }); @@ -140,10 +251,10 @@ index d30c3fc48..6e42dc566 100644 + FCC6 = (70, "$fcc6"), + FCC7 = (71, "$fcc7"), +}); -diff --git a/vendor/libc/src/unix/linux_like/linux/align.rs b/vendor/libc/src/unix/linux_like/linux/align.rs +diff --git a/vendor/libc-0.2.116/src/unix/linux_like/linux/align.rs b/vendor/libc-0.2.116/src/unix/linux_like/linux/align.rs index 11f5504a5..0b5638769 100644 ---- a/vendor/libc/src/unix/linux_like/linux/align.rs -+++ b/vendor/libc/src/unix/linux_like/linux/align.rs +--- a/vendor/libc-0.2.116/src/unix/linux_like/linux/align.rs ++++ b/vendor/libc-0.2.116/src/unix/linux_like/linux/align.rs @@ -9,7 +9,8 @@ macro_rules! expand_align { target_arch = "sparc64", target_arch = "aarch64", @@ -164,11 +275,11 @@ index 11f5504a5..0b5638769 100644 repr(align(8)))] pub struct pthread_mutexattr_t { #[doc(hidden)] -diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs +diff --git a/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs new file mode 100644 index 000000000..7ca870fd0 --- /dev/null -+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs ++++ b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] @@ -177,12 +288,12 @@ index 000000000..7ca870fd0 + priv_: [f64; 4] + } +} -diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +diff --git a/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs new file mode 100644 -index 000000000..25486cc3c +index 000000000..ab0d29083 --- /dev/null -+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs -@@ -0,0 +1,932 @@ ++++ b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +@@ -0,0 +1,933 @@ +use pthread_mutex_t; + +pub type c_char = i8; @@ -194,6 +305,7 @@ index 000000000..25486cc3c +pub type nlink_t = u32; +pub type suseconds_t = i64; +pub type __u64 = ::c_ulonglong; ++pub type __s64 = ::c_longlong; + +s! { + pub struct stat { @@ -1115,10 +1227,10 @@ index 000000000..25486cc3c + pub use self::align::*; + } +} -diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs +diff --git a/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/mod.rs b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/mod.rs index db82f26dc..2c3ded335 100644 ---- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs -+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs +--- a/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/mod.rs ++++ b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/b64/mod.rs @@ -70,6 +70,7 @@ s! { pub sem_otime: ::time_t, #[cfg(not(any( @@ -1145,11 +1257,11 @@ index db82f26dc..2c3ded335 100644 } else { // Unknown target_arch } -diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs -index bb2a777d7..92e09f682 100644 ---- a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs -+++ b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs -@@ -411,22 +411,26 @@ s_no_extra_traits! { +diff --git a/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/mod.rs b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/mod.rs +index 0ae854214..fd14fd2a5 100644 +--- a/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/mod.rs ++++ b/vendor/libc-0.2.116/src/unix/linux_like/linux/gnu/mod.rs +@@ -465,22 +465,26 @@ s_no_extra_traits! { #[cfg(any(target_arch = "aarch64", target_arch = "s390x", @@ -1176,7 +1288,7 @@ index bb2a777d7..92e09f682 100644 all(target_pointer_width = "32", not(target_arch = "x86_64")))))] pub ut_tv: __timeval, -@@ -1336,7 +1340,8 @@ cfg_if! { +@@ -1350,7 +1354,8 @@ cfg_if! { target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64", @@ -1186,10 +1298,10 @@ index bb2a777d7..92e09f682 100644 mod b64; pub use self::b64::*; } else { -diff --git a/vendor/libc/src/unix/linux_like/linux/no_align.rs b/vendor/libc/src/unix/linux_like/linux/no_align.rs +diff --git a/vendor/libc-0.2.116/src/unix/linux_like/linux/no_align.rs b/vendor/libc-0.2.116/src/unix/linux_like/linux/no_align.rs index de64be5a3..b64b1d4da 100644 ---- a/vendor/libc/src/unix/linux_like/linux/no_align.rs -+++ b/vendor/libc/src/unix/linux_like/linux/no_align.rs +--- a/vendor/libc-0.2.116/src/unix/linux_like/linux/no_align.rs ++++ b/vendor/libc-0.2.116/src/unix/linux_like/linux/no_align.rs @@ -9,6 +9,7 @@ macro_rules! expand_align { target_arch = "sparc64", target_arch = "riscv64", @@ -1206,112 +1318,1798 @@ index de64be5a3..b64b1d4da 100644 all(target_arch = "aarch64", target_env = "musl"))))] __align: [::c_long; 0], -diff --git a/vendor/object/src/common.rs b/vendor/object/src/common.rs -index c86665c21..0759a9d4e 100644 ---- a/vendor/object/src/common.rs -+++ b/vendor/object/src/common.rs -@@ -23,6 +23,7 @@ pub enum Architecture { - S390x, - Sparc64, - Wasm32, -+ LoongArch64, - } - - impl Architecture { -@@ -50,6 +51,7 @@ impl Architecture { - Architecture::S390x => Some(AddressSize::U64), - Architecture::Sparc64 => Some(AddressSize::U64), - Architecture::Wasm32 => Some(AddressSize::U32), -+ Architecture::LoongArch64 => Some(AddressSize::U64), - } - } - } -diff --git a/vendor/object/src/elf.rs b/vendor/object/src/elf.rs -index 28ac16bbe..c6b79a643 100644 ---- a/vendor/object/src/elf.rs -+++ b/vendor/object/src/elf.rs -@@ -564,6 +564,8 @@ pub const EM_BPF: u16 = 247; - pub const EM_CSKY: u16 = 252; - /// Digital Alpha - pub const EM_ALPHA: u16 = 0x9026; -+/// LOONGARCH -+pub const EM_LOONGARCH: u16 = 258; - - // Values for `FileHeader*::e_version` and `Ident::version`. - /// Invalid ELF version. -@@ -6081,6 +6083,199 @@ pub const R_RISCV_SET32: u32 = 56; - #[allow(missing_docs)] - pub const R_RISCV_32_PCREL: u32 = 57; - -+// LoongArch values `FileHeader*::e_flags`. -+// Base ABI Modifiers -+pub const EF_LOONGARCH_ABI_SOFT_FLOAT: u32 = 0x1; -+pub const EF_LOONGARCH_ABI_SINGLE_FLOAT: u32 = 0x2; -+pub const EF_LOONGARCH_ABI_DOUBLE_FLOAT: u32 = 0x3; -+pub const EF_LOONGARCH_ABI_MODIFIER_MASK: u32 = 0x7; +diff --git a/vendor/libc/src/unix/linux_like/linux/align.rs b/vendor/libc/src/unix/linux_like/linux/align.rs +index 11f5504a5..0b5638769 100644 +--- a/vendor/libc/src/unix/linux_like/linux/align.rs ++++ b/vendor/libc/src/unix/linux_like/linux/align.rs +@@ -9,7 +9,8 @@ macro_rules! expand_align { + target_arch = "sparc64", + target_arch = "aarch64", + target_arch = "riscv64", +- target_arch = "riscv32"), ++ target_arch = "riscv32", ++ target_arch = "loongarch64"), + repr(align(4)))] + #[cfg_attr(not(any(target_pointer_width = "32", + target_arch = "x86_64", +@@ -19,7 +20,8 @@ macro_rules! expand_align { + target_arch = "sparc64", + target_arch = "aarch64", + target_arch = "riscv64", +- target_arch = "riscv32")), ++ target_arch = "riscv32", ++ target_arch = "loongarch64")), + repr(align(8)))] + pub struct pthread_mutexattr_t { + #[doc(hidden)] +diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs +new file mode 100644 +index 000000000..7ca870fd0 +--- /dev/null ++++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs +@@ -0,0 +1,7 @@ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4] ++ } ++} +diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +new file mode 100644 +index 000000000..ab0d29083 +--- /dev/null ++++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +@@ -0,0 +1,933 @@ ++use pthread_mutex_t; + -+// Object file ABI versions -+pub const EF_LOONGARCH_OBJABI_V0: u32 = 0x0; -+pub const EF_LOONGARCH_OBJABI_V1: u32 = 0x40; -+pub const EF_LOONGARCH_OBJABI_MASK: u32 = 0xC0; ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type wchar_t = i32; + -+// LOONGARCH values `Rel*::r_type`. -+/* Loongarch specific dynamic relocations. */ -+#[allow(missing_docs)] -+pub const R_LARCH_NONE: u32 = 0; -+#[allow(missing_docs)] -+pub const R_LARCH_32: u32 = 1; -+#[allow(missing_docs)] -+pub const R_LARCH_64: u32 = 2; -+#[allow(missing_docs)] -+pub const R_LARCH_RELATIVE: u32 = 3; -+#[allow(missing_docs)] -+pub const R_LARCH_COPY: u32 = 4; -+#[allow(missing_docs)] -+pub const R_LARCH_JUMP_SLOT: u32 = 5; -+#[allow(missing_docs)] -+pub const R_LARCH_TLS_DTPMOD32: u32 = 6; -+#[allow(missing_docs)] -+pub const R_LARCH_TLS_DTPMOD64: u32 = 7; -+#[allow(missing_docs)] -+pub const R_LARCH_TLS_DTPREL32: u32 = 8; -+#[allow(missing_docs)] -+pub const R_LARCH_TLS_DTPREL64: u32 = 9; -+#[allow(missing_docs)] -+pub const R_LARCH_TLS_TPREL32: u32 = 10; -+#[allow(missing_docs)] -+pub const R_LARCH_TLS_TPREL64: u32 = 11; -+#[allow(missing_docs)] -+pub const R_LARCH_IRELATIVE: u32 = 12; -+#[allow(missing_docs)] -+pub const R_LARCH_MARK_LA: u32 = 20; -+#[allow(missing_docs)] -+pub const R_LARCH_MARK_PCREL: u32 = 21; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_PCREL: u32 = 22; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_ABSOLUTE: u32 = 23; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_DUP: u32 = 24; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_GPREL: u32 = 25; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_TLS_TPREL: u32 = 26; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_TLS_GOT: u32 = 27; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_TLS_GD: u32 = 28; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_PUSH_PLT_PCREL: u32 = 29; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_ASSERT: u32 = 30; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_NOT: u32 = 31; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_SUB: u32 = 32; -+#[allow(missing_docs)] -+pub const R_LARCH_SOP_SL: u32 = 33; -+#[allow(missing_docs)] ++pub type blksize_t = i32; ++pub type nlink_t = u32; ++pub type suseconds_t = i64; ++pub type __u64 = ::c_ulonglong; ++pub type __s64 = ::c_longlong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_mode: ::mode_t, ++ pub st_nlink: ::nlink_t, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ pub st_rdev: ::dev_t, ++ __pad1: ::dev_t, ++ pub st_size: ::off_t, ++ pub st_blksize: ::blksize_t, ++ __pad2: ::c_int, ++ pub st_blocks: ::blkcnt_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ __unused: [::c_int; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino64_t, ++ pub st_mode: ::mode_t, ++ pub st_nlink: ::nlink_t, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ pub st_rdev: ::dev_t, ++ pub __pad1: ::dev_t, ++ pub st_size: ::off64_t, ++ pub st_blksize: ::blksize_t, ++ pub __pad2: ::c_int, ++ pub st_blocks: ::blkcnt_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ __unused: [::c_int; 2], ++ } ++ ++ pub struct statfs { ++ pub f_type: ::__fsword_t, ++ pub f_bsize: ::__fsword_t, ++ pub f_blocks: ::fsblkcnt_t, ++ pub f_bfree: ::fsblkcnt_t, ++ pub f_bavail: ::fsblkcnt_t, ++ pub f_files: ::fsfilcnt_t, ++ pub f_ffree: ::fsfilcnt_t, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::__fsword_t, ++ pub f_frsize: ::__fsword_t, ++ pub f_flags: ::__fsword_t, ++ pub f_spare: [::__fsword_t; 4], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: ::__fsword_t, ++ pub f_bsize: ::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: ::fsid_t, ++ pub f_namelen: ::__fsword_t, ++ pub f_frsize: ::__fsword_t, ++ pub f_flags: ::__fsword_t, ++ pub f_spare: [::__fsword_t; 4], ++ } ++ ++ pub struct flock { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off_t, ++ pub l_len: ::off_t, ++ pub l_pid: ::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: ::c_short, ++ pub l_whence: ::c_short, ++ pub l_start: ::off64_t, ++ pub l_len: ::off64_t, ++ pub l_pid: ::pid_t, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_blocks: ::fsblkcnt_t, ++ pub f_bfree: ::fsblkcnt_t, ++ pub f_bavail: ::fsblkcnt_t, ++ pub f_files: ::fsfilcnt_t, ++ pub f_ffree: ::fsfilcnt_t, ++ pub f_favail: ::fsfilcnt_t, ++ pub f_fsid: ::c_ulong, ++ pub f_flag: ::c_ulong, ++ pub f_namemax: ::c_ulong, ++ __f_spare: [::c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: ::c_ulong, ++ pub f_frsize: ::c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: ::c_ulong, ++ pub f_flag: ::c_ulong, ++ pub f_namemax: ::c_ulong, ++ __f_spare: [::c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [::c_ulong; 7] ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: ::sighandler_t, ++ pub sa_mask: ::sigset_t, ++ pub sa_flags: ::c_int, ++ pub sa_restorer: ::Option, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut ::c_void, ++ pub ss_flags: ::c_int, ++ pub ss_size: ::size_t, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: ::c_int, ++ pub si_errno: ::c_int, ++ pub si_code: ::c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since="0.2.54", ++ note="Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [::c_int; 29], ++ _align: [u64; 0], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: ::key_t, ++ pub uid: ::uid_t, ++ pub gid: ::gid_t, ++ pub cuid: ::uid_t, ++ pub cgid: ::gid_t, ++ pub mode: ::c_uint, ++ pub __seq: ::c_ushort, ++ __pad2: ::c_ushort, ++ __unused1: ::c_ulong, ++ __unused2: ::c_ulong ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: ::ipc_perm, ++ pub shm_segsz: ::size_t, ++ pub shm_atime: ::time_t, ++ pub shm_dtime: ::time_t, ++ pub shm_ctime: ::time_t, ++ pub shm_cpid: ::pid_t, ++ pub shm_lpid: ::pid_t, ++ pub shm_nattch: ::shmatt_t, ++ __unused4: ::c_ulong, ++ __unused5: ::c_ulong ++ } ++ ++ pub struct termios2 { ++ pub c_iflag: ::tcflag_t, ++ pub c_oflag: ::tcflag_t, ++ pub c_cflag: ::tcflag_t, ++ pub c_lflag: ::tcflag_t, ++ pub c_line: ::cc_t, ++ pub c_cc: [::cc_t; 19], ++ pub c_ispeed: ::speed_t, ++ pub c_ospeed: ::speed_t, ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++ ++align_const! { ++ #[cfg(target_endian = "little")] ++ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = ++ pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++ }; ++ #[cfg(target_endian = "little")] ++ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = ++ pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++ }; ++ #[cfg(target_endian = "little")] ++ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = ++ pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++ }; ++ #[cfg(target_endian = "big")] ++ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = ++ pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++ }; ++ #[cfg(target_endian = "big")] ++ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = ++ pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++ }; ++ #[cfg(target_endian = "big")] ++ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = ++ pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++ }; ++} ++ ++pub const SYS_io_setup: ::c_long = 0; ++pub const SYS_io_destroy: ::c_long = 1; ++pub const SYS_io_submit: ::c_long = 2; ++pub const SYS_io_cancel: ::c_long = 3; ++pub const SYS_io_getevents: ::c_long = 4; ++pub const SYS_setxattr: ::c_long = 5; ++pub const SYS_lsetxattr: ::c_long = 6; ++pub const SYS_fsetxattr: ::c_long = 7; ++pub const SYS_getxattr: ::c_long = 8; ++pub const SYS_lgetxattr: ::c_long = 9; ++pub const SYS_fgetxattr: ::c_long = 10; ++pub const SYS_listxattr: ::c_long = 11; ++pub const SYS_llistxattr: ::c_long = 12; ++pub const SYS_flistxattr: ::c_long = 13; ++pub const SYS_removexattr: ::c_long = 14; ++pub const SYS_lremovexattr: ::c_long = 15; ++pub const SYS_fremovexattr: ::c_long = 16; ++pub const SYS_getcwd: ::c_long = 17; ++pub const SYS_lookup_dcookie: ::c_long = 18; ++pub const SYS_eventfd2: ::c_long = 19; ++pub const SYS_epoll_create1: ::c_long = 20; ++pub const SYS_epoll_ctl: ::c_long = 21; ++pub const SYS_epoll_pwait: ::c_long = 22; ++pub const SYS_dup: ::c_long = 23; ++pub const SYS_dup3: ::c_long = 24; ++pub const SYS_fcntl: ::c_long = 25; ++pub const SYS_fcntl64: ::c_long = 25; ++pub const SYS_inotify_init1: ::c_long = 26; ++pub const SYS_inotify_add_watch: ::c_long = 27; ++pub const SYS_inotify_rm_watch: ::c_long = 28; ++pub const SYS_ioctl: ::c_long = 29; ++pub const SYS_ioprio_set: ::c_long = 30; ++pub const SYS_ioprio_get: ::c_long = 31; ++pub const SYS_flock: ::c_long = 32; ++pub const SYS_mknodat: ::c_long = 33; ++pub const SYS_mkdirat: ::c_long = 34; ++pub const SYS_unlinkat: ::c_long = 35; ++pub const SYS_symlinkat: ::c_long = 36; ++pub const SYS_linkat: ::c_long = 37; ++pub const SYS_renameat: ::c_long = 38; ++pub const SYS_umount2: ::c_long = 39; ++pub const SYS_mount: ::c_long = 40; ++pub const SYS_pivot_root: ::c_long = 41; ++pub const SYS_nfsservctl: ::c_long = 42; ++pub const SYS_statfs: ::c_long = 43; ++pub const SYS_fstatfs: ::c_long = 44; ++pub const SYS_fstatfs64: ::c_long = 44; ++pub const SYS_truncate: ::c_long = 45; ++pub const SYS_truncate64: ::c_long = 45; ++pub const SYS_ftruncate: ::c_long = 46; ++pub const SYS_ftruncate64: ::c_long = 46; ++pub const SYS_fallocate: ::c_long = 47; ++pub const SYS_faccessat: ::c_long = 48; ++pub const SYS_chdir: ::c_long = 49; ++pub const SYS_fchdir: ::c_long = 50; ++pub const SYS_chroot: ::c_long = 51; ++pub const SYS_fchmod: ::c_long = 52; ++pub const SYS_fchmodat: ::c_long = 53; ++pub const SYS_fchownat: ::c_long = 54; ++pub const SYS_fchown: ::c_long = 55; ++pub const SYS_openat: ::c_long = 56; ++pub const SYS_close: ::c_long = 57; ++pub const SYS_vhangup: ::c_long = 58; ++pub const SYS_pipe2: ::c_long = 59; ++pub const SYS_quotactl: ::c_long = 60; ++pub const SYS_getdents64: ::c_long = 61; ++pub const SYS_lseek: ::c_long = 62; ++pub const SYS_read: ::c_long = 63; ++pub const SYS_write: ::c_long = 64; ++pub const SYS_readv: ::c_long = 65; ++pub const SYS_writev: ::c_long = 66; ++pub const SYS_pread64: ::c_long = 67; ++pub const SYS_pwrite64: ::c_long = 68; ++pub const SYS_preadv: ::c_long = 69; ++pub const SYS_pwritev: ::c_long = 70; ++pub const SYS_sendfile: ::c_long = 71; ++pub const SYS_pselect6: ::c_long = 72; ++pub const SYS_ppoll: ::c_long = 73; ++pub const SYS_signalfd4: ::c_long = 74; ++pub const SYS_vmsplice: ::c_long = 75; ++pub const SYS_splice: ::c_long = 76; ++pub const SYS_tee: ::c_long = 77; ++pub const SYS_readlinkat: ::c_long = 78; ++pub const SYS_newfstatat: ::c_long = 79; ++pub const SYS_fstat: ::c_long = 80; ++pub const SYS_fstat64: ::c_long = 80; ++pub const SYS_sync: ::c_long = 81; ++pub const SYS_fsync: ::c_long = 82; ++pub const SYS_fdatasync: ::c_long = 83; ++pub const SYS_sync_file_range2: ::c_long = 84; ++pub const SYS_sync_file_range: ::c_long = 84; ++pub const SYS_timerfd_create: ::c_long = 85; ++pub const SYS_timerfd_settime: ::c_long = 86; ++pub const SYS_timerfd_gettime: ::c_long = 87; ++pub const SYS_utimensat: ::c_long = 88; ++pub const SYS_acct: ::c_long = 89; ++pub const SYS_capget: ::c_long = 90; ++pub const SYS_capset: ::c_long = 91; ++pub const SYS_personality: ::c_long = 92; ++pub const SYS_exit: ::c_long = 93; ++pub const SYS_exit_group: ::c_long = 94; ++pub const SYS_waitid: ::c_long = 95; ++pub const SYS_set_tid_address: ::c_long = 96; ++pub const SYS_unshare: ::c_long = 97; ++pub const SYS_futex: ::c_long = 98; ++pub const SYS_set_robust_list: ::c_long = 99; ++pub const SYS_get_robust_list: ::c_long = 100; ++pub const SYS_nanosleep: ::c_long = 101; ++pub const SYS_getitimer: ::c_long = 102; ++pub const SYS_setitimer: ::c_long = 103; ++pub const SYS_kexec_load: ::c_long = 104; ++pub const SYS_init_module: ::c_long = 105; ++pub const SYS_delete_module: ::c_long = 106; ++pub const SYS_timer_create: ::c_long = 107; ++pub const SYS_timer_gettime: ::c_long = 108; ++pub const SYS_timer_getoverrun: ::c_long = 109; ++pub const SYS_timer_settime: ::c_long = 110; ++pub const SYS_timer_delete: ::c_long = 111; ++pub const SYS_clock_settime: ::c_long = 112; ++pub const SYS_clock_gettime: ::c_long = 113; ++pub const SYS_clock_getres: ::c_long = 114; ++pub const SYS_clock_nanosleep: ::c_long = 115; ++pub const SYS_syslog: ::c_long = 116; ++pub const SYS_ptrace: ::c_long = 117; ++pub const SYS_sched_setparam: ::c_long = 118; ++pub const SYS_sched_setscheduler: ::c_long = 119; ++pub const SYS_sched_getscheduler: ::c_long = 120; ++pub const SYS_sched_getparam: ::c_long = 121; ++pub const SYS_sched_setaffinity: ::c_long = 122; ++pub const SYS_sched_getaffinity: ::c_long = 123; ++pub const SYS_sched_yield: ::c_long = 124; ++pub const SYS_sched_get_priority_max: ::c_long = 125; ++pub const SYS_sched_get_priority_min: ::c_long = 126; ++pub const SYS_sched_rr_get_interval: ::c_long = 127; ++pub const SYS_restart_syscall: ::c_long = 128; ++pub const SYS_kill: ::c_long = 129; ++pub const SYS_tkill: ::c_long = 130; ++pub const SYS_tgkill: ::c_long = 131; ++pub const SYS_sigaltstack: ::c_long = 132; ++pub const SYS_rt_sigsuspend: ::c_long = 133; ++pub const SYS_rt_sigaction: ::c_long = 134; ++pub const SYS_rt_sigprocmask: ::c_long = 135; ++pub const SYS_rt_sigpending: ::c_long = 136; ++pub const SYS_rt_sigtimedwait: ::c_long = 137; ++pub const SYS_rt_sigqueueinfo: ::c_long = 138; ++pub const SYS_rt_sigreturn: ::c_long = 139; ++pub const SYS_setpriority: ::c_long = 140; ++pub const SYS_getpriority: ::c_long = 141; ++pub const SYS_reboot: ::c_long = 142; ++pub const SYS_setregid: ::c_long = 143; ++pub const SYS_setgid: ::c_long = 144; ++pub const SYS_setreuid: ::c_long = 145; ++pub const SYS_setuid: ::c_long = 146; ++pub const SYS_setresuid: ::c_long = 147; ++pub const SYS_getresuid: ::c_long = 148; ++pub const SYS_setresgid: ::c_long = 149; ++pub const SYS_getresgid: ::c_long = 150; ++pub const SYS_setfsuid: ::c_long = 151; ++pub const SYS_setfsgid: ::c_long = 152; ++pub const SYS_times: ::c_long = 153; ++pub const SYS_setpgid: ::c_long = 154; ++pub const SYS_getpgid: ::c_long = 155; ++pub const SYS_getsid: ::c_long = 156; ++pub const SYS_setsid: ::c_long = 157; ++pub const SYS_getgroups: ::c_long = 158; ++pub const SYS_setgroups: ::c_long = 159; ++pub const SYS_uname: ::c_long = 160; ++pub const SYS_sethostname: ::c_long = 161; ++pub const SYS_setdomainname: ::c_long = 162; ++pub const SYS_getrlimit: ::c_long = 163; ++pub const SYS_setrlimit: ::c_long = 164; ++pub const SYS_getrusage: ::c_long = 165; ++pub const SYS_umask: ::c_long = 166; ++pub const SYS_prctl: ::c_long = 167; ++pub const SYS_getcpu: ::c_long = 168; ++pub const SYS_gettimeofday: ::c_long = 169; ++pub const SYS_settimeofday: ::c_long = 170; ++pub const SYS_adjtimex: ::c_long = 171; ++pub const SYS_getpid: ::c_long = 172; ++pub const SYS_getppid: ::c_long = 173; ++pub const SYS_getuid: ::c_long = 174; ++pub const SYS_geteuid: ::c_long = 175; ++pub const SYS_getgid: ::c_long = 176; ++pub const SYS_getegid: ::c_long = 177; ++pub const SYS_gettid: ::c_long = 178; ++pub const SYS_sysinfo: ::c_long = 179; ++pub const SYS_mq_open: ::c_long = 180; ++pub const SYS_mq_unlink: ::c_long = 181; ++pub const SYS_mq_timedsend: ::c_long = 182; ++pub const SYS_mq_timedreceive: ::c_long = 183; ++pub const SYS_mq_notify: ::c_long = 184; ++pub const SYS_mq_getsetattr: ::c_long = 185; ++pub const SYS_msgget: ::c_long = 186; ++pub const SYS_msgctl: ::c_long = 187; ++pub const SYS_msgrcv: ::c_long = 188; ++pub const SYS_msgsnd: ::c_long = 189; ++pub const SYS_semget: ::c_long = 190; ++pub const SYS_semctl: ::c_long = 191; ++pub const SYS_semtimedop: ::c_long = 192; ++pub const SYS_semop: ::c_long = 193; ++pub const SYS_shmget: ::c_long = 194; ++pub const SYS_shmctl: ::c_long = 195; ++pub const SYS_shmat: ::c_long = 196; ++pub const SYS_shmdt: ::c_long = 197; ++pub const SYS_socket: ::c_long = 198; ++pub const SYS_socketpair: ::c_long = 199; ++pub const SYS_bind: ::c_long = 200; ++pub const SYS_listen: ::c_long = 201; ++pub const SYS_accept: ::c_long = 202; ++pub const SYS_connect: ::c_long = 203; ++pub const SYS_getsockname: ::c_long = 204; ++pub const SYS_getpeername: ::c_long = 205; ++pub const SYS_sendto: ::c_long = 206; ++pub const SYS_recvfrom: ::c_long = 207; ++pub const SYS_setsockopt: ::c_long = 208; ++pub const SYS_getsockopt: ::c_long = 209; ++pub const SYS_shutdown: ::c_long = 210; ++pub const SYS_sendmsg: ::c_long = 211; ++pub const SYS_recvmsg: ::c_long = 212; ++pub const SYS_readahead: ::c_long = 213; ++pub const SYS_brk: ::c_long = 214; ++pub const SYS_munmap: ::c_long = 215; ++pub const SYS_mremap: ::c_long = 216; ++pub const SYS_add_key: ::c_long = 217; ++pub const SYS_request_key: ::c_long = 218; ++pub const SYS_keyctl: ::c_long = 219; ++pub const SYS_clone: ::c_long = 220; ++pub const SYS_execve: ::c_long = 221; ++pub const SYS_mmap: ::c_long = 222; ++pub const SYS_mmap2: ::c_long = 222; ++pub const SYS_fadvise64: ::c_long = 223; ++pub const SYS_swapon: ::c_long = 224; ++pub const SYS_swapoff: ::c_long = 225; ++pub const SYS_mprotect: ::c_long = 226; ++pub const SYS_msync: ::c_long = 227; ++pub const SYS_mlock: ::c_long = 228; ++pub const SYS_munlock: ::c_long = 229; ++pub const SYS_mlockall: ::c_long = 230; ++pub const SYS_munlockall: ::c_long = 231; ++pub const SYS_mincore: ::c_long = 232; ++pub const SYS_madvise: ::c_long = 233; ++pub const SYS_remap_file_pages: ::c_long = 234; ++pub const SYS_mbind: ::c_long = 235; ++pub const SYS_get_mempolicy: ::c_long = 236; ++pub const SYS_set_mempolicy: ::c_long = 237; ++pub const SYS_migrate_pages: ::c_long = 238; ++pub const SYS_move_pages: ::c_long = 239; ++pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; ++pub const SYS_perf_event_open: ::c_long = 241; ++pub const SYS_accept4: ::c_long = 242; ++pub const SYS_recvmmsg: ::c_long = 243; ++pub const SYS_arch_specific_syscall: ::c_long = 244; ++pub const SYS_wait4: ::c_long = 260; ++pub const SYS_prlimit64: ::c_long = 261; ++pub const SYS_fanotify_init: ::c_long = 262; ++pub const SYS_fanotify_mark: ::c_long = 263; ++pub const SYS_name_to_handle_at: ::c_long = 264; ++pub const SYS_open_by_handle_at: ::c_long = 265; ++pub const SYS_clock_adjtime: ::c_long = 266; ++pub const SYS_syncfs: ::c_long = 267; ++pub const SYS_setns: ::c_long = 268; ++pub const SYS_sendmmsg: ::c_long = 269; ++pub const SYS_process_vm_readv: ::c_long = 270; ++pub const SYS_process_vm_writev: ::c_long = 271; ++pub const SYS_kcmp: ::c_long = 272; ++pub const SYS_finit_module: ::c_long = 273; ++pub const SYS_sched_setattr: ::c_long = 274; ++pub const SYS_sched_getattr: ::c_long = 275; ++pub const SYS_renameat2: ::c_long = 276; ++pub const SYS_seccomp: ::c_long = 277; ++pub const SYS_getrandom: ::c_long = 278; ++pub const SYS_memfd_create: ::c_long = 279; ++pub const SYS_bpf: ::c_long = 280; ++pub const SYS_execveat: ::c_long = 281; ++pub const SYS_userfaultfd: ::c_long = 282; ++pub const SYS_membarrier: ::c_long = 283; ++pub const SYS_mlock2: ::c_long = 284; ++pub const SYS_copy_file_range: ::c_long = 285; ++pub const SYS_preadv2: ::c_long = 286; ++pub const SYS_pwritev2: ::c_long = 287; ++pub const SYS_pkey_mprotect: ::c_long = 288; ++pub const SYS_pkey_alloc: ::c_long = 289; ++pub const SYS_pkey_free: ::c_long = 290; ++pub const SYS_statx: ::c_long = 291; ++pub const SYS_io_pgetevents: ::c_long =292; ++pub const SYS_rseq: ::c_long = 293; ++pub const SYS_syscalls: ::c_long = 294; ++ ++pub const SYS_pidfd_open: ::c_long = 434; ++pub const SYS_clone3: ::c_long = 435; ++ ++ ++pub const SFD_CLOEXEC: ::c_int = 0x080000; ++pub const NCCS: usize = 32; ++ ++pub const POSIX_FADV_DONTNEED: ::c_int = 4; ++pub const POSIX_FADV_NOREUSE: ::c_int = 5; ++ ++pub const O_TRUNC: ::c_int = 512; ++pub const O_NOATIME: ::c_int = 0o1000000; ++pub const O_CLOEXEC: ::c_int = 0x80000; ++pub const O_PATH: ::c_int = 0o10000000; ++pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const EBFONT: ::c_int = 59; ++pub const ENOSTR: ::c_int = 60; ++pub const ENODATA: ::c_int = 61; ++pub const ETIME: ::c_int = 62; ++pub const ENOSR: ::c_int = 63; ++pub const ENONET: ::c_int = 64; ++pub const ENOPKG: ::c_int = 65; ++pub const EREMOTE: ::c_int = 66; ++pub const ENOLINK: ::c_int = 67; ++pub const EADV: ::c_int = 68; ++pub const ESRMNT: ::c_int = 69; ++pub const ECOMM: ::c_int = 70; ++pub const EPROTO: ::c_int = 71; ++pub const EDOTDOT: ::c_int = 73; ++ ++pub const SA_NODEFER: ::c_int = 0x40000000; ++pub const SA_RESETHAND: ::c_int = 0x80000000; ++pub const SA_RESTART: ::c_int = 0x10000000; ++pub const SA_NOCLDSTOP: ::c_int = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: ::c_int = 0x80000; ++pub const EFD_CLOEXEC: ::c_int = 0x80000; ++ ++pub const O_DIRECT: ::c_int = 0x4000; ++pub const O_DIRECTORY: ::c_int = 0x10000; ++pub const O_NOFOLLOW: ::c_int = 0x20000; ++ ++pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7; ++pub const RLIMIT_AS: ::__rlimit_resource_t = 9; ++pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; ++pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6; ++pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; ++ ++pub const O_APPEND: ::c_int = 1024; ++pub const O_CREAT: ::c_int = 64; ++pub const O_EXCL: ::c_int = 128; ++pub const O_NOCTTY: ::c_int = 256; ++pub const O_NONBLOCK: ::c_int = 2048; ++pub const O_SYNC: ::c_int = 0x101000; ++pub const O_RSYNC: ::c_int = 0x101000; ++pub const O_FSYNC: ::c_int = 0x101000; ++pub const O_ASYNC: ::c_int = 0x2000; ++pub const O_DSYNC: ::c_int = 0x1000; ++pub const O_NDELAY: ::c_int = 0x800; ++ ++pub const EDEADLK: ::c_int = 35; ++pub const ENAMETOOLONG: ::c_int = 36; ++pub const ENOLCK: ::c_int = 37; ++pub const ENOSYS: ::c_int = 38; ++pub const ENOTEMPTY: ::c_int = 39; ++pub const ELOOP: ::c_int = 40; ++pub const ENOMSG: ::c_int = 42; ++pub const EIDRM: ::c_int = 43; ++pub const ECHRNG: ::c_int = 44; ++pub const EL2NSYNC: ::c_int = 45; ++pub const EL3HLT: ::c_int = 46; ++pub const EL3RST: ::c_int = 47; ++pub const ELNRNG: ::c_int = 48; ++pub const EUNATCH: ::c_int = 49; ++pub const ENOCSI: ::c_int = 50; ++pub const EL2HLT: ::c_int = 51; ++pub const EBADE: ::c_int = 52; ++pub const EBADR: ::c_int = 53; ++pub const EXFULL: ::c_int = 54; ++pub const ENOANO: ::c_int = 55; ++pub const EBADRQC: ::c_int = 56; ++pub const EBADSLT: ::c_int = 57; ++pub const EDEADLOCK: ::c_int = 35; ++pub const EMULTIHOP: ::c_int = 72; ++pub const EOVERFLOW: ::c_int = 75; ++pub const ENOTUNIQ: ::c_int = 76; ++pub const EBADFD: ::c_int = 77; ++pub const EBADMSG: ::c_int = 74; ++pub const EREMCHG: ::c_int = 78; ++pub const ELIBACC: ::c_int = 79; ++pub const ELIBBAD: ::c_int = 80; ++pub const ELIBSCN: ::c_int = 81; ++pub const ELIBMAX: ::c_int = 82; ++pub const ELIBEXEC: ::c_int = 83; ++pub const EILSEQ: ::c_int = 84; ++pub const ERESTART: ::c_int = 85; ++pub const ESTRPIPE: ::c_int = 86; ++pub const EUSERS: ::c_int = 87; ++pub const ENOTSOCK: ::c_int = 88; ++pub const EDESTADDRREQ: ::c_int = 89; ++pub const EMSGSIZE: ::c_int = 90; ++pub const EPROTOTYPE: ::c_int = 91; ++pub const ENOPROTOOPT: ::c_int = 92; ++pub const EPROTONOSUPPORT: ::c_int = 93; ++pub const ESOCKTNOSUPPORT: ::c_int = 94; ++pub const EOPNOTSUPP: ::c_int = 95; ++pub const EPFNOSUPPORT: ::c_int = 96; ++pub const EAFNOSUPPORT: ::c_int = 97; ++pub const EADDRINUSE: ::c_int = 98; ++pub const EADDRNOTAVAIL: ::c_int = 99; ++pub const ENETDOWN: ::c_int = 100; ++pub const ENETUNREACH: ::c_int = 101; ++pub const ENETRESET: ::c_int = 102; ++pub const ECONNABORTED: ::c_int = 103; ++pub const ECONNRESET: ::c_int = 104; ++pub const ENOBUFS: ::c_int = 105; ++pub const EISCONN: ::c_int = 106; ++pub const ENOTCONN: ::c_int = 107; ++pub const ESHUTDOWN: ::c_int = 108; ++pub const ETOOMANYREFS: ::c_int = 109; ++pub const ETIMEDOUT: ::c_int = 110; ++pub const ECONNREFUSED: ::c_int = 111; ++pub const EHOSTDOWN: ::c_int = 112; ++pub const EHOSTUNREACH: ::c_int = 113; ++pub const EALREADY: ::c_int = 114; ++pub const EINPROGRESS: ::c_int = 115; ++pub const ESTALE: ::c_int = 116; ++pub const EUCLEAN: ::c_int = 117; ++pub const ENOTNAM: ::c_int = 118; ++pub const ENAVAIL: ::c_int = 119; ++pub const EISNAM: ::c_int = 120; ++pub const EREMOTEIO: ::c_int = 121; ++pub const EDQUOT: ::c_int = 122; ++pub const ENOMEDIUM: ::c_int = 123; ++pub const EMEDIUMTYPE: ::c_int = 124; ++pub const ECANCELED: ::c_int = 125; ++pub const ENOKEY: ::c_int = 126; ++pub const EKEYEXPIRED: ::c_int = 127; ++pub const EKEYREVOKED: ::c_int = 128; ++pub const EKEYREJECTED: ::c_int = 129; ++pub const EOWNERDEAD: ::c_int = 130; ++pub const ENOTRECOVERABLE: ::c_int = 131; ++pub const ERFKILL: ::c_int = 132; ++pub const EHWPOISON: ::c_int = 133; ++ ++pub const MAP_NORESERVE: ::c_int = 0x4000; ++pub const MAP_ANONYMOUS: ::c_int = 0x0020; ++pub const MAP_ANON: ::c_int = 0x0020; ++pub const MAP_GROWSDOWN: ::c_int = 0x0100; ++pub const MAP_DENYWRITE: ::c_int = 0x0800; ++pub const MAP_EXECUTABLE: ::c_int = 0x1000; ++pub const MAP_LOCKED: ::c_int = 0x2000; ++pub const MAP_POPULATE: ::c_int = 0x8000; ++pub const MAP_NONBLOCK: ::c_int = 0x10000; ++pub const MAP_STACK: ::c_int = 0x20000; ++pub const MAP_HUGETLB: ::c_int = 0x40000; ++ ++pub const SOCK_STREAM: ::c_int = 1; ++pub const SOCK_DGRAM: ::c_int = 2; ++ ++pub const FIOCLEX: ::c_ulong = 0x5451; ++pub const FIONCLEX: ::c_ulong = 0x5450; ++pub const FIONBIO: ::c_ulong = 0x5421; ++ ++pub const SA_ONSTACK: ::c_int = 0x08000000; ++pub const SA_SIGINFO: ::c_int = 0x00000004; ++pub const SA_NOCLDWAIT: ::c_int = 0x00000002; ++ ++pub const SIGCHLD: ::c_int = 17; ++pub const SIGBUS: ::c_int = 7; ++pub const SIGTTIN: ::c_int = 21; ++pub const SIGTTOU: ::c_int = 22; ++pub const SIGXCPU: ::c_int = 24; ++pub const SIGXFSZ: ::c_int = 25; ++pub const SIGVTALRM: ::c_int = 26; ++pub const SIGPROF: ::c_int = 27; ++pub const SIGWINCH: ::c_int = 28; ++pub const SIGUSR1: ::c_int = 10; ++pub const SIGUSR2: ::c_int = 12; ++pub const SIGCONT: ::c_int = 18; ++pub const SIGSTOP: ::c_int = 19; ++pub const SIGTSTP: ::c_int = 20; ++pub const SIGURG: ::c_int = 23; ++pub const SIGIO: ::c_int = 29; ++pub const SIGSYS: ::c_int = 31; ++pub const SIGPOLL: ::c_int = 29; ++pub const SIGPWR: ::c_int = 30; ++pub const SIG_SETMASK: ::c_int = 2; ++pub const SIG_BLOCK: ::c_int = 0; ++pub const SIG_UNBLOCK: ::c_int = 1; ++ ++pub const POLLWRNORM: ::c_short = 0x100; ++pub const POLLWRBAND: ::c_short = 0x200; ++ ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: ::tcflag_t = 0x00008000; ++pub const TOSTOP: ::tcflag_t = 0x00000100; ++pub const FLUSHO: ::tcflag_t = 0x00001000; ++pub const EXTPROC: ::tcflag_t = 0x00010000; ++pub const TCSANOW: ::c_int = 0; ++pub const TCSADRAIN: ::c_int = 1; ++pub const TCSAFLUSH: ::c_int = 2; ++ ++pub const PTRACE_GETFPREGS: ::c_uint = 14; ++pub const PTRACE_SETFPREGS: ::c_uint = 15; ++pub const PTRACE_DETACH: ::c_uint = 17; ++pub const PTRACE_GETFPXREGS: ::c_uint = 18; ++pub const PTRACE_SETFPXREGS: ::c_uint = 19; ++pub const PTRACE_GETREGS: ::c_uint = 12; ++pub const PTRACE_SETREGS: ::c_uint = 13; ++ ++pub const EFD_NONBLOCK: ::c_int = 0x800; ++ ++pub const F_RDLCK: ::c_int = 0; ++pub const F_WRLCK: ::c_int = 1; ++pub const F_UNLCK: ::c_int = 2; ++pub const F_GETLK: ::c_int = 5; ++pub const F_GETOWN: ::c_int = 9; ++pub const F_SETOWN: ::c_int = 8; ++pub const F_SETLK: ::c_int = 6; ++pub const F_SETLKW: ::c_int = 7; ++pub const F_OFD_GETLK: ::c_int = 36; ++pub const F_OFD_SETLK: ::c_int = 37; ++pub const F_OFD_SETLKW: ::c_int = 38; ++ ++pub const SFD_NONBLOCK: ::c_int = 0x800; ++ ++pub const TCGETS: ::c_ulong = 0x5401; ++pub const TCSETS: ::c_ulong = 0x5402; ++pub const TCSETSW: ::c_ulong = 0x5403; ++pub const TCSETSF: ::c_ulong = 0x5404; ++pub const TCGETA: ::c_ulong = 0x5405; ++pub const TCSETA: ::c_ulong = 0x5406; ++pub const TCSETAW: ::c_ulong = 0x5407; ++pub const TCSETAF: ::c_ulong = 0x5408; ++pub const TCSBRK: ::c_ulong = 0x5409; ++pub const TCXONC: ::c_ulong = 0x540a; ++pub const TCFLSH: ::c_ulong = 0x540b; ++pub const TIOCSBRK: ::c_ulong = 0x5427; ++pub const TIOCCBRK: ::c_ulong = 0x5428; ++pub const TIOCGSOFTCAR: ::c_ulong = 0x5419; ++pub const TIOCSSOFTCAR: ::c_ulong = 0x541a; ++pub const TIOCINQ: ::c_ulong = 0x541b; ++pub const TIOCLINUX: ::c_ulong = 0x541c; ++pub const TIOCGSERIAL: ::c_ulong = 0x541e; ++pub const TIOCEXCL: ::c_ulong = 0x540c; ++pub const TIOCNXCL: ::c_ulong = 0x540d; ++pub const TIOCSCTTY: ::c_ulong = 0x540e; ++pub const TIOCGPGRP: ::c_ulong = 0x540f; ++pub const TIOCSPGRP: ::c_ulong = 0x5410; ++pub const TIOCOUTQ: ::c_ulong = 0x5411; ++pub const TIOCSTI: ::c_ulong = 0x5412; ++pub const TIOCGWINSZ: ::c_ulong = 0x5413; ++pub const TIOCSWINSZ: ::c_ulong = 0x5414; ++pub const TIOCMGET: ::c_ulong = 0x5415; ++pub const TIOCMBIS: ::c_ulong = 0x5416; ++pub const TIOCMBIC: ::c_ulong = 0x5417; ++pub const TIOCMSET: ::c_ulong = 0x5418; ++pub const FIONREAD: ::c_ulong = 0x541b; ++pub const TIOCCONS: ::c_ulong = 0x541d; ++ ++pub const RTLD_DEEPBIND: ::c_int = 0x8; ++pub const RTLD_GLOBAL: ::c_int = 0x100; ++pub const RTLD_NOLOAD: ::c_int = 0x4; ++ ++pub const MCL_CURRENT: ::c_int = 0x0001; ++pub const MCL_FUTURE: ::c_int = 0x0002; ++ ++pub const SIGSTKSZ: ::size_t = 8192; ++pub const MINSIGSTKSZ: ::size_t = 2048; ++pub const CBAUD: ::tcflag_t = 0o0010017; ++pub const TAB1: ::tcflag_t = 0x00000800; ++pub const TAB2: ::tcflag_t = 0x00001000; ++pub const TAB3: ::tcflag_t = 0x00001800; ++pub const CR1: ::tcflag_t = 0x00000200; ++pub const CR2: ::tcflag_t = 0x00000400; ++pub const CR3: ::tcflag_t = 0x00000600; ++pub const FF1: ::tcflag_t = 0x00008000; ++pub const BS1: ::tcflag_t = 0x00002000; ++pub const VT1: ::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: ::tcflag_t = 0x00000400; ++pub const IXOFF: ::tcflag_t = 0x00001000; ++pub const ONLCR: ::tcflag_t = 0x4; ++pub const CSIZE: ::tcflag_t = 0x00000030; ++pub const CS6: ::tcflag_t = 0x00000010; ++pub const CS7: ::tcflag_t = 0x00000020; ++pub const CS8: ::tcflag_t = 0x00000030; ++pub const CSTOPB: ::tcflag_t = 0x00000040; ++pub const CREAD: ::tcflag_t = 0x00000080; ++pub const PARENB: ::tcflag_t = 0x00000100; ++pub const PARODD: ::tcflag_t = 0x00000200; ++pub const HUPCL: ::tcflag_t = 0x00000400; ++pub const CLOCAL: ::tcflag_t = 0x00000800; ++pub const ECHOKE: ::tcflag_t = 0x00000800; ++pub const ECHOE: ::tcflag_t = 0x00000010; ++pub const ECHOK: ::tcflag_t = 0x00000020; ++pub const ECHONL: ::tcflag_t = 0x00000040; ++pub const ECHOPRT: ::tcflag_t = 0x00000400; ++pub const ECHOCTL: ::tcflag_t = 0x00000200; ++pub const ISIG: ::tcflag_t = 0x00000001; ++pub const ICANON: ::tcflag_t = 0x00000002; ++pub const PENDIN: ::tcflag_t = 0x00004000; ++pub const NOFLSH: ::tcflag_t = 0x00000080; ++pub const CIBAUD: ::tcflag_t = 0o02003600000; ++pub const CBAUDEX: ::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: ::tcflag_t = 0o000002; ++pub const NLDLY: ::tcflag_t = 0o000400; ++pub const CRDLY: ::tcflag_t = 0o003000; ++pub const TABDLY: ::tcflag_t = 0o014000; ++pub const BSDLY: ::tcflag_t = 0o020000; ++pub const FFDLY: ::tcflag_t = 0o100000; ++pub const VTDLY: ::tcflag_t = 0o040000; ++pub const XTABS: ::tcflag_t = 0o014000; ++ ++pub const B0: ::speed_t = 0o000000; ++pub const B50: ::speed_t = 0o000001; ++pub const B75: ::speed_t = 0o000002; ++pub const B110: ::speed_t = 0o000003; ++pub const B134: ::speed_t = 0o000004; ++pub const B150: ::speed_t = 0o000005; ++pub const B200: ::speed_t = 0o000006; ++pub const B300: ::speed_t = 0o000007; ++pub const B600: ::speed_t = 0o000010; ++pub const B1200: ::speed_t = 0o000011; ++pub const B1800: ::speed_t = 0o000012; ++pub const B2400: ::speed_t = 0o000013; ++pub const B4800: ::speed_t = 0o000014; ++pub const B9600: ::speed_t = 0o000015; ++pub const B19200: ::speed_t = 0o000016; ++pub const B38400: ::speed_t = 0o000017; ++pub const EXTA: ::speed_t = B19200; ++pub const EXTB: ::speed_t = B38400; ++pub const BOTHER: ::speed_t = 0o010000; ++pub const B57600: ::speed_t = 0o010001; ++pub const B115200: ::speed_t = 0o010002; ++pub const B230400: ::speed_t = 0o010003; ++pub const B460800: ::speed_t = 0o010004; ++pub const B500000: ::speed_t = 0o010005; ++pub const B576000: ::speed_t = 0o010006; ++pub const B921600: ::speed_t = 0o010007; ++pub const B1000000: ::speed_t = 0o010010; ++pub const B1152000: ::speed_t = 0o010011; ++pub const B1500000: ::speed_t = 0o010012; ++pub const B2000000: ::speed_t = 0o010013; ++pub const B2500000: ::speed_t = 0o010014; ++pub const B3000000: ::speed_t = 0o010015; ++pub const B3500000: ::speed_t = 0o010016; ++pub const B4000000: ::speed_t = 0o010017; ++ ++pub const TIOCM_ST: ::c_int = 0x008; ++pub const TIOCM_SR: ::c_int = 0x010; ++pub const TIOCM_CTS: ::c_int = 0x020; ++pub const TIOCM_CAR: ::c_int = 0x040; ++pub const TIOCM_RNG: ::c_int = 0x080; ++pub const TIOCM_DSR: ::c_int = 0x100; ++ ++extern "C" { ++ pub fn sysctl( ++ name: *mut ::c_int, ++ namelen: ::c_int, ++ oldp: *mut ::c_void, ++ oldlenp: *mut ::size_t, ++ newp: *mut ::c_void, ++ newlen: ::size_t, ++ ) -> ::c_int; ++} ++ ++cfg_if! { ++ if #[cfg(libc_align)] { ++ mod align; ++ pub use self::align::*; ++ } ++} +diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs +index db82f26dc..2c3ded335 100644 +--- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs ++++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs +@@ -70,6 +70,7 @@ s! { + pub sem_otime: ::time_t, + #[cfg(not(any( + target_arch = "aarch64", ++ target_arch = "loongarch64", + target_arch = "mips64", + target_arch = "powerpc64", + target_arch = "riscv64", +@@ -78,6 +79,7 @@ s! { + pub sem_ctime: ::time_t, + #[cfg(not(any( + target_arch = "aarch64", ++ target_arch = "loongarch64", + target_arch = "mips64", + target_arch = "powerpc64", + target_arch = "riscv64", +@@ -116,6 +118,9 @@ cfg_if! { + } else if #[cfg(any(target_arch = "riscv64"))] { + mod riscv64; + pub use self::riscv64::*; ++ } else if #[cfg(any(target_arch = "loongarch64"))] { ++ mod loongarch64; ++ pub use self::loongarch64::*; + } else { + // Unknown target_arch + } +diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +index 0ae854214..fd14fd2a5 100644 +--- a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs ++++ b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +@@ -465,22 +465,26 @@ s_no_extra_traits! { + + #[cfg(any(target_arch = "aarch64", + target_arch = "s390x", ++ target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + pub ut_session: ::c_long, + #[cfg(any(target_arch = "aarch64", + target_arch = "s390x", ++ target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + pub ut_tv: ::timeval, + + #[cfg(not(any(target_arch = "aarch64", + target_arch = "s390x", ++ target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] + pub ut_session: i32, + #[cfg(not(any(target_arch = "aarch64", + target_arch = "s390x", ++ target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] + pub ut_tv: __timeval, +@@ -1350,7 +1354,8 @@ cfg_if! { + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", +- target_arch = "riscv64"))] { ++ target_arch = "riscv64", ++ target_arch = "loongarch64"))] { + mod b64; + pub use self::b64::*; + } else { +diff --git a/vendor/libc/src/unix/linux_like/linux/no_align.rs b/vendor/libc/src/unix/linux_like/linux/no_align.rs +index de64be5a3..b64b1d4da 100644 +--- a/vendor/libc/src/unix/linux_like/linux/no_align.rs ++++ b/vendor/libc/src/unix/linux_like/linux/no_align.rs +@@ -9,6 +9,7 @@ macro_rules! expand_align { + target_arch = "sparc64", + target_arch = "riscv64", + target_arch = "riscv32", ++ target_arch = "loongarch64", + all(target_arch = "aarch64", + target_env = "musl")))] + __align: [::c_int; 0], +@@ -19,6 +20,7 @@ macro_rules! expand_align { + target_arch = "sparc64", + target_arch = "riscv64", + target_arch = "riscv32", ++ target_arch = "loongarch64", + all(target_arch = "aarch64", + target_env = "musl"))))] + __align: [::c_long; 0], +diff --git a/vendor/object-0.26.2/src/common.rs b/vendor/object-0.26.2/src/common.rs +index c86665c21..0759a9d4e 100644 +--- a/vendor/object-0.26.2/src/common.rs ++++ b/vendor/object-0.26.2/src/common.rs +@@ -23,6 +23,7 @@ pub enum Architecture { + S390x, + Sparc64, + Wasm32, ++ LoongArch64, + } + + impl Architecture { +@@ -50,6 +51,7 @@ impl Architecture { + Architecture::S390x => Some(AddressSize::U64), + Architecture::Sparc64 => Some(AddressSize::U64), + Architecture::Wasm32 => Some(AddressSize::U32), ++ Architecture::LoongArch64 => Some(AddressSize::U64), + } + } + } +diff --git a/vendor/object-0.26.2/src/elf.rs b/vendor/object-0.26.2/src/elf.rs +index 28ac16bbe..3abfe2256 100644 +--- a/vendor/object-0.26.2/src/elf.rs ++++ b/vendor/object-0.26.2/src/elf.rs +@@ -564,6 +564,8 @@ pub const EM_BPF: u16 = 247; + pub const EM_CSKY: u16 = 252; + /// Digital Alpha + pub const EM_ALPHA: u16 = 0x9026; ++/// LOONGARCH ++pub const EM_LOONGARCH: u16 = 258; + + // Values for `FileHeader*::e_version` and `Ident::version`. + /// Invalid ELF version. +@@ -6081,6 +6083,201 @@ pub const R_RISCV_SET32: u32 = 56; + #[allow(missing_docs)] + pub const R_RISCV_32_PCREL: u32 = 57; + ++// LoongArch values `FileHeader*::e_flags`. ++// Base ABI Modifiers ++pub const EF_LOONGARCH_ABI_SOFT_FLOAT: u32 = 0x1; ++pub const EF_LOONGARCH_ABI_SINGLE_FLOAT: u32 = 0x2; ++pub const EF_LOONGARCH_ABI_DOUBLE_FLOAT: u32 = 0x3; ++pub const EF_LOONGARCH_ABI_MODIFIER_MASK: u32 = 0x7; ++ ++// Object file ABI versions ++pub const EF_LOONGARCH_OBJABI_V0: u32 = 0x0; ++pub const EF_LOONGARCH_OBJABI_V1: u32 = 0x40; ++pub const EF_LOONGARCH_OBJABI_MASK: u32 = 0xC0; ++ ++// LOONGARCH values `Rel*::r_type`. ++/* Loongarch specific dynamic relocations. */ ++#[allow(missing_docs)] ++pub const R_LARCH_NONE: u32 = 0; ++#[allow(missing_docs)] ++pub const R_LARCH_32: u32 = 1; ++#[allow(missing_docs)] ++pub const R_LARCH_64: u32 = 2; ++#[allow(missing_docs)] ++pub const R_LARCH_RELATIVE: u32 = 3; ++#[allow(missing_docs)] ++pub const R_LARCH_COPY: u32 = 4; ++#[allow(missing_docs)] ++pub const R_LARCH_JUMP_SLOT: u32 = 5; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPMOD32: u32 = 6; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPMOD64: u32 = 7; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPREL32: u32 = 8; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPREL64: u32 = 9; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_TPREL32: u32 = 10; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_TPREL64: u32 = 11; ++#[allow(missing_docs)] ++pub const R_LARCH_IRELATIVE: u32 = 12; ++#[allow(missing_docs)] ++pub const R_LARCH_MARK_LA: u32 = 20; ++#[allow(missing_docs)] ++pub const R_LARCH_MARK_PCREL: u32 = 21; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_PCREL: u32 = 22; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_ABSOLUTE: u32 = 23; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_DUP: u32 = 24; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_GPREL: u32 = 25; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_TPREL: u32 = 26; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_GOT: u32 = 27; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_GD: u32 = 28; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_PLT_PCREL: u32 = 29; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_ASSERT: u32 = 30; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_NOT: u32 = 31; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SUB: u32 = 32; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SL: u32 = 33; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SR: u32 = 34; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_ADD: u32 = 35; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_AND: u32 = 36; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_IF_ELSE: u32 = 37; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_5: u32 = 38; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_U_10_12: u32 = 39; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_12: u32 = 40; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_16: u32 = 41; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_16_S2: u32 = 42; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_5_20: u32 = 43; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_0_5_10_16_S2: u32 = 44; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_0_10_10_16_S2: u32 = 45; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_U: u32 = 46; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD8: u32 = 47; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD16: u32 = 48; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD24: u32 = 49; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD32: u32 = 50; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD64: u32 = 51; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB8: u32 = 52; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB16: u32 = 53; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB24: u32 = 54; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB32: u32 = 55; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB64: u32 = 56; ++#[allow(missing_docs)] ++pub const R_LARCH_GNU_VTINHERIT: u32 = 57; ++#[allow(missing_docs)] ++pub const R_LARCH_GNU_VTENTRY: u32 = 58; ++#[allow(missing_docs)] ++pub const R_LARCH_B16: u32 = 64; ++#[allow(missing_docs)] ++pub const R_LARCH_B21: u32 = 65; ++#[allow(missing_docs)] ++pub const R_LARCH_B26: u32 = 66; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS_HI20: u32 = 67; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS_LO12: u32 = 68; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS64_LO20: u32 = 69; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS64_HI12: u32 = 70; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA_HI20: u32 = 71; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA_LO12: u32 = 72; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA64_LO20: u32 = 73; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA64_HI12: u32 = 74; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_PC_HI20: u32 = 75; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_PC_LO12: u32 = 76; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_PC_LO20: u32 = 77; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_PC_HI12: u32 = 78; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_HI20: u32 = 79; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_LO12: u32 = 80; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_LO20: u32 = 81; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_HI12: u32 = 82; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE_HI20: u32 = 83; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE_LO12: u32 = 84; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE64_LO20: u32 = 85; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE64_HI12: u32 = 86; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_PC_HI20: u32 = 87; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_PC_LO12: u32 = 88; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_PC_LO20: u32 = 89; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_PC_HI12: u32 = 90; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_HI20: u32 = 91; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_LO12: u32 = 92; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_LO20: u32 = 93; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_HI12: u32 = 94; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LD_PC_HI20: u32 = 95; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LD_HI20: u32 = 96; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_GD_PC_HI20: u32 = 97; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_GD_HI20: u32 = 98; ++#[allow(missing_docs)] ++pub const R_LARCH_32_PCREL: u32 = 99; ++#[allow(missing_docs)] ++pub const R_LARCH_RELAX: u32 = 100; ++ ++ ++ + // BPF values `Rel*::r_type`. + /// No reloc + pub const R_BPF_NONE: u32 = 0; +diff --git a/vendor/object-0.26.2/src/read/elf/file.rs b/vendor/object-0.26.2/src/read/elf/file.rs +index 91273ca41..00262dafc 100644 +--- a/vendor/object-0.26.2/src/read/elf/file.rs ++++ b/vendor/object-0.26.2/src/read/elf/file.rs +@@ -161,6 +161,7 @@ where + (elf::EM_X86_64, false) => Architecture::X86_64_X32, + (elf::EM_X86_64, true) => Architecture::X86_64, + (elf::EM_HEXAGON, _) => Architecture::Hexagon, ++ (elf::EM_LOONGARCH, true) => Architecture::LoongArch64, + (elf::EM_MIPS, false) => Architecture::Mips, + (elf::EM_MIPS, true) => Architecture::Mips64, + (elf::EM_MSP430, _) => Architecture::Msp430, +diff --git a/vendor/object-0.26.2/src/read/elf/relocation.rs b/vendor/object-0.26.2/src/read/elf/relocation.rs +index d3e24b2e8..790cebc91 100644 +--- a/vendor/object-0.26.2/src/read/elf/relocation.rs ++++ b/vendor/object-0.26.2/src/read/elf/relocation.rs +@@ -301,6 +301,11 @@ fn parse_relocation( + elf::R_HEX_32 => (RelocationKind::Absolute, 32), + r_type => (RelocationKind::Elf(r_type), 0), + }, ++ elf::EM_LOONGARCH => match reloc.r_type(endian, false) { ++ elf::R_LARCH_32 => (RelocationKind::Absolute, 32), ++ elf::R_LARCH_64 => (RelocationKind::Absolute, 64), ++ r_type => (RelocationKind::Elf(r_type), 0), ++ }, + elf::EM_MIPS => match reloc.r_type(endian, is_mips64el) { + elf::R_MIPS_16 => (RelocationKind::Absolute, 16), + elf::R_MIPS_32 => (RelocationKind::Absolute, 32), +diff --git a/vendor/object-0.26.2/src/write/elf.rs b/vendor/object-0.26.2/src/write/elf.rs +index 34e0abc85..16f70b2f0 100644 +--- a/vendor/object-0.26.2/src/write/elf.rs ++++ b/vendor/object-0.26.2/src/write/elf.rs +@@ -88,6 +88,7 @@ impl Object { + Architecture::Riscv32 => true, + Architecture::S390x => true, + Architecture::Sparc64 => true, ++ Architecture::LoongArch64 => true, + _ => { + return Err(Error(format!( + "unimplemented architecture {:?}", +@@ -371,6 +372,7 @@ impl Object { + Architecture::Riscv64 => elf::EM_RISCV, + Architecture::S390x => elf::EM_S390, + Architecture::Sparc64 => elf::EM_SPARCV9, ++ Architecture::LoongArch64 => elf::EM_LOONGARCH, + _ => { + return Err(Error(format!( + "unimplemented architecture {:?}", +@@ -682,6 +684,15 @@ impl Object { + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + }, ++ Architecture::LoongArch64 => match (reloc.kind, reloc.encoding, reloc.size) { ++ (RelocationKind::Absolute, _, 32) => elf::R_LARCH_32, ++ (RelocationKind::Absolute, _, 64) => elf::R_LARCH_64, ++ (RelocationKind::Elf(x), _, _) => x, ++ _ => { ++ return Err(Error(format!("unimplemented relocation {:?}", reloc))); ++ } ++ }, ++ + Architecture::Mips | Architecture::Mips64 => { + match (reloc.kind, reloc.encoding, reloc.size) { + (RelocationKind::Absolute, _, 16) => elf::R_MIPS_16, +diff --git a/vendor/object-0.26.2/tests/round_trip/mod.rs b/vendor/object-0.26.2/tests/round_trip/mod.rs +index 37050689f..5d97f7ab9 100644 +--- a/vendor/object-0.26.2/tests/round_trip/mod.rs ++++ b/vendor/object-0.26.2/tests/round_trip/mod.rs +@@ -236,6 +236,7 @@ fn elf_any() { + (Architecture::X86_64, Endianness::Little), + (Architecture::X86_64_X32, Endianness::Little), + (Architecture::Hexagon, Endianness::Little), ++ (Architecture::LoongArch64, Endianness::Little), + (Architecture::Mips, Endianness::Little), + (Architecture::Mips64, Endianness::Little), + (Architecture::Msp430, Endianness::Little), +diff --git a/vendor/object-0.28.1/src/common.rs b/vendor/object-0.28.1/src/common.rs +index c86665c21..0759a9d4e 100644 +--- a/vendor/object-0.28.1/src/common.rs ++++ b/vendor/object-0.28.1/src/common.rs +@@ -23,6 +23,7 @@ pub enum Architecture { + S390x, + Sparc64, + Wasm32, ++ LoongArch64, + } + + impl Architecture { +@@ -50,6 +51,7 @@ impl Architecture { + Architecture::S390x => Some(AddressSize::U64), + Architecture::Sparc64 => Some(AddressSize::U64), + Architecture::Wasm32 => Some(AddressSize::U32), ++ Architecture::LoongArch64 => Some(AddressSize::U64), + } + } + } +diff --git a/vendor/object-0.28.1/src/elf.rs b/vendor/object-0.28.1/src/elf.rs +index 1818a0ad9..d248f1efb 100644 +--- a/vendor/object-0.28.1/src/elf.rs ++++ b/vendor/object-0.28.1/src/elf.rs +@@ -564,6 +564,8 @@ pub const EM_BPF: u16 = 247; + pub const EM_CSKY: u16 = 252; + /// Digital Alpha + pub const EM_ALPHA: u16 = 0x9026; ++/// LOONGARCH ++pub const EM_LOONGARCH: u16 = 258; + + // Values for `FileHeader*::e_version` and `Ident::version`. + /// Invalid ELF version. +@@ -6089,6 +6091,199 @@ pub const R_RISCV_SET32: u32 = 56; + #[allow(missing_docs)] + pub const R_RISCV_32_PCREL: u32 = 57; + ++// LoongArch values `FileHeader*::e_flags`. ++// Base ABI Modifiers ++pub const EF_LOONGARCH_ABI_SOFT_FLOAT: u32 = 0x1; ++pub const EF_LOONGARCH_ABI_SINGLE_FLOAT: u32 = 0x2; ++pub const EF_LOONGARCH_ABI_DOUBLE_FLOAT: u32 = 0x3; ++pub const EF_LOONGARCH_ABI_MODIFIER_MASK: u32 = 0x7; ++ ++// Object file ABI versions ++pub const EF_LOONGARCH_OBJABI_V0: u32 = 0x0; ++pub const EF_LOONGARCH_OBJABI_V1: u32 = 0x40; ++pub const EF_LOONGARCH_OBJABI_MASK: u32 = 0xC0; ++ ++// LOONGARCH values `Rel*::r_type`. ++/* Loongarch specific dynamic relocations. */ ++#[allow(missing_docs)] ++pub const R_LARCH_NONE: u32 = 0; ++#[allow(missing_docs)] ++pub const R_LARCH_32: u32 = 1; ++#[allow(missing_docs)] ++pub const R_LARCH_64: u32 = 2; ++#[allow(missing_docs)] ++pub const R_LARCH_RELATIVE: u32 = 3; ++#[allow(missing_docs)] ++pub const R_LARCH_COPY: u32 = 4; ++#[allow(missing_docs)] ++pub const R_LARCH_JUMP_SLOT: u32 = 5; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPMOD32: u32 = 6; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPMOD64: u32 = 7; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPREL32: u32 = 8; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPREL64: u32 = 9; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_TPREL32: u32 = 10; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_TPREL64: u32 = 11; ++#[allow(missing_docs)] ++pub const R_LARCH_IRELATIVE: u32 = 12; ++#[allow(missing_docs)] ++pub const R_LARCH_MARK_LA: u32 = 20; ++#[allow(missing_docs)] ++pub const R_LARCH_MARK_PCREL: u32 = 21; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_PCREL: u32 = 22; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_ABSOLUTE: u32 = 23; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_DUP: u32 = 24; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_GPREL: u32 = 25; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_TPREL: u32 = 26; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_GOT: u32 = 27; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_GD: u32 = 28; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_PLT_PCREL: u32 = 29; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_ASSERT: u32 = 30; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_NOT: u32 = 31; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SUB: u32 = 32; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SL: u32 = 33; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SR: u32 = 34; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_ADD: u32 = 35; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_AND: u32 = 36; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_IF_ELSE: u32 = 37; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_5: u32 = 38; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_U_10_12: u32 = 39; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_12: u32 = 40; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_16: u32 = 41; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_10_16_S2: u32 = 42; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_5_20: u32 = 43; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_0_5_10_16_S2: u32 = 44; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_S_0_10_10_16_S2: u32 = 45; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_POP_32_U: u32 = 46; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD8: u32 = 47; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD16: u32 = 48; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD24: u32 = 49; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD32: u32 = 50; ++#[allow(missing_docs)] ++pub const R_LARCH_ADD64: u32 = 51; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB8: u32 = 52; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB16: u32 = 53; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB24: u32 = 54; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB32: u32 = 55; ++#[allow(missing_docs)] ++pub const R_LARCH_SUB64: u32 = 56; ++#[allow(missing_docs)] ++pub const R_LARCH_GNU_VTINHERIT: u32 = 57; ++#[allow(missing_docs)] ++pub const R_LARCH_GNU_VTENTRY: u32 = 58; ++#[allow(missing_docs)] ++pub const R_LARCH_B16: u32 = 64; ++#[allow(missing_docs)] ++pub const R_LARCH_B21: u32 = 65; ++#[allow(missing_docs)] ++pub const R_LARCH_B26: u32 = 66; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS_HI20: u32 = 67; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS_LO12: u32 = 68; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS64_LO20: u32 = 69; ++#[allow(missing_docs)] ++pub const R_LARCH_ABS64_HI12: u32 = 70; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA_HI20: u32 = 71; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA_LO12: u32 = 72; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA64_LO20: u32 = 73; ++#[allow(missing_docs)] ++pub const R_LARCH_PCALA64_HI12: u32 = 74; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_PC_HI20: u32 = 75; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_PC_LO12: u32 = 76; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_PC_LO20: u32 = 77; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_PC_HI12: u32 = 78; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_HI20: u32 = 79; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT_LO12: u32 = 80; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_LO20: u32 = 81; ++#[allow(missing_docs)] ++pub const R_LARCH_GOT64_HI12: u32 = 82; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE_HI20: u32 = 83; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE_LO12: u32 = 84; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE64_LO20: u32 = 85; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LE64_HI12: u32 = 86; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_PC_HI20: u32 = 87; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_PC_LO12: u32 = 88; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_PC_LO20: u32 = 89; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_PC_HI12: u32 = 90; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_HI20: u32 = 91; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE_LO12: u32 = 92; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_LO20: u32 = 93; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_IE64_HI12: u32 = 94; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LD_PC_HI20: u32 = 95; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_LD_HI20: u32 = 96; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_GD_PC_HI20: u32 = 97; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_GD_HI20: u32 = 98; ++#[allow(missing_docs)] ++pub const R_LARCH_32_PCREL: u32 = 99; ++#[allow(missing_docs)] ++pub const R_LARCH_RELAX: u32 = 100; ++ + // BPF values `Rel*::r_type`. + /// No reloc + pub const R_BPF_NONE: u32 = 0; +diff --git a/vendor/object-0.28.1/src/read/elf/file.rs b/vendor/object-0.28.1/src/read/elf/file.rs +index 7df4ab2c7..3cc84d98b 100644 +--- a/vendor/object-0.28.1/src/read/elf/file.rs ++++ b/vendor/object-0.28.1/src/read/elf/file.rs +@@ -175,6 +175,7 @@ where + // We only support the 64-bit variant s390x here. + (elf::EM_S390, true) => Architecture::S390x, + (elf::EM_SPARCV9, true) => Architecture::Sparc64, ++ (elf::EM_LOONGARCH, true) => Architecture::LoongArch64, + _ => Architecture::Unknown, + } + } +diff --git a/vendor/object-0.28.1/src/read/elf/relocation.rs b/vendor/object-0.28.1/src/read/elf/relocation.rs +index 5930613a8..62e2820dc 100644 +--- a/vendor/object-0.28.1/src/read/elf/relocation.rs ++++ b/vendor/object-0.28.1/src/read/elf/relocation.rs +@@ -373,6 +373,11 @@ fn parse_relocation( + elf::R_SPARC_64 | elf::R_SPARC_UA64 => (RelocationKind::Absolute, 64), + r_type => (RelocationKind::Elf(r_type), 0), + } ++ }, ++ elf::EM_LOONGARCH => match reloc.r_type(endian, false) { ++ elf::R_LARCH_32 => (RelocationKind::Absolute, 32), ++ elf::R_LARCH_64 => (RelocationKind::Absolute, 64), ++ r_type => (RelocationKind::Elf(r_type), 0), + } + _ => (RelocationKind::Elf(reloc.r_type(endian, false)), 0), + }; +diff --git a/vendor/object-0.28.1/src/write/elf/object.rs b/vendor/object-0.28.1/src/write/elf/object.rs +index 834c6a19e..b1e0a23bb 100644 +--- a/vendor/object-0.28.1/src/write/elf/object.rs ++++ b/vendor/object-0.28.1/src/write/elf/object.rs +@@ -83,6 +83,7 @@ impl<'a> Object<'a> { + Architecture::Riscv32 => true, + Architecture::S390x => true, + Architecture::Sparc64 => true, ++ Architecture::LoongArch64 => true, + _ => { + return Err(Error(format!( + "unimplemented architecture {:?}", +@@ -279,6 +280,7 @@ impl<'a> Object<'a> { + Architecture::Riscv64 => elf::EM_RISCV, + Architecture::S390x => elf::EM_S390, + Architecture::Sparc64 => elf::EM_SPARCV9, ++ Architecture::LoongArch64 => elf::EM_LOONGARCH, + _ => { + return Err(Error(format!( + "unimplemented architecture {:?}", +@@ -517,6 +519,14 @@ impl<'a> Object<'a> { + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + }, ++ Architecture::LoongArch64 => match (reloc.kind, reloc.encoding, reloc.size) { ++ (RelocationKind::Absolute, _, 32) => elf::R_LARCH_32, ++ (RelocationKind::Absolute, _, 64) => elf::R_LARCH_64, ++ (RelocationKind::Elf(x), _, _) => x, ++ _ => { ++ return Err(Error(format!("unimplemented relocation {:?}", reloc))); ++ } ++ }, + Architecture::Mips | Architecture::Mips64 => { + match (reloc.kind, reloc.encoding, reloc.size) { + (RelocationKind::Absolute, _, 16) => elf::R_MIPS_16, +diff --git a/vendor/object-0.28.1/tests/round_trip/mod.rs b/vendor/object-0.28.1/tests/round_trip/mod.rs +index e400bfc5e..fc8d615be 100644 +--- a/vendor/object-0.28.1/tests/round_trip/mod.rs ++++ b/vendor/object-0.28.1/tests/round_trip/mod.rs +@@ -237,6 +237,7 @@ fn elf_any() { + (Architecture::X86_64, Endianness::Little), + (Architecture::X86_64_X32, Endianness::Little), + (Architecture::Hexagon, Endianness::Little), ++ (Architecture::LoongArch64, Endianness::Little), + (Architecture::Mips, Endianness::Little), + (Architecture::Mips64, Endianness::Little), + (Architecture::Msp430, Endianness::Little), +diff --git a/vendor/object/src/common.rs b/vendor/object/src/common.rs +index 917172e00..adf1575ee 100644 +--- a/vendor/object/src/common.rs ++++ b/vendor/object/src/common.rs +@@ -23,6 +23,7 @@ pub enum Architecture { + S390x, + Sparc64, + Wasm32, ++ LoongArch64, + } + + impl Architecture { +@@ -50,6 +51,7 @@ impl Architecture { + Architecture::S390x => Some(AddressSize::U64), + Architecture::Sparc64 => Some(AddressSize::U64), + Architecture::Wasm32 => Some(AddressSize::U32), ++ Architecture::LoongArch64 => Some(AddressSize::U64), + } + } + } +diff --git a/vendor/object/src/elf.rs b/vendor/object/src/elf.rs +index 1818a0ad9..d248f1efb 100644 +--- a/vendor/object/src/elf.rs ++++ b/vendor/object/src/elf.rs +@@ -564,6 +564,8 @@ pub const EM_BPF: u16 = 247; + pub const EM_CSKY: u16 = 252; + /// Digital Alpha + pub const EM_ALPHA: u16 = 0x9026; ++/// LOONGARCH ++pub const EM_LOONGARCH: u16 = 258; + + // Values for `FileHeader*::e_version` and `Ident::version`. + /// Invalid ELF version. +@@ -6089,6 +6091,199 @@ pub const R_RISCV_SET32: u32 = 56; + #[allow(missing_docs)] + pub const R_RISCV_32_PCREL: u32 = 57; + ++// LoongArch values `FileHeader*::e_flags`. ++// Base ABI Modifiers ++pub const EF_LOONGARCH_ABI_SOFT_FLOAT: u32 = 0x1; ++pub const EF_LOONGARCH_ABI_SINGLE_FLOAT: u32 = 0x2; ++pub const EF_LOONGARCH_ABI_DOUBLE_FLOAT: u32 = 0x3; ++pub const EF_LOONGARCH_ABI_MODIFIER_MASK: u32 = 0x7; ++ ++// Object file ABI versions ++pub const EF_LOONGARCH_OBJABI_V0: u32 = 0x0; ++pub const EF_LOONGARCH_OBJABI_V1: u32 = 0x40; ++pub const EF_LOONGARCH_OBJABI_MASK: u32 = 0xC0; ++ ++// LOONGARCH values `Rel*::r_type`. ++/* Loongarch specific dynamic relocations. */ ++#[allow(missing_docs)] ++pub const R_LARCH_NONE: u32 = 0; ++#[allow(missing_docs)] ++pub const R_LARCH_32: u32 = 1; ++#[allow(missing_docs)] ++pub const R_LARCH_64: u32 = 2; ++#[allow(missing_docs)] ++pub const R_LARCH_RELATIVE: u32 = 3; ++#[allow(missing_docs)] ++pub const R_LARCH_COPY: u32 = 4; ++#[allow(missing_docs)] ++pub const R_LARCH_JUMP_SLOT: u32 = 5; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPMOD32: u32 = 6; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPMOD64: u32 = 7; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPREL32: u32 = 8; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_DTPREL64: u32 = 9; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_TPREL32: u32 = 10; ++#[allow(missing_docs)] ++pub const R_LARCH_TLS_TPREL64: u32 = 11; ++#[allow(missing_docs)] ++pub const R_LARCH_IRELATIVE: u32 = 12; ++#[allow(missing_docs)] ++pub const R_LARCH_MARK_LA: u32 = 20; ++#[allow(missing_docs)] ++pub const R_LARCH_MARK_PCREL: u32 = 21; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_PCREL: u32 = 22; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_ABSOLUTE: u32 = 23; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_DUP: u32 = 24; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_GPREL: u32 = 25; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_TPREL: u32 = 26; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_GOT: u32 = 27; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_TLS_GD: u32 = 28; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_PUSH_PLT_PCREL: u32 = 29; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_ASSERT: u32 = 30; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_NOT: u32 = 31; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SUB: u32 = 32; ++#[allow(missing_docs)] ++pub const R_LARCH_SOP_SL: u32 = 33; ++#[allow(missing_docs)] +pub const R_LARCH_SOP_SR: u32 = 34; +#[allow(missing_docs)] +pub const R_LARCH_SOP_ADD: u32 = 35; @@ -1440,10 +3238,10 @@ index 28ac16bbe..c6b79a643 100644 /// No reloc pub const R_BPF_NONE: u32 = 0; diff --git a/vendor/object/src/read/elf/file.rs b/vendor/object/src/read/elf/file.rs -index 91273ca41..5340a8ed1 100644 +index 7df4ab2c7..3cc84d98b 100644 --- a/vendor/object/src/read/elf/file.rs +++ b/vendor/object/src/read/elf/file.rs -@@ -172,6 +172,7 @@ where +@@ -175,6 +175,7 @@ where // We only support the 64-bit variant s390x here. (elf::EM_S390, true) => Architecture::S390x, (elf::EM_SPARCV9, true) => Architecture::Sparc64, @@ -1452,7 +3250,7 @@ index 91273ca41..5340a8ed1 100644 } } diff --git a/vendor/object/src/read/elf/relocation.rs b/vendor/object/src/read/elf/relocation.rs -index d3e24b2e8..6ce97b945 100644 +index 5930613a8..62e2820dc 100644 --- a/vendor/object/src/read/elf/relocation.rs +++ b/vendor/object/src/read/elf/relocation.rs @@ -373,6 +373,11 @@ fn parse_relocation( @@ -1467,11 +3265,11 @@ index d3e24b2e8..6ce97b945 100644 } _ => (RelocationKind::Elf(reloc.r_type(endian, false)), 0), }; -diff --git a/vendor/object/src/write/elf.rs b/vendor/object/src/write/elf.rs -index 34e0abc85..3d208f2dd 100644 ---- a/vendor/object/src/write/elf.rs -+++ b/vendor/object/src/write/elf.rs -@@ -88,6 +88,7 @@ impl Object { +diff --git a/vendor/object/src/write/elf/object.rs b/vendor/object/src/write/elf/object.rs +index 834c6a19e..b1e0a23bb 100644 +--- a/vendor/object/src/write/elf/object.rs ++++ b/vendor/object/src/write/elf/object.rs +@@ -83,6 +83,7 @@ impl<'a> Object<'a> { Architecture::Riscv32 => true, Architecture::S390x => true, Architecture::Sparc64 => true, @@ -1479,7 +3277,7 @@ index 34e0abc85..3d208f2dd 100644 _ => { return Err(Error(format!( "unimplemented architecture {:?}", -@@ -371,6 +372,7 @@ impl Object { +@@ -279,6 +280,7 @@ impl<'a> Object<'a> { Architecture::Riscv64 => elf::EM_RISCV, Architecture::S390x => elf::EM_S390, Architecture::Sparc64 => elf::EM_SPARCV9, @@ -1487,7 +3285,7 @@ index 34e0abc85..3d208f2dd 100644 _ => { return Err(Error(format!( "unimplemented architecture {:?}", -@@ -807,6 +809,14 @@ impl Object { +@@ -517,6 +519,14 @@ impl<'a> Object<'a> { return Err(Error(format!("unimplemented relocation {:?}", reloc))); } }, @@ -1499,21 +3297,21 @@ index 34e0abc85..3d208f2dd 100644 + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + }, - _ => { - if let RelocationKind::Elf(x) = reloc.kind { - x + Architecture::Mips | Architecture::Mips64 => { + match (reloc.kind, reloc.encoding, reloc.size) { + (RelocationKind::Absolute, _, 16) => elf::R_MIPS_16, diff --git a/vendor/object/tests/round_trip/mod.rs b/vendor/object/tests/round_trip/mod.rs -index 37050689f..a63722e01 100644 +index e83b2c229..120092ee9 100644 --- a/vendor/object/tests/round_trip/mod.rs +++ b/vendor/object/tests/round_trip/mod.rs -@@ -245,6 +245,7 @@ fn elf_any() { - (Architecture::Riscv64, Endianness::Little), - (Architecture::S390x, Endianness::Big), - (Architecture::Sparc64, Endianness::Big), +@@ -238,6 +238,7 @@ fn elf_any() { + (Architecture::X86_64, Endianness::Little), + (Architecture::X86_64_X32, Endianness::Little), + (Architecture::Hexagon, Endianness::Little), + (Architecture::LoongArch64, Endianness::Little), - ] - .iter() - .copied() + (Architecture::Mips, Endianness::Little), + (Architecture::Mips64, Endianness::Little), + (Architecture::Msp430, Endianness::Little), diff --git a/vendor/psm/build.rs b/vendor/psm/build.rs index 01a13bf71..da351b21f 100644 --- a/vendor/psm/build.rs diff --git a/0003-Rename-loongarch64_unknown_linux_gnuf64-to-loongarch.patch b/0003-Rename-loongarch64_unknown_linux_gnuf64-to-loongarch.patch deleted file mode 100644 index c86424c..0000000 --- a/0003-Rename-loongarch64_unknown_linux_gnuf64-to-loongarch.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 44edf0be5bfd41e4f1250b81cec674a680c44a7c Mon Sep 17 00:00:00 2001 -From: yangxiaojuan -Date: Wed, 8 Feb 2023 10:40:13 +0800 -Subject: [PATCH] Rename loongarch64_unknown_linux_gnuf64 to - loongarch64_unknown_linux_gnu - ---- - ...known_linux_gnuf64.rs => loongarch64_unknown_linux_gnu.rs} | 2 +- - compiler/rustc_target/src/spec/mod.rs | 2 +- - src/doc/rustc/src/platform-support.md | 2 +- - src/test/assembly/asm/loongarch-types.rs | 2 +- - src/test/run-make-fulldeps/atomic-lock-free/Makefile | 2 +- - src/tools/build-manifest/src/main.rs | 4 ++-- - vendor/cc-1.0.69/src/lib.rs | 2 +- - 7 files changed, 8 insertions(+), 8 deletions(-) - rename compiler/rustc_target/src/spec/{loongarch64_unknown_linux_gnuf64.rs => loongarch64_unknown_linux_gnu.rs} (89%) - -diff --git a/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnuf64.rs b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs -similarity index 89% -rename from compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnuf64.rs -rename to compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs -index 83114e3e5..1c3e99435 100644 ---- a/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnuf64.rs -+++ b/compiler/rustc_target/src/spec/loongarch64_unknown_linux_gnu.rs -@@ -2,7 +2,7 @@ use crate::spec::{CodeModel, Target, TargetOptions}; - - pub fn target() -> Target { - Target { -- llvm_target: "loongarch64-unknown-linux-gnuf64".into(), -+ llvm_target: "loongarch64-unknown-linux-gnu".into(), - pointer_width: 64, - data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(), - arch: "loongarch64".into(), -diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index 772cc4274..0b6125ac4 100644 ---- a/compiler/rustc_target/src/spec/mod.rs -+++ b/compiler/rustc_target/src/spec/mod.rs -@@ -790,7 +790,7 @@ supported_targets! { - ("mips64-unknown-linux-muslabi64", mips64_unknown_linux_muslabi64), - ("mips64el-unknown-linux-muslabi64", mips64el_unknown_linux_muslabi64), - ("hexagon-unknown-linux-musl", hexagon_unknown_linux_musl), -- ("loongarch64-unknown-linux-gnuf64", loongarch64_unknown_linux_gnuf64), -+ ("loongarch64-unknown-linux-gnu", loongarch64_unknown_linux_gnu), - - ("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc), - ("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc), -diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md -index 3cb8ecaed..b91696268 100644 ---- a/src/doc/rustc/src/platform-support.md -+++ b/src/doc/rustc/src/platform-support.md -@@ -83,7 +83,7 @@ target | notes - `arm-unknown-linux-gnueabi` | ARMv6 Linux (kernel 3.2, glibc 2.17) - `arm-unknown-linux-gnueabihf` | ARMv6 Linux, hardfloat (kernel 3.2, glibc 2.17) - `armv7-unknown-linux-gnueabihf` | ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) --`loongarch64-unknown-linux-gnuf64` | LOONGARCH64 Linux (kernel 4.19, glibc 2.28) -+`loongarch64-unknown-linux-gnu` | LOONGARCH64 Linux (kernel 4.19, glibc 2.28) - `mips-unknown-linux-gnu` | MIPS Linux (kernel 4.4, glibc 2.23) - `mips64-unknown-linux-gnuabi64` | MIPS64 Linux, n64 ABI (kernel 4.4, glibc 2.23) - `mips64el-unknown-linux-gnuabi64` | MIPS64 (LE) Linux, n64 ABI (kernel 4.4, glibc 2.23) -diff --git a/src/test/assembly/asm/loongarch-types.rs b/src/test/assembly/asm/loongarch-types.rs -index 34973b942..d6677c5fd 100644 ---- a/src/test/assembly/asm/loongarch-types.rs -+++ b/src/test/assembly/asm/loongarch-types.rs -@@ -1,6 +1,6 @@ - // min-llvm-version: 10.0.1 - // assembly-output: emit-asm --// compile-flags: --target loongarch64-unknown-linux-gnuf64 -+// compile-flags: --target loongarch64-unknown-linux-gnu - // needs-llvm-components: loongarch - - #![feature(no_core, lang_items, rustc_attrs)] -diff --git a/src/test/run-make-fulldeps/atomic-lock-free/Makefile b/src/test/run-make-fulldeps/atomic-lock-free/Makefile -index 7091371c1..8e9b46ef4 100644 ---- a/src/test/run-make-fulldeps/atomic-lock-free/Makefile -+++ b/src/test/run-make-fulldeps/atomic-lock-free/Makefile -@@ -26,7 +26,7 @@ ifeq ($(filter aarch64,$(LLVM_COMPONENTS)),aarch64) - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - endif - ifeq ($(filter loongarch64,$(LLVM_COMPONENTS)),loongarch64) -- $(RUSTC) --target=loongarch64-unknown-linux-gnuf64 atomic_lock_free.rs -+ $(RUSTC) --target=loongarch64-unknown-linux-gnu atomic_lock_free.rs - nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add - endif - ifeq ($(filter mips,$(LLVM_COMPONENTS)),mips) -diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs -index f90311c58..c56dde8a0 100644 ---- a/src/tools/build-manifest/src/main.rs -+++ b/src/tools/build-manifest/src/main.rs -@@ -28,7 +28,7 @@ static HOSTS: &[&str] = &[ - "i686-pc-windows-gnu", - "i686-pc-windows-msvc", - "i686-unknown-linux-gnu", -- "loongarch64-unknown-linux-gnuf64", -+ "loongarch64-unknown-linux-gnu", - "mips-unknown-linux-gnu", - "mips64-unknown-linux-gnuabi64", - "mips64el-unknown-linux-gnuabi64", -@@ -100,7 +100,7 @@ static TARGETS: &[&str] = &[ - "i686-unknown-freebsd", - "i686-unknown-linux-gnu", - "i686-unknown-linux-musl", -- "loongarch64-unknown-linux-gnuf64", -+ "loongarch64-unknown-linux-gnu", - "m68k-unknown-linux-gnu", - "mips-unknown-linux-gnu", - "mips-unknown-linux-musl", -diff --git a/vendor/cc-1.0.69/src/lib.rs b/vendor/cc-1.0.69/src/lib.rs -index aebf234cd..7957112a9 100644 ---- a/vendor/cc-1.0.69/src/lib.rs -+++ b/vendor/cc-1.0.69/src/lib.rs -@@ -2408,7 +2408,7 @@ impl Build { - "i686-uwp-windows-gnu" => Some("i686-w64-mingw32"), - "i686-unknown-linux-musl" => Some("musl"), - "i686-unknown-netbsd" => Some("i486--netbsdelf"), -- "loongarch64-unknown-linux-gnuf64" => Some("loongarch64-linux-gnuf64"), -+ "loongarch64-unknown-linux-gnu" => Some("loongarch64-linux-gnu"), - "mips-unknown-linux-gnu" => Some("mips-linux-gnu"), - "mips-unknown-linux-musl" => Some("mips-linux-musl"), - "mipsel-unknown-linux-gnu" => Some("mipsel-linux-gnu"), --- -2.33.0 - diff --git a/rust.spec b/rust.spec index beb5574..f71e5b7 100644 --- a/rust.spec +++ b/rust.spec @@ -11,7 +11,7 @@ %bcond_without lldb Name: rust Version: 1.60.0 -Release: 1 +Release: 2 Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) URL: https://www.rust-lang.org @@ -27,9 +27,8 @@ Patch0001: rustc-1.60.0-disable-http2.patch Patch0002: clippy-driver-usage-should-user-friendly.patch Patch0003: cargo-help-clippy-should-have-description-to-user.patch Patch0004: fix-a-println-wrong-format.patch -Patch0006: 0001-Add-loongarch64-support-for-rust-1.57.patch -Patch0007: 0002-vendor-Add-loongarch64-support.patch -Patch0008: 0003-Rename-loongarch64_unknown_linux_gnuf64-to-loongarch.patch +Patch0006: 0001-Add-base-loongarch64-support-for-rust-1.60.0.patch +Patch0007: 0002-vendor-Add-loongarch64-support-for-rust-1.60.0.patch %{lua: function rust_triple(arch) local abi = "gnu" if arch == "armv7hl" then @@ -262,7 +261,6 @@ sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure %ifarch loongarch64 %patch0006 -p1 %patch0007 -p1 -%patch0008 -p1 %endif rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ @@ -490,6 +488,9 @@ export %{rust_env} %{_mandir}/man1/cargo*.1* %changelog +* Tue Apr 11 2023 yangxiaojuan - 1.60.0-2 +- Add loongarch64 support + * Tue Apr 04 2023 wangkai - 1.60.0-1 - Update to 1.60.0 -- Gitee