# `s390x-unknown-none-softfloat`

**Tier: 2**

IBM z/Architecture (s390x) code in ELF format for kernels, etc.

## Target maintainers

[@uweigand](https://github.com/uweigand)
[@cuviper](https://github.com/cuviper)

## Requirements

This target is intended for kernel development on s390x only. This target is
cross-compiled. There is no support for `std`.There is no default allocator,
but it's possible to use `alloc` by supplying an allocator.

The target does not assume existence of a FPU and does not make use of any
non-GPR register. This allows the generated code to run in environments, such
as kernels, which may need to avoid the use of such registers or which may have
special considerations about the use of such registers (e.g. saving and
restoring them to avoid breaking userspace code using the same registers). You
can change code generation to use additional CPU features via the
`-C target-feature=` codegen options to rustc, or via the `#[target_feature]`
mechanism within Rust code.

By default, code generated with the soft-float target should run on any Z System
starting at [Z10][s390x-isa]. Enabling additional target features or changing the
`-Ctarget-cpu` may raise the ISA required from the `z10` baseline.

`extern "C"` does not use a stable ABI and is subject to change between compiler
or codegen backend versions.

The target only generates object files in the ELF format. Any alternate formats
or special considerations for binary layout will require linker options or linker
scripts.

* [z/Architecture Principles of Operation][s390x-isa]

[s390x-isa]: https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf
[s390x-abi]: https://github.com/IBM/s390x-abi

## Building the target

You can build Rust with support for the target by adding it to the `target`
list in `bootstrap.toml`:

```toml
[build]
target = ["s390x-unknown-none-softfloat"]
```

## Building Rust programs

This target is not intended to build stand-alone binaries. You should only use
it in conjunction with the kernel build toolchain.

## Testing

As code generated by this target is intended to always be part of the kernel,
there are no additional requirements for testing.

If you want to do native testing but do not have your own s390x
machine, there are several options how to get access to one:

* The [IBM LinuxONE Community Cloud][cloud-community] provides a
  self-service portal where you can create s390x virtual machine
  instances.  These are intended for temporary use (limited to 120 days).

* The [IBM LinuxONE Open Source Cloud][cloud-opensource] provides
  permanent access to s390x machines.  This requires approval by IBM,
  which will normally be granted if you're planning to use the machine
  to work on an open-source project that is relevant to the IBM Z
  ecosystem - the Rust compiler would certainly qualify.

[cloud-community]: https://linuxone.cloud.marist.edu/
[cloud-opensource]: https://community.ibm.com/zsystems/form/l1cc-oss-vm-request/
