Just to clarify: the garbage collection of __load_start_* labels is not new: it's been doing that since I started looking into the subject. The new part is that label __load_start_memory_kerext: this did not exist in the previous versions. So as long as no user code (in previous versions) had any __load_start_* labels garbage collection worked fine.
Thanks for the clarification. I have no idea where that symbol is coming from. As far as I know, it has nothing to do with the P2 changes.
Just to clarify: the garbage collection of __load_start_* labels is not new: it's been doing that since I started looking into the subject. The new part is that label __load_start_memory_kerext: this did not exist in the previous versions. So as long as no user code (in previous versions) had any __load_start_* labels garbage collection worked fine.
The LMM kernels have been re-arranged a bit so that some lesser used functions are in "kernel extensions" (inspired by Bill Henning's FLIB) and loaded on demand. This lets us put optimized PASM versions of debug code, floating point code, and memory operations into the LMM kernel without overflowing the 2K limit. This does, unfortunately, mean that custom linker scripts used with older versions of PropGCC will have to be modified. The kernel extensions area is in COG memory from 0x6c0 to 0x7c0.
(The kernel extensions change is on the p2test branch, but it applies to P1 as well so that we can run gdb on the P1 as well as P2.)
David, I have an old PropGCC installed now but I'd like to try this new one with P2 support that you posted the link to.
But, the install.txt says it's only for Linux and I have Windows here...
Can I just manually copy over the propgcc folder and have it work?
Nevermind... I see it now in Ken's post...
The zip file I uploaded is a Windows build but it will work on Linux or the Mac (what I'm using) if you check out the code and build it yourself. If anyone wants to use Linux or Mac OS X and doesn't feel like setting up a build environment, I can do the build and upload that as well.
According to the build steps here, I don't need to run rebuild.sh as root.
Sounds like your directory permissions are wrong. You don't need to run rebuild.sh as root as long as you own all of the files in the tree and as long as /opt/parallax is writable by everyone.
Sounds like your directory permissions are wrong. You don't need to run rebuild.sh as root as long as you own all of the files in the tree and as long as /opt/parallax is writable by everyone.
I followed the build steps on the page that I linked to, except for including the {GROUP} modifier (it didn't work for me). The rest of the build worked fine up to that point (at the end).
I followed the build steps on the page that I linked to, except for including the {GROUP} modifier (it didn't work for me). The rest of the build worked fine up to that point (at the end).
It's odd that it is trying to create "obj/linux". It should be creating something like "../../build/spin2cpp/obj/linux". There must be some problem with the makefile in conjunction with the fact that you don't seem to have write permission to the directory containing the sources.
It's odd that it is trying to create "obj/linux". It should be creating something like "../../build/spin2cpp/obj/linux". There must be some problem with the makefile in conjunction with the fact that you don't seem to have write permission to the directory containing the sources.
Okay, I see the problem. There is a bug in jbuild.sh where it doesn't pass BUILDROOT when it tries to clean the spin2cpp project. For some reason, the Makefile in spin2cpp wants to create the "obj" directory before it tries to clean it. This is causing your problem since you seem to have installed the sources such that you don't have write permission to that directory. I'll try to fix jbuild.sh but in the meantime you can just change the permissions on the spin2cpp directory so the makefile can write to it.
So, I discovered that in the build that I did above that it didn't come with propeller-load. I tried again, and propeller-load was still missing. So, I tried the following and got the following result:
sudo time ./rebuild.sh
checking for main in -lm... yes
checking for wctype... yes
checking for library containing gethostbyname... none required
checking for library containing socketpair... none required
checking for library containing zlibVersion... no
checking for library containing dlgetmodinfo... no
checking for iconv... yes
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... no
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/home/clewis/Downloads/propgcc/build/gdb'
make: *** [all] Error 2
gdb make all failed
Command exited with non-zero status 1
752.18user 162.43system 21:54.56elapsed 69%CPU (0avgtext+0avgdata 744784maxresident)k
253784inputs+9547840outputs (164major+166356491minor)pagefaults 0swaps
Sorry for the mangled bit at the end. It appears that the time command (on STDOUT?) and the errors (on STDERR?) decided to write at the same time. But, now I have propeller-load.
So, I discovered that in the build that I did above that it didn't come with propeller-load. I tried again, and propeller-load was still missing. So, I tried the following and got the following result:
sudo time ./rebuild.sh
checking for main in -lm... yes
checking for wctype... yes
checking for library containing gethostbyname... none required
checking for library containing socketpair... none required
checking for library containing zlibVersion... no
checking for library containing dlgetmodinfo... no
checking for iconv... yes
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... no
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/home/clewis/Downloads/propgcc/build/gdb'
make: *** [all] Error 2
gdb make all failed
Command exited with non-zero status 1
752.18user 162.43system 21:54.56elapsed 69%CPU (0avgtext+0avgdata 744784maxresident)k
253784inputs+9547840outputs (164major+166356491minor)pagefaults 0swaps
Sorry for the mangled bit at the end. It appears that the time command (on STDOUT?) and the errors (on STDERR?) decided to write at the same time. But, now I have propeller-load.
Looks like you need to install termcap of maybe terminfo. I think I ran into that when I first tried building propgcc.
I downloaded the Windows zip for GCC and ran it using Wine. I installed the SYS5 script for inserting a PE binary handler so Linux will natively execute Windows binaries.
I ran GCC just to see if it worked, haven't done anything exotic yet, but thought I'd post success with this.
Now all I gotta do is remove those pesky .exe extensions!
Has anyone had a chance to try the new version of PropGCC that I uploaded at the end of last month? As I said in my original post in this topic, we are very interested in any testing any of you might be able to do. We'd like to merge the P2 branch into the default branch so we particularly want to have a high degree of confidence that we haven't broken anything on the P1 side. We would greatly appreciate any testing you can do to verify either P1 or P2 programs. Also, I think Ken Gracey may have an incentive to offer those who are willing to help with the testing. Ken?
Is -mp2 the only p2 relevant switch? (I assume that means only LMM mode works, no CMM)
How would I specify tinylib on a command line? (as Make does not work for me)
I am trying to see if I can use it to build some graphics demos for some of the drivers I've made (so I don't have to write everything in pasm) and I need to keep everything to the first 32KB as I use everything above $8000 for graphics buffers.
Is -mp2 the only p2 relevant switch? (I assume that means only LMM mode works, no CMM)
How would I specify tinylib on a command line? (as Make does not work for me)
I am trying to see if I can use it to build some graphics demos for some of the drivers I've made (so I don't have to write everything in pasm) and I need to keep everything to the first 32KB as I use everything above $8000 for graphics buffers.
I'll check the Wiki for info as well.
The -mp2 option by itself will give you LMM mode but you can also specify it with -mcmm or -mcog to get those other modes. There is no -mxmm mode yet.
Does -mcog work now? I thought I remembered it not working...
Yes, it does work. It has been working since December although Eric fixed a bug recently that was causing some problems. One of the first demos for the DE2-115 was multi-cog that launched an -mcog program on all 6 (now 5) COGs.
I've just uploaded a new Windows build of PropGCC for P1/P2. This fixes a rather bad bug caused by my typo that made the mod operator fail. Thanks Eric for fixing it!! The new version is in the standard place on Google Code:
I can confirm that the p2test branch builds for Ubuntu 12.10 and 13.04, with the proper libraries installed. Am I the first to get 13.04 ?
Also, I don't know why it takes so long to build on Windows. On my Ubuntu i7-2700k it builds in 23 minutes (19 minutes with no hyper threading). On my Ubuntu Celeron laptop, it builds in about 40 minutes.
The new GAS is a lot more like PASM, but it's still not completely identical. Here are some of the major differences between PASM/PNut and gas -pasm:
GAS Restrictions Compared to PASM
============================
(1) Floating point in GAS can only occur in a .float directive, and
only simple constants are accepted (no expressions).
(2) Strings can only appear in .ascii (not byte).
(3) Repeat counts missing (for now).
(4) String literals not accepted in immediates.
(5) No Spin operators like |<.
(6) res produces zeros
(7) org and fit are ignored (left to linker).
(8) GAS only accepts ASCII (or UTF-8) input, not UTF-16.
(9) conditionals like if_z cannot start the line, there must be at
least one space before them
(10) long and word directives are not automatically aligned (they must
be explicitly aligned). This is actually a useful feature, since it
allows you to easily define packed structures.
Why use GAS?
============
(1) It supports macros.
(2) It has some built-in macros for LMM.
(3) It has conditional compilation.
(4) It allows you to specify sections to intersperse code and data, or
code that should go in different parts of memory.
(5) It produces linkable objects.
(6) As a consequence of using ELF output, it supports some neat
features like weak symbols (that can be overridden by other modules).
(7) It can specify arbitrary alignment.
(8) It can generate gdb debug info (if you like the gdb debugger).
Some of the GAS restrictions can probably be lifted, but it probably won't ever be 100% compatible with PASM. On the other hand a lot of programs can compile with either one.
Rayman found a particularly bad bug in the Windows version of propeller-load that prevented external memory loads from working on P1. That bug is fixed in this build.
Also, Eric has made improvements to CMM for P2 to allow it to access all 128K of hub memory on the P2. Previously, it was just able to use the first 64K.
I just built the latest p2test branch, and compiled fibo.
- lmm version worked fine
- cmm version did not work, I got the following error messages:
propeller-elf-gcc -Os -mcmm -mp2 -mno-fcache -o fibo.elf fibo.o
fibo.o: In function `_main':
(.text+0x58): undefined reference to `__LMM_MVI_r0'
fibo.o: In function `_main':
(.text+0x70): undefined reference to `__LMM_MVI_r13'
fibo.o: In function `_main':
(.text+0x84): undefined reference to `__LMM_MVI_r6'
fibo.o: In function `_main':
(.text+0xc8): undefined reference to `__LMM_MVI_r1'
fibo.o: In function `_main':
(.text+0xd4): undefined reference to `__LMM_MVI_r6'
collect2: ld returned 1 exit status
make: *** [fibo.elf] Error 1
My mistake was just changing the Makefile's MODEL? to cmm, and using make.
I guess that the makefile targets should all depend on the makefile itself. Until we do that, you should do "make clean" before rebuilding after modifying the model.
Comments
The LMM kernels have been re-arranged a bit so that some lesser used functions are in "kernel extensions" (inspired by Bill Henning's FLIB) and loaded on demand. This lets us put optimized PASM versions of debug code, floating point code, and memory operations into the LMM kernel without overflowing the 2K limit. This does, unfortunately, mean that custom linker scripts used with older versions of PropGCC will have to be modified. The kernel extensions area is in COG memory from 0x6c0 to 0x7c0.
(The kernel extensions change is on the p2test branch, but it applies to P1 as well so that we can run gdb on the P1 as well as P2.)
Eric
But, the install.txt says it's only for Linux and I have Windows here...
Can I just manually copy over the propgcc folder and have it work?
Nevermind... I see it now in Ken's post...
According to the build steps here, I don't need to run rebuild.sh as root.
I followed the build steps on the page that I linked to, except for including the {GROUP} modifier (it didn't work for me). The rest of the build worked fine up to that point (at the end).
Bison being needed for spin2cpp and termcap for propgcc.
# apt-get install bison libbncurses5-dev
Fixes it.
I ran GCC just to see if it worked, haven't done anything exotic yet, but thought I'd post success with this.
Now all I gotta do is remove those pesky .exe extensions!
I get a dialog box "make.exe - Entry Point Not Found"
"The Procedure entrypoint libintl_setlocale could not be located in the dynamic link library libintl-8.dll"
Is -mp2 the only p2 relevant switch? (I assume that means only LMM mode works, no CMM)
How would I specify tinylib on a command line? (as Make does not work for me)
I am trying to see if I can use it to build some graphics demos for some of the drivers I've made (so I don't have to write everything in pasm) and I need to keep everything to the first 32KB as I use everything above $8000 for graphics buffers.
I'll check the Wiki for info as well.
http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-2013-04-08.zip&can=2&q=#makechanges
Also, I don't know why it takes so long to build on Windows. On my Ubuntu i7-2700k it builds in 23 minutes (19 minutes with no hyper threading). On my Ubuntu Celeron laptop, it builds in about 40 minutes.
Here is how Eric describes these changes:
http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-2013-04-17.zip&can=2&q=#makechanges
Rayman found a particularly bad bug in the Windows version of propeller-load that prevented external memory loads from working on P1. That bug is fixed in this build.
Also, Eric has made improvements to CMM for P2 to allow it to access all 128K of hub memory on the P2. Previously, it was just able to use the first 64K.
I just built the latest p2test branch, and compiled fibo.
- lmm version worked fine
- cmm version did not work, I got the following error messages:
Looks like Eric removed or changed the MVI macros
CMM has never had the LMM_MVI_ kernel functions; it has a 5 byte compressed "mvi" instruction instead.
Eric
My mistake was just changing the Makefile's MODEL? to cmm, and using make.
http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-2013-04-14-mac.zip&can=2&q=