Assembler not consistent with pre-processor macros
DavidZemon
Posts: 2,973
Computer #1 is Ubuntu 13.10 with PropGCC installed via SimpleIDE. propeller-elf-gcc -v returns version 1.0.0.2261
Computer #1 works perfectly.
Computer #2 is Windows 8.1 with PropGCC installed via SimpleIDE. propeller-elf-gcc -v returns version 1.0.0.2162
Computer #2 does not process "#include <file.h>" or various "#define THE_ANSWER 42"
Does anyone know why or how I can get around this? Compiling PropGCC from source is not a good solution to my overall goals.
Computer #1 works perfectly.
Computer #2 is Windows 8.1 with PropGCC installed via SimpleIDE. propeller-elf-gcc -v returns version 1.0.0.2162
Computer #2 does not process "#include <file.h>" or various "#define THE_ANSWER 42"
Does anyone know why or how I can get around this? Compiling PropGCC from source is not a good solution to my overall goals.
Comments
Please post sample code and what is meant by "does not process".
When I compile libPropWare_lmm.a and then view the map, I get numerous lines like below. BIT_0 is defined in line 51 of PropWare.h (link). PropWare.h is supposed to be included by line 31 of spi_as.S, but PropGCC seems to be ignoring the line as though it's a comment.
Lines 35 through 54 of spi_as.S provide constants like "#define SPI_FUNC_SEND 0" but they are not being processed because they're showing up in the map like so: By processed, I mean parsed and replaced with values throughout the file like the C preprocessor. It works great with PropGCC v1.0.0.2261 (I assume this is coming from a difference in PropGCC versions, not Windows vs Linux).
The last unstable Linux release is 3.13-rc8.
Just guessing. I have no idea how well SimpleIDE handles these Windows quirks.
If a SimpleIDE problem is suspected, use the command line tools and try to reproduce the issue. Get GNU make binaries here: http://gnuwin32.sourceforge.net/packages/make.htm ... I had to do this Thursday for a project, and it worked fine.
I should add though, the above link points to the Doxygen docs. Within that page are two links to the source code on GitHub - if you follow those, they point to the master branch and I'm currently working on the development branch.
And that's a problem on Windows, because Windows file systems are case insensitive. I suspect that is the root problem -- I think under Windows gcc (or Make, or SImpleIDE) can't distinguish between ".S" and ".s" files.
There are two work-arounds: add an explicit command line argument to gcc to invoke the preprocessor, or (easier) change the file extension to ".sx" instead of ".S". ".sx" means "assembler that needs pre-processing" (just like .S) but doesn't rely on case. Both solutions should work fine under Linux as well as Windows.
(Edited: I see David and SwimDude have already found these solutions!)