Hi Thomas,
On Mon, Dec 30, 2024 at 10:35 AM Thomas Petazzoni
<thomas.petazzoni@xxxxxxxxxxx> wrote:
On Mon, 30 Dec 2024 09:53:29 +0100
Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
/usr/libexec/gcc/m68k-unknown-linux-musl/as -v -mcpu=68020 --pcrel -o a.o a.s
Thanks, so it fails when -mcpu=68040 is passed to the assembler.
Oh, I misread "caar" as "cacr". The latter exists on MC68040, the
former does not. However, that doesn't explain the failures for pflusha,
which is supported on 68040.
After disabling CONFIG_680[236]0 in the kernel config, I can build
it fine using the buildroot toolchain.
Conclusion: make sure your toolchain supports (a superset of) the
CPUs supported by your kernel config.
Thanks for the investigation. How should the toolchain be configured to
s upport multiple m68k CPUs? My understanding was that when you
configure gcc with --with-cpu=<something>, it means gcc will by default
emit code for <something>, but it can always be overridden when running
gcc using -mcpu=<somethingelse>.
Sorry, it's been ages since I built my own cross-compiler.
IIRC, I always used the default, which gives a compiler targeting all
(non-Coldfire) variants.
The GCC documentation seems to be ambiguous
(https://gcc.gnu.org/install/configure.html):
Example 1: to configure a compiler for SH4A only, but supporting
both endians, with little endian being the default:
--with-cpu=sh4a --with-endian=little,big --with-multilib-list=
vs.
--with-cpu=cpu
--with-cpu-32=cpu
--with-cpu-64=cpu
Specify which cpu variant the compiler should generate code
for by default
How can one build this kernel/sys_m68k.c file if it uses instructions
that are mutually incompatible on different m68k cores?
Each of the CPU-specific sections depends on CPU_IS_*(), which
expand to compile-time and/or run-time checks for the CPU type,
depending on which CONFIG_680*0 kernel config options are set.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds