maint: upgrade to rustc 1.85.0-nightly, use softfloat abi

This commit is contained in:
Mark Poliakov 2024-12-16 20:15:06 +02:00
parent bc1c8c41f5
commit ac2394a2c3
18 changed files with 51 additions and 50 deletions

View File

@ -1,7 +1,7 @@
{
"is-builtin": false,
"arch": "aarch64",
"os": "none",
"abi": "softfloat",
"llvm-target": "aarch64-unknown-none",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"max-atomic-width": 128,

View File

@ -1,20 +0,0 @@
{
"is-builtin": false,
"arch": "aarch64",
"os": "none",
"llvm-target": "aarch64-unknown-none",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"max-atomic-width": 128,
"target-pointer-width": "64",
"features": "+v8a,+strict-align,-neon,-fp-armv8",
"disable-redzone": true,
"executables": true,
"panic-strategy": "abort",
"dynamic-linking": true,
"relocation-model": "pic",
"eh-frame-header": false,
"linker": "rust-lld",
"linker-flavor": "ld.lld"
}

View File

@ -1,8 +1,8 @@
{
"is-builtin": false,
"arch": "x86",
"cpu": "pentium4",
"os": "none",
"abi": "softfloat",
"llvm-target": "i686-unknown-linux-gnu",
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
"max-atomic-width": 64,

View File

@ -1,8 +1,8 @@
{
"is-builtin": false,
"arch": "x86_64",
"cpu": "x86-64",
"os": "none",
"abi": "softfloat",
"llvm-target": "x86_64-unknown-linux-gnu",
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
"max-atomic-width": 64,

View File

@ -2,11 +2,7 @@
#![no_std]
#![deny(missing_docs)]
#![allow(clippy::new_without_default, clippy::new_ret_no_self)]
#![feature(
maybe_uninit_uninit_array,
const_maybe_uninit_uninit_array,
maybe_uninit_array_assume_init
)]
#![feature(maybe_uninit_uninit_array, maybe_uninit_array_assume_init)]
use core::{cell::RefCell, marker::PhantomData};

View File

@ -156,7 +156,7 @@ impl From<PhysicalAddress> for usize {
// Ranges
impl Step for PhysicalAddress {
fn steps_between(_start: &Self, _end: &Self) -> Option<usize> {
fn steps_between(_start: &Self, _end: &Self) -> (usize, Option<usize>) {
todo!()
}

View File

@ -2,12 +2,10 @@
#![feature(
linked_list_cursors,
async_fn_traits,
async_closure,
maybe_uninit_slice,
allocator_api,
let_chains,
const_trait_impl,
build_hasher_default_const_new
const_trait_impl
)]
#![allow(clippy::new_without_default)]

View File

@ -3,7 +3,6 @@
#![allow(clippy::new_without_default)]
#![feature(
async_fn_traits,
async_closure,
new_range_api,
associated_type_defaults,
maybe_uninit_slice,
@ -14,7 +13,6 @@
let_chains,
allocator_api,
maybe_uninit_uninit_array,
const_maybe_uninit_uninit_array,
trait_alias,
if_let_guard,
trait_upcasting,

View File

@ -19,7 +19,6 @@
iter_next_chunk,
exact_size_is_empty,
maybe_uninit_uninit_array,
const_maybe_uninit_uninit_array,
never_type,
format_args_nl
)]

View File

@ -159,9 +159,8 @@ macro_rules! bitflags_impl_default {
#[macro_export]
macro_rules! bitflags {
(
$(#[derive($($struct_derive:tt)+)])?
$(#[doc = $struct_doc:expr])?
$(#[default = $struct_default:tt])?
$(#[$struct_meta:meta])*
$vis:vis struct $name:ident: $repr:ty {
$(
$(#[doc = $field_doc:expr])?
@ -169,11 +168,9 @@ macro_rules! bitflags {
)+
}
) => {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
#[repr(transparent)]
$(#[derive($($struct_derive)+)])?
$(#[doc = $struct_doc])?
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
$(#[$struct_meta])*
$vis struct $name($repr);
impl $name {

View File

@ -100,6 +100,7 @@ pub struct UdpFrame {
}
bitflags! {
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
pub struct TcpFlags: u8 {
const FIN: bit 0;
const SYN: bit 1;

View File

@ -1,5 +1,4 @@
{
"is-builtin": false,
"arch": "aarch64",
"os": "none",
"llvm-target": "aarch64-unknown-none",
@ -15,6 +14,7 @@
"relocation-model": "pic",
"position-independent-executables": true,
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"has-thread-local": true,

View File

@ -1,5 +1,4 @@
{
"is-builtin": false,
"arch": "x86",
"cpu": "pentium4",
"os": "none",
@ -15,6 +14,7 @@
"relocation-model": "pic",
"position-independent-executables": true,
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"has-thread-local": true,

View File

@ -1,5 +1,4 @@
{
"is-builtin": false,
"arch": "x86_64",
"cpu": "x86-64",
"os": "none",
@ -16,6 +15,7 @@
"relocation-model": "pic",
"position-independent-executables": true,
"crt-static-allows-dylibs": true,
"crt-static-respected": true,
"has-thread-local": true,

View File

@ -166,10 +166,10 @@ fn build_ygglibc(env: &BuildEnv) -> Result<Ygglibc, Error> {
})
}
// TODO clone openlibm
fn build_openlibm(env: &BuildEnv, llvm: &Llvm) -> Result<Openlibm, Error> {
fn make(env: &BuildEnv, llvm: &Llvm, libm_path: &Path) -> Command {
let mut command = Command::new("make");
command.env("SYSROOT", &env.llvm_sysroot);
command.env("ARCH", env.arch.name());
command.env("OS", "yggdrasil");
@ -177,6 +177,13 @@ fn build_openlibm(env: &BuildEnv, llvm: &Llvm) -> Result<Openlibm, Error> {
command.env("USEGCC", "0");
command.env("USECLANG", "1");
command.env("CC", llvm.clang());
command.env(
"CFLAGS",
format!(
"-isystem {}",
env.llvm_sysroot.join("usr/include").display()
),
);
command.current_dir(&libm_path);
command
}

View File

@ -123,13 +123,28 @@ impl<'e> CargoBuilder<'e> {
}
let target_spec_arg = format!(
"--target={}/etc/{}.json",
"--target={}/etc/{}-unknown-none.json",
env.workspace_root.display(),
env.kernel_triple
env.arch.name()
);
let target_dir_arg = format!(
"--target-dir={}",
env.workspace_root
.join("target")
.join(env.kernel_triple)
.display()
);
let artifact_dir_arg =
format!("--artifact-dir={}", env.kernel_output_dir.display());
command.arg(target_spec_arg);
command.args(["-Z", "build-std=core,alloc,compiler_builtins"]);
command.arg(target_dir_arg);
command.arg(artifact_dir_arg);
command.args([
"-Z",
"build-std=core,alloc,compiler_builtins",
"-Zunstable-options",
]);
match env.board {
Board::virt | Board::default => command.arg("--features=aarch64_board_virt"),

View File

@ -49,6 +49,7 @@ fn configure<P: AsRef<Path>>(env: &BuildEnv, config_toml_path: P) -> Result<(),
target: vec![
env.host_triple.clone(),
"x86_64-unknown-yggdrasil".into(),
"i686-unknown-yggdrasil".into(),
"aarch64-unknown-yggdrasil".into(),
],
},

View File

@ -95,6 +95,7 @@ pub fn install_compiler_rt(env: &BuildEnv, llvm: &Llvm) -> Result<(), Error> {
if !env.verbose {
command.stdout(Stdio::null());
}
command.env("CROSS_TOOLCHAIN_PREFIX", &llvm.root);
command.current_dir(&build_dir);
command
.args(["--build", "."])
@ -170,6 +171,7 @@ pub fn install_llvm_cxx_runtime(env: &BuildEnv, llvm: &Llvm) -> Result<(), Error
if !env.verbose {
command.stdout(Stdio::null());
}
command.env("CROSS_TOOLCHAIN_PREFIX", &llvm.root);
command.current_dir(&build_dir);
command
.args(["--build", "."])
@ -196,6 +198,8 @@ pub fn install_llvm_compiler(env: &BuildEnv) -> Result<Llvm, Error> {
if !makefile.exists() {
log::info!("Configure LLVM");
let have_host_ccache = which::which("ccache").is_ok();
let mut command = Command::new("cmake");
command.current_dir(&build_dir);
command
@ -205,8 +209,13 @@ pub fn install_llvm_compiler(env: &BuildEnv) -> Result<Llvm, Error> {
.arg("-DBUILD_SHARED_LIBS=false")
.arg("-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt")
.arg("-DLLVM_USE_LINKER=lld")
.arg("-DLLVM_BUILD_TOOLS=false")
.arg("-DLLVM_CCACHE_BUILD=true")
.arg("-DLLVM_BUILD_TOOLS=false");
if have_host_ccache {
command.arg("-DLLVM_CCACHE_BUILD=true");
}
command
.arg("-DLLVM_TARGETS_TO_BUILD=X86;AArch64")
.arg(&format!("-DCMAKE_INSTALL_PREFIX={}", root.display()))
.arg("-GNinja")