Live data from Hacker News

Unofficial "Tier 4" Rust Target for older Windows versions

github.com

91–97 of 97 posts

Re: Unofficial "Tier 4" Rust Target for older Windows versions

#91

Earlier quoted context omitted.

Just in case you aren't in the loop, but there are gcc and llvm based Amiga cross compilers.

Actually I wasn't able to do it also with Bebbo's GCC fork. Never used Nim before so I might be doing something wrong though. I wish retro Amiga had Rust support. I've briefly skimmed what would be necessary to do, based on the rust-mos (Rust for commodore-64 fork), but I'm too weak in LLVM internals to actually do it.

Rust --> WASM --> Wasm2C --> Bob's your uncle. Maybe.

Re: Unofficial "Tier 4" Rust Target for older Windows versions

#92

Earlier quoted context omitted.

Just in case you aren't in the loop, but there are gcc and llvm based Amiga cross compilers.

GCC cross-compiling for the Amiga is available from https://franke.ms/git/bebbo/amiga-gcc for a standalone toolchain, and https://github.com/BartmanAbyss/vscode-amiga-debug for one that requires VSCode. I'm not aware of any working LLVM solution? All I know is that LLVM supports MC680x0 as a backend, can spit out 68k-but-non-amiga-objects and some brave souls have trying to use vlink or mold to produce Amiga executab…

I probably just confused m68k support with HUNK support. Maybe one could use https://github.com/BinaryMelodies/RetroLinker

Re: Unofficial "Tier 4" Rust Target for older Windows versions

#93
post #82
post #76

Earlier quoted context omitted.

Big assumption there... chances are they would rather keep the money or spend it elsewhere, instead of "unnecessarily" upgrading when things still work

Win10 has got to cost less than a single ransomware attack.

Win10 is a real expensive cost now, randsomeware is a hypothetical attack in the future.

Re: Unofficial "Tier 4" Rust Target for older Windows versions

#94

Earlier quoted context omitted.

Just in case you aren't in the loop, but there are gcc and llvm based Amiga cross compilers.

Actually I wasn't able to do it also with Bebbo's GCC fork. Never used Nim before so I might be doing something wrong though. I wish retro Amiga had Rust support. I've briefly skimmed what would be necessary to do, based on the rust-mos (Rust for commodore-64 fork), but I'm too weak in LLVM internals to actually do it.

> Never used Nim before so I might be doing something wrong though.

With Nim on weird targets you usually want:

- OS target = any

- Memory Management = ARC

- malloc instead of default Nim allocator

- turn off signal handler (if not POSIX)

- disable threads (most of the time)

Then look at how C is compiled and copy all compiler+linker flags to your Nim configuration. Here's an absolute minimal `config.nims` I used to compile Nim for C64 with LLVM-MOS[1] toolchain:

    import std/strutils
    
    --cc:clang
    --clang.exe:"mos-c64-clang"
    
    --os:any
    --cpu:avr
    --mm:arc
    
    --threads:off
    --define:usemalloc
    --define:noSignalHandler
    
    let args = [
      "-isystem $PWD/../mos-platform/c64/include",
      "-I$PWD/../mos-platform/c64/asminc",
      "-L$PWD/../mos-platform/c64/lib",
      "-mlto-zp=110",
      "-D__C64__",
    
      "-isystem $PWD/../mos-platform/commodore/include",
      "-I$PWD/../mos-platform/commodore/asminc",
      "-L$PWD/../mos-platform/commodore/lib",
      "-D__CBM__",
    
      "-isystem $PWD/../mos-platform/common/include",
      "-I$PWD/../mos-platform/common/asminc",
      "-L$PWD/../mos-platform/common/lib",
      "--target=mos",
      "-flto",
      "-Os",
      ].join(" ")
    
    switch("passC", args)
    switch("passL", args)
Nim side was easy, because I have already compiled Nim to WASM at that point and the flags are similar. Hard part was figuring out the C compiler flags: e.g. cmake structure and why compiler complains about missing symbols, when they're not missing (answer: include/lib order is very important).

[1] https://github.com/llvm-mos/llvm-mos

Re: Unofficial "Tier 4" Rust Target for older Windows versions

#95
post #90
post #79

Earlier quoted context omitted.

And? There are barely any API differences between 7 and 10.

Ok, and? API being the same is kinda the Windows selling point. That said, there are API differences - DirectX12, Bitlocker, etc.

The language runtime maintainers specifically change parts that already work fine to use newer APIs that do the same thing. IIRC, the Go runtime changed which win32 function they call to generate random numbers. It would've been free for them to just not touch it.

Re: Unofficial "Tier 4" Rust Target for older Windows versions

#97

Earlier quoted context omitted.

GCC cross-compiling for the Amiga is available from https://franke.ms/git/bebbo/amiga-gcc for a standalone toolchain, and https://github.com/BartmanAbyss/vscode-amiga-debug for one that requires VSCode. I'm not aware of any working LLVM solution? All I know is that LLVM supports MC680x0 as a backend, can spit out 68k-but-non-amiga-objects and some brave souls have trying to use vlink or mold to produce Amiga executab…

I probably just confused m68k support with HUNK support. Maybe one could use https://github.com/BinaryMelodies/RetroLinker

Or https://franke.ms/git/bebbo/elf2hunk/master/elf2hunk.c
Post reply on HN