Code breaks w/ gcc from SimpleIDE 0.8.5 --> SimpleIDE 0.9.40
DavidZemon
Posts: 2,973
In the past, I've always just installed gcc by installing Simple IDE because the installers are so simple. I wrote PropWare using the gcc packaged with SimpleIDE 0.8.5 on Linux and had no errors. With the version of GCC packaged in Simple IDE 0.9.40, I'm getting new errors. Namely in my assembly file. It seems to not like my #define XXXX YYYY pre-processor stuff.
v0.9.40 was installed on a friends computer. In my attempt to debug, I overwrote SimpleIDE's gcc on my machine with propgcc from source which yields:
And now most of PropWare compiles just fine except for one line in the assembly file: ".cog_ram"
The source is here: https://github.com/SwimDude0614/PropWare
And the specific assembly file I'm referring to is here: https://github.com/SwimDude0614/PropWare/blob/master/spi_as.S
v0.9.40 was installed on a friends computer. In my attempt to debug, I overwrote SimpleIDE's gcc on my machine with propgcc from source which yields:
~$ propeller-elf-gcc -vUsing built-in specs. COLLECT_GCC=propeller-elf-gcc COLLECT_LTO_WRAPPER=/opt/parallax/libexec/gcc/propeller-elf/4.6.1/lto-wrapper Target: propeller-elf Configured with: ../../propgcc/gcc/configure --target=propeller-elf --prefix=/opt/parallax --disable-nls --disable-libssp --disable-lto --disable-shared --with-pkgversion=propellergcc-alpha_v1_9_0_2109 --with-bugurl=http://code.google.com/p/propgcc/issues Thread model: single gcc version 4.6.1 (propellergcc-alpha_v1_9_0_2109)
And now most of PropWare compiles just fine except for one line in the assembly file: ".cog_ram"
Building file: ../spi_as.S Invoking: PropGCC Assembler /opt/parallax/bin/propeller-elf-gcc -I/home/david/PropWare -I /opt/parallax/include -o spi_as.o -c ../spi_as.S ../spi_as.S: Assembler messages: ../spi_as.S:39: Error: unknown pseudo-op: `.cog_ram' make: *** [spi_as.o] Error 1
The source is here: https://github.com/SwimDude0614/PropWare
And the specific assembly file I'm referring to is here: https://github.com/SwimDude0614/PropWare/blob/master/spi_as.S
Comments
I'm not sure what changed for this, but I recall some flags changing to allow GAS to work more like PASM.
Maybe Eric or David will understand what changed better than me, and offer a solution.
Hopefully we won't have to change any other user dependent interface on in the GCC tools product.
(Tested with propeller-elf-gcc v1_9_0_2078 4.6.1)
The old .cog_ram directive made the assembler mark symbols with a special flag indicating they were declared in COG memory, and when the linker saw that flag it would divide their values by 4. This only worked sometimes, and wasn't very reliable. .pasm uses a completely different method (changing the instruction relocations) to achieve PASM compatibility.
If you're not doing any arithmetic on labels, you probably won't need .pasm (and probably didn't need .cog_ram, either).
Eric