Closed elliotnunn closed 5 months ago
Frustrating. This used to work a few gcc updates ago.
It looks like gcc now handles the PIC/sep_data stuff before it gets to the code I added for the inline opcodes stuff.
The inline syntax gets converted to a 'raw_inline' attribute that triggers some special code when the call insn is emitted in m68k.c. There is one place in calls.cc where I check for the attribute and disable some transformation in that case. But apparently another transformation happens in-between for fPIC. We just need to figure out where.
How can I do an incremental build of GCC using the Retro68 build system? Following the readme causes a fresh build every time, making this hard to track down!
And I am very curious: why were you using -msep-data?
Using Retro68's build script, you can't, it's just a series of command invocations.
But after the build, you can cd
to gcc-build/gcc
and run make
there. This will just build the cc1
binary inside the build directory, which you can test directly in this case (cc1
is just the compiler itself without the driver that wraps it, it's basically equivalent o gcc -S -o -
)
I think I have now managed to fix this. Have fun!
Can confirm. Thank you!!
Hello Wolfgang!
To save RAM in classicvirtio, I am trying to run my DRVR code from ROM. This requires A5-relative data references to the global variables in RAM.
The "-msep-data" option seems to generate the A5-relative code I need, but it breaks ONEWORDINLINE, leaving the linker searching for nonexistent library functions like BLOCKMOVEDATA.
I wrote a quick shell script to demonstrate the effect of various options on the codegen. Outputs lacking ".short 0xa9ff" are broken.
I can't figure out from m68k.cc etc how the "raw_inline" attribute interacts with codegen options. Any idea how we can get this to work? Many thanks!