Shop OBEX P1 Docs P2 Docs Learn Events
Code breaks w/ gcc from SimpleIDE 0.8.5 --> SimpleIDE 0.9.40 — Parallax Forums

Code breaks w/ gcc from SimpleIDE 0.8.5 --> SimpleIDE 0.9.40

DavidZemonDavidZemon Posts: 2,973
edited 2013-09-05 15:58 in Propeller 1
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:
~$ 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

  • jazzedjazzed Posts: 11,803
    edited 2013-09-03 11:03
    Hi.

    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.
  • SRLMSRLM Posts: 5,045
    edited 2013-09-03 11:17
    I think the .cog_ram directive was discontinued. Instead, use:
    .compress off
         .org 0
    
    ... [ ASM CODE ] ...
    
         .compress default
    

    (Tested with propeller-elf-gcc v1_9_0_2078 4.6.1)
  • DavidZemonDavidZemon Posts: 2,973
    edited 2013-09-03 11:25
    awesome! that fixed the compile/build errors. Now to test some new code... :/ lol
  • ersmithersmith Posts: 6,054
    edited 2013-09-05 15:58
    In the latest PropGCC from source, .cog_ram has been replaced with a directive .pasm which causes the assembler to work much more like PASM (but is sometimes incompatible with other versions of GAS).

    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
Sign In or Register to comment.