rust-mega-drive icon indicating copy to clipboard operation
rust-mega-drive copied to clipboard

32-bit+ arithmetic instructions produce undefined external errors

Open ricky26 opened this issue 4 years ago • 1 comments

Example output:

warning: 2 warnings emitted

    Finished release [optimized] target(s) in 1.23s
ld.lld: error: undefined symbol: __mulsi3
>>> referenced by megatowerdefense.6uq4eb4f-cgu.7
>>>               megatowerdefense-0046ae851cb5cf2f.megatowerdefense.6uq4eb4f-cgu.7.rcgu.o:(main) in archive /rust-mega-drive/target/m68k-none-eabi/release/libmegatowerdefense.a
>>> referenced by compiler_builtins.7qw4kudv-cgu.1
>>>               compiler_builtins-800f79487148fff1.compiler_builtins.7qw4kudv-cgu.1.rcgu.o:(_$LT$u32$u20$as$u20$compiler_builtins..int..Int$GT$::wrapping_mul::h8b3963512e7a373d) in archive /rust-mega-drive/target/m68k-none-eabi/release/libmegatowerdefense.a
>>> referenced by compiler_builtins.7qw4kudv-cgu.1
>>>               compiler_builtins-800f79487148fff1.compiler_builtins.7qw4kudv-cgu.1.rcgu.o:(_$LT$u16$u20$as$u20$compiler_builtins..int..HInt$GT$::zero_widen_mul::h727d78071ecd5889) in archive /rust-mega-drive/target/m68k-none-eabi/release/libmegatowerdefense.a
>>> did you mean: __muldi3
>>> defined in: /rust-mega-drive/target/m68k-none-eabi/release/libmegatowerdefense.a(compiler_builtins-800f79487148fff1.compiler_builtins.7qw4kudv-cgu.12.rcgu.o)

This is almost certainly due to compiler-builtins expecting 32-bit as a minimum standard and not having implementations for these functions. :cry:

ricky26 avatar May 27 '21 22:05 ricky26

Rust officially targets 16-bit platforms such as the MSP430. This is probably worth opening an issue over.

Serentty avatar Jun 26 '21 00:06 Serentty