[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Mixing binary code for different machine... is it ok?



m0n0 wrote:
does the new gcc compile code for -m68020 as default?

Unlike other m68k platforms, gcc for MiNT compiles code with -m68000 by default.

I got an lib, compiled for 68000 ( ... ) now I link it into an app that is
compiled with -m68020, would it be ok?

No, it is not 100% OK, so it is wrong.
There is a difference in functions returning float/double/long double. On 68000, the return value is put in d0/d1, on 68020-60 (implicitly with FPU) the return value is put in fp0. This has been like this for ages (however, GCC could be internally configured differently).

You must exactly use the same CPU / FPU / mshort options for all the libraries and your program. This is why we need a standard set of multilibs and provide all the versions for each library.

So if your libs does not return floats, it will probably work.
Don't complain if you encounter inexplicable crashes.

--
Vincent Rivière