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

Re: [MiNT] Still don't get it - difference between 68020 and 68020-60



Miro Kropacek wrote:
I passed -m68020 to gcc invocation, but gcc takes libs from m68020-60 -
why is that? Would be nice if someone can explain it in one sentence :)
As far as I understood the -m68020 is using the fpu, while 68020-60
doesn't.
There's no magic. It's well defined behavior, you can take a look at
Vincent's patch, there's config file where you define your multilib
configuration. In practice it means for what CPUs libgcc&  friends
will be build. More or less standard targets are 68000 (default for
Atari), 68020-60 and since ACP project, Coldfire target. All other
options (m68881, m68030, m68040, ...) are just fallbacks to one of
mentioned targets. So m68020/030/040/060 will always choose
/usr/lib/m68020-60/libc.a for example. If you ask why it is so -- it's
because each library (not only gcc but each one you use) would be
needed to recompile for all those targets and of course, nobody is
willing to provide 10 targets of openssl library (it takes long time
to compile, you need to tweak Makefiles / rpm spec files etc).

Just remember to use those three targets and you're fine. And you can
always check with -Wl,-t command line parameter what are you linking
if not sure. (i.e. gcc -m68020 -Wl,-t hello hello.c)

It's possible to build a single object file that contains all of the processor-specific code, and do runtime CPU detection to choose which path to execute. Not sure if it's worth the trouble. (The Intel compiler does this to choose which SSE variant to use on a given CPU, etc.)

It's also possible to just use FPU instructions by default, and let the 68000 trap to an emulator library. But then your performance would go in the toilet running floating point code on 68000s.

--
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/