1 year ago

#150672

test-img

Fabio Dalla Libera

What is the correct way to enable soft floating point computation for 68000 with gcc and newlib?

I am using crosstool-ng to crosscompile for 68000 (version:crosstool-ng-1.24.0-rc2, host OS:Ubuntu 20.04)

My target is a 68000 (plain, not a 68020 or a cpu with floating point support).

I am compiling using a test program which multiplies two floats, using

-m68000 -mcpu=68000 -msoft-float -Wall -fno-builtin -O2

However, when I execute it, I get illegal instruction error (notice, this happens only if I use floats)

Suspecting newlib is targeting 68020, I tried adding

CT_LIBC_NEWLIB_TARGET_CFLAGS="-m68000 -msoft-float"

but that made no difference. What am I doing wrong? Do I need some code in the illegal instruction handler?

gcc

68000

newlib

0 Answers

Your Answer

Accepted video resources