commit
1cd1f6357f
@ -0,0 +1,79 @@
|
||||
From 939406285b517ea2e61a62040a85c2676e786476 Mon Sep 17 00:00:00 2001
|
||||
From: Fabio Valentini <decathorpe@gmail.com>
|
||||
Date: Tue, 4 Apr 2023 15:56:58 +0200
|
||||
Subject: [PATCH] Unconditionally compile C / Assembly code from source
|
||||
|
||||
---
|
||||
build.rs | 51 ++-------------------------------------------------
|
||||
1 file changed, 2 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/build.rs b/build.rs
|
||||
index 1ccf0cc..ce34090 100644
|
||||
--- a/build.rs
|
||||
+++ b/build.rs
|
||||
@@ -1,4 +1,3 @@
|
||||
-#[cfg(feature = "cc")]
|
||||
use cc::Build;
|
||||
use std::env::var;
|
||||
use std::io::Write;
|
||||
@@ -156,55 +155,9 @@ fn main() {
|
||||
/// outline assembly code for making syscalls.
|
||||
fn link_in_librustix_outline(arch: &str, asm_name: &str) {
|
||||
let name = format!("rustix_outline_{}", arch);
|
||||
- let profile = var("PROFILE").unwrap();
|
||||
- let to = format!("{}/{}/lib{}.a", OUTLINE_PATH, profile, name);
|
||||
- println!("cargo:rerun-if-changed={}", to);
|
||||
|
||||
- // If "cc" is not enabled, use a pre-built library.
|
||||
- #[cfg(not(feature = "cc"))]
|
||||
- {
|
||||
- let _ = asm_name;
|
||||
- println!("cargo:rustc-link-search={}/{}", OUTLINE_PATH, profile);
|
||||
- println!("cargo:rustc-link-lib=static={}", name);
|
||||
- }
|
||||
-
|
||||
- // If "cc" is enabled, build the library from source, update the pre-built
|
||||
- // version, and assert that the pre-built version is checked in.
|
||||
- #[cfg(feature = "cc")]
|
||||
- {
|
||||
- let out_dir = var("OUT_DIR").unwrap();
|
||||
- // Add `-gdwarf-3` so that we always get the same output, regardless of
|
||||
- // the Rust version we're using. DWARF3 is the version used in
|
||||
- // Rust 1.48 and is entirely adequate for our simple needs here.
|
||||
- let mut build = Build::new();
|
||||
- if profile == "debug" {
|
||||
- build.flag("-gdwarf-3");
|
||||
- }
|
||||
- build.file(&asm_name);
|
||||
- build.compile(&name);
|
||||
- println!("cargo:rerun-if-changed={}", asm_name);
|
||||
- if std::fs::metadata(".git").is_ok() {
|
||||
- let from = format!("{}/lib{}.a", out_dir, name);
|
||||
- let prev_metadata = std::fs::metadata(&to);
|
||||
- std::fs::copy(&from, &to).unwrap();
|
||||
- assert!(
|
||||
- prev_metadata.is_ok(),
|
||||
- "{} didn't previously exist; please inspect the new file and `git add` it",
|
||||
- to
|
||||
- );
|
||||
- assert!(
|
||||
- std::process::Command::new("git")
|
||||
- .arg("diff")
|
||||
- .arg("--quiet")
|
||||
- .arg(&to)
|
||||
- .status()
|
||||
- .unwrap()
|
||||
- .success(),
|
||||
- "{} changed; please inspect the change and `git commit` it",
|
||||
- to
|
||||
- );
|
||||
- }
|
||||
- }
|
||||
+ let out_dir = var("OUT_DIR").unwrap();
|
||||
+ Build::new().file(&asm_name).compile(&name);
|
||||
}
|
||||
|
||||
fn use_thumb_mode() -> bool {
|
||||
--
|
||||
2.40.0
|
||||
|
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
--- rustix-0.37.26/Cargo.toml 1970-01-01T00:00:01+00:00
|
||||
+++ rustix-0.37.26/Cargo.toml 2023-10-19T14:21:38.952269+00:00
|
||||
@@ -230,19 +230,3 @@
|
||||
version = "1.5.2"
|
||||
optional = true
|
||||
|
||||
-[target."cfg(windows)".dependencies.libc_errno]
|
||||
-version = "0.3.1"
|
||||
-default-features = false
|
||||
-package = "errno"
|
||||
-
|
||||
-[target."cfg(windows)".dependencies.windows-sys]
|
||||
-version = "0.48.0"
|
||||
-features = [
|
||||
- "Win32_Foundation",
|
||||
- "Win32_Networking_WinSock",
|
||||
- "Win32_NetworkManagement_IpHelper",
|
||||
- "Win32_System_Threading",
|
||||
-]
|
||||
-
|
||||
-[target."cfg(windows)".dev-dependencies.ctor]
|
||||
-version = "0.2.0"
|
@ -0,0 +1,55 @@
|
||||
--- rustix-0.37.26/Cargo.toml 1970-01-01T00:00:01+00:00
|
||||
+++ rustix-0.37.26/Cargo.toml 2023-10-19T14:22:38.958553+00:00
|
||||
@@ -68,22 +68,8 @@
|
||||
"wasm32-wasi",
|
||||
]
|
||||
|
||||
-[dependencies.alloc]
|
||||
-version = "1.0.0"
|
||||
-optional = true
|
||||
-package = "rustc-std-workspace-alloc"
|
||||
-
|
||||
[dependencies.bitflags]
|
||||
version = "1.3.2"
|
||||
-
|
||||
-[dependencies.compiler_builtins]
|
||||
-version = "0.1.49"
|
||||
-optional = true
|
||||
-
|
||||
-[dependencies.core]
|
||||
-version = "1.0.0"
|
||||
-optional = true
|
||||
-package = "rustc-std-workspace-core"
|
||||
|
||||
[dependencies.io-lifetimes]
|
||||
version = "1.0.10"
|
||||
@@ -120,7 +106,6 @@
|
||||
|
||||
[build-dependencies.cc]
|
||||
version = "1.0.68"
|
||||
-optional = true
|
||||
|
||||
[features]
|
||||
all-apis = [
|
||||
@@ -142,6 +127,7 @@
|
||||
"os_pipe",
|
||||
"fs-err",
|
||||
]
|
||||
+cc = []
|
||||
default = [
|
||||
"std",
|
||||
"use-libc-auxv",
|
||||
@@ -170,13 +156,6 @@
|
||||
]
|
||||
rand = []
|
||||
runtime = []
|
||||
-rustc-dep-of-std = [
|
||||
- "core",
|
||||
- "alloc",
|
||||
- "compiler_builtins",
|
||||
- "linux-raw-sys/rustc-dep-of-std",
|
||||
- "bitflags/rustc-dep-of-std",
|
||||
-]
|
||||
std = ["io-lifetimes"]
|
||||
termios = []
|
||||
thread = []
|
@ -0,0 +1,439 @@
|
||||
## START: Set by rpmautospec
|
||||
## (rpmautospec version 0.3.5)
|
||||
## RPMAUTOSPEC: autorelease, autochangelog
|
||||
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
||||
release_number = 1;
|
||||
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
||||
print(release_number + base_release_number - 1);
|
||||
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
||||
## END: Set by rpmautospec
|
||||
|
||||
# Generated by rust2rpm 25
|
||||
%bcond_without check
|
||||
%global debug_package %{nil}
|
||||
|
||||
%global crate rustix
|
||||
|
||||
Name: rust-rustix0.37
|
||||
Version: 0.37.26
|
||||
Release: %autorelease
|
||||
Summary: Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls
|
||||
|
||||
License: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
|
||||
URL: https://crates.io/crates/rustix
|
||||
Source: %{crates_source}
|
||||
# Automatically generated patch to strip dependencies and normalize metadata
|
||||
Patch: rustix-fix-metadata-auto.diff
|
||||
# Manually created patch for downstream crate metadata changes
|
||||
# * drop dependencies on compiler internals
|
||||
# * make cc build-dependency non-optional
|
||||
Patch: rustix-fix-metadata.diff
|
||||
# * unconditionally rebuild static objects from Assembly
|
||||
Patch: 0001-Unconditionally-compile-C-Assembly-code-from-source.patch
|
||||
|
||||
BuildRequires: cargo-rpm-macros >= 24
|
||||
|
||||
%global _description %{expand:
|
||||
Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls.}
|
||||
|
||||
%description %{_description}
|
||||
|
||||
%package devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "%{crate}" crate.
|
||||
|
||||
%files devel
|
||||
%license %{crate_instdir}/COPYRIGHT
|
||||
%license %{crate_instdir}/LICENSE-APACHE
|
||||
%license %{crate_instdir}/LICENSE-Apache-2.0_WITH_LLVM-exception
|
||||
%license %{crate_instdir}/LICENSE-MIT
|
||||
%doc %{crate_instdir}/CODE_OF_CONDUCT.md
|
||||
%doc %{crate_instdir}/CONTRIBUTING.md
|
||||
%doc %{crate_instdir}/ORG_CODE_OF_CONDUCT.md
|
||||
%doc %{crate_instdir}/README.md
|
||||
%doc %{crate_instdir}/SECURITY.md
|
||||
%{crate_instdir}/
|
||||
|
||||
%package -n %{name}+default-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+default-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "default" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+default-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+all-apis-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+all-apis-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "all-apis" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+all-apis-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+all-impls-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+all-impls-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "all-impls" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+all-impls-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+cc-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+cc-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "cc" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+cc-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+fs-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+fs-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "fs" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+fs-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+fs-err-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+fs-err-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "fs-err" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+fs-err-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+io-lifetimes-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+io-lifetimes-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "io-lifetimes" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+io-lifetimes-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+io_uring-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+io_uring-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "io_uring" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+io_uring-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+itoa-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+itoa-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "itoa" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+itoa-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+libc-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+libc-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "libc" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+libc-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+libc_errno-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+libc_errno-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "libc_errno" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+libc_errno-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+linux_4_11-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+linux_4_11-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "linux_4_11" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+linux_4_11-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+linux_latest-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+linux_latest-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "linux_latest" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+linux_latest-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+mm-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+mm-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "mm" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+mm-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+net-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+net-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "net" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+net-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+once_cell-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+once_cell-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "once_cell" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+once_cell-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+os_pipe-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+os_pipe-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "os_pipe" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+os_pipe-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+param-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+param-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "param" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+param-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+process-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+process-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "process" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+process-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+procfs-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+procfs-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "procfs" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+procfs-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+pty-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+pty-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "pty" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+pty-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+rand-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+rand-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "rand" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+rand-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+runtime-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+runtime-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "runtime" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+runtime-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+std-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+std-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "std" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+std-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+termios-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+termios-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "termios" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+termios-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+thread-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+thread-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "thread" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+thread-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+time-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+time-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "time" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+time-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+use-libc-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+use-libc-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "use-libc" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+use-libc-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%package -n %{name}+use-libc-auxv-devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{name}+use-libc-auxv-devel %{_description}
|
||||
|
||||
This package contains library source intended for building other packages which
|
||||
use the "use-libc-auxv" feature of the "%{crate}" crate.
|
||||
|
||||
%files -n %{name}+use-libc-auxv-devel
|
||||
%ghost %{crate_instdir}/Cargo.toml
|
||||
|
||||
%prep
|
||||
%autosetup -n %{crate}-%{version} -p1
|
||||
%cargo_prep
|
||||
# Remove pre-built binaries
|
||||
rm -r src/backend/linux_raw/arch/outline/debug/
|
||||
rm -r src/backend/linux_raw/arch/outline/release/
|
||||
|
||||
%generate_buildrequires
|
||||
%cargo_generate_buildrequires
|
||||
|
||||
%build
|
||||
%cargo_build
|
||||
|
||||
%install
|
||||
%cargo_install
|
||||
|
||||
%if %{with check}
|
||||
%check
|
||||
%cargo_test
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Jan 15 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.37.26-1
|
||||
- Rebuilt for MSVSphere 9.3
|
||||
|
||||
* Thu Oct 19 2023 Fabio Valentini <decathorpe@gmail.com> - 0.37.26-1
|
||||
- Update to version 0.37.26
|
||||
|
||||
* Sun Sep 17 2023 Fabio Valentini <decathorpe@gmail.com> - 0.37.23-1
|
||||
- Initial import (rustix 0.37 compat package)
|
Loading…
Reference in new issue