Compiling rust program for AIX

Hello all.

I want to compile simple "hello world"

use std::process::ExitCode;

fn main() -> ExitCode {
    println!("Hello, world!");
    return ExitCode::SUCCESS; }

for AIX.


1) I try to cross compile it on my Fedora Linux:

> rustc --print target-list | grep -i aix
powerpc64-ibm-aix
> rustup target list | grep -i aix
# nothing

But then:

> rustup target add powerpc64-ibm-aix
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not support target 'powerpc64-ibm-aix'
note: you can see a list of supported targets with `rustc --print=target-list`
note: if you are adding support for a new target to rustc itself, see https://rustc-dev-guide.rust-lang.org/building/new-target.html

2) I try install Rust on AIX.

> oslevel
7.2.0.0
> curl -k --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs  | sh
rustup: need 'mktemp' (command not found)

3) So I try to download rustup-init directly from https://forge.rust-lang.org/infra/other-installation-methods.html#other-ways-to-install-rustup but no powerpc64-ibm-aix link there.


Please help, assist, comment - or perhaps say it is not doable.

Cross compiling to AIX on Linux would require a bunch of AIX cross-tools and libraries installed on the Linux system. Your best bet is native Rust build on AIX.

According to message #20 on this thread on IBM's power forums there's an early access "Rust 1.84 for AIX community edition" available here (which I can not verify, as I do not have a login).

Thank You :slight_smile:
I have just successfully compiled and runned above simple "Hello, world!" rust program on AIX 7.3 and 7.2.

1 Like