Shop OBEX P1 Docs P2 Docs Learn Events
New version of PropGCC for P2 posted on Google Code - Page 2 — Parallax Forums

New version of PropGCC for P2 posted on Google Code

2

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-12 20:15
    SRLM wrote: »
    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.
  • ersmithersmith Posts: 6,052
    edited 2013-03-13 10:48
    SRLM wrote: »
    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.)

    Eric
  • RaymanRayman Posts: 14,633
    edited 2013-03-15 13:24
    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...
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-15 15:23
    Rayman wrote: »
    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.
  • SRLMSRLM Posts: 5,045
    edited 2013-03-29 17:47
    I installed bison and flex, and tried the installation again. This time, I got this error:
    cp tiny/tinyio.h tiny/tinystream.h tiny/tinystream tiny/siodev.h /opt/parallax/propeller-elf/include
    make: Entering directory `/home/clewis/Downloads/propgcc/propgcc/spin2cpp'
    mkdir -p obj/linux
    mkdir: cannot create directory `obj/linux': Permission denied
    make: *** [obj/linux] Error 1
    make: Leaving directory `/home/clewis/Downloads/propgcc/propgcc/spin2cpp'
    spin2cpp make clean failed
    

    According to the build steps here, I don't need to run rebuild.sh as root.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-29 17:52
    SRLM wrote: »
    I installed bison and flex, and tried the installation again. This time, I got this error:
    cp tiny/tinyio.h tiny/tinystream.h tiny/tinystream tiny/siodev.h /opt/parallax/propeller-elf/include
    make: Entering directory `/home/clewis/Downloads/propgcc/propgcc/spin2cpp'
    mkdir -p obj/linux
    mkdir: cannot create directory `obj/linux': Permission denied
    make: *** [obj/linux] Error 1
    make: Leaving directory `/home/clewis/Downloads/propgcc/propgcc/spin2cpp'
    spin2cpp make clean failed
    

    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.
  • SRLMSRLM Posts: 5,045
    edited 2013-03-29 18:28
    David Betz wrote: »
    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).
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-29 18:44
    SRLM wrote: »
    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-29 18:50
    David Betz wrote: »
    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.
  • SRLMSRLM Posts: 5,045
    edited 2013-03-30 00:52
    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 04:42
    SRLM wrote: »
    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.
  • Heater.Heater. Posts: 21,230
    edited 2013-03-30 06:23
    Ha ha, I just put up a new install of Debian wheezy and ran into all the dependency issues again.

    Bison being needed for spin2cpp and termcap for propgcc.

    # apt-get install bison libbncurses5-dev

    Fixes it.
  • pedwardpedward Posts: 1,642
    edited 2013-04-01 00:49
    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! ;)
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-03 17:35
    make is broken under Win7Pro 64 bit :-(

    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"
    David Betz wrote: »
    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?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-03 18:21
    make is broken under Win7Pro 64 bit :-(

    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"
    Sounds like I need to add that dll to the ones that are included in the zip file.
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-03 18:37
    The DLL is there in propgcc/bin 120Kb in size

    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.
    David Betz wrote: »
    Sounds like I need to add that dll to the ones that are included in the zip file.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-03 18:49
    The DLL is there in propgcc/bin 120Kb in size

    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.
  • RaymanRayman Posts: 14,633
    edited 2013-04-04 02:57
    Does -mcog work now? I thought I remembered it not working...
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-04 03:34
    Rayman wrote: »
    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-08 10:48
    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:

    http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-2013-04-08.zip&can=2&q=#makechanges
  • SRLMSRLM Posts: 5,045
    edited 2013-04-11 16:04
    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-14 06:21
    I've uploaded a new release of the P1/P2 version of PropGCC to Google Code. This version includes Eric's enhancements for better PASM support in GAS.

    Here is how Eric describes these changes:
    ersmith wrote: »
    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.

    Eric
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-17 07:45
    I've just posted a new Windows build of PropGCC to Google Code.

    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.
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-17 09:40
    Hi David,

    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
    

    Looks like Eric removed or changed the MVI macros
  • ersmithersmith Posts: 6,052
    edited 2013-04-17 10:10
    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'
    
    Looks like you're trying to link an LMM fibo.o in CMM mode. Try changing "fibo.o" in the command line above to "fibo.c".

    CMM has never had the LMM_MVI_ kernel functions; it has a 5 byte compressed "mvi" instruction instead.

    Eric
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-17 10:18
    Thanks Eric, that worked.

    My mistake was just changing the Makefile's MODEL? to cmm, and using make.
    ersmith wrote: »
    Looks like you're trying to link an LMM fibo.o in CMM mode. Try changing "fibo.o" in the command line above to "fibo.c".

    CMM has never had the LMM_MVI_ kernel functions; it has a 5 byte compressed "mvi" instruction instead.

    Eric
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-17 10:40
    Thanks Eric, that worked.

    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.
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-17 10:46
    Thanks David, that would do it too :)
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-14 04:12
    I've just posted a new Macintosh build of the p2test branch to Google Code:

    http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-2013-04-14-mac.zip&can=2&q=
  • potatoheadpotatohead Posts: 10,261
    edited 2013-05-14 06:03
    Thanks. I wasn't able to get back to you yesterday.
Sign In or Register to comment.