Shop OBEX P1 Docs P2 Docs Learn Events
Trying to build TinyJS for the Prop. — Parallax Forums

Trying to build TinyJS for the Prop.

Heater.Heater. Posts: 21,230
edited 2013-08-29 17:11 in Propeller 1
I have been trying to compile a tiny JavaScript interpreter with propgcc and SimpleIDE. It's from here.: http://code.google.com/p/tiny-js/

It builds and run fine on my Debian box. Then I hacked it around a bit to make it more Prop friendly. Removing use of exceptions for example.

Actual compilation goes fine. The executable is about half a meg so I use an XMM setting, hoping it might run on my SDRAM board some time.

Linking fails.

Here is a compilation step:
propeller-elf-c++ -I . -L . -Os -mxmmc -Wall -fno-exceptions -Dprintf=__simple_printf -fno-rtti -std=c99 -c TinyJS.cpp -o xmmc/TinyJS.opp
cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default]
Which goes OK. Here is what the linker says:
/opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `.addinfA':

 (.text+0x1b8): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'

 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `__mul_excep':
 (.text+0x210): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'

 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `__mul_excep':
 (.text+0x21c): relocation truncated to fit: R_PROPELLER_23 against `.mulzeroA'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `__mul_excep':
 (.text+0x228): relocation truncated to fit: R_PROPELLER_23 against `.mulinfA'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `__mul_excep':
 (.text+0x234): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_zero'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `__mul_excep':
 (.text+0x23c): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_infinity'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `.mulzeroA':
 (.text+0x248): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `.mulzeroA':
 (.text+0x250): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_zero'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `.mulinfA':

 (.text+0x25c): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `.mulinfA':
 (.text+0x264): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_infinity'
 /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmmc/libgcc.a(_loadfloat.o): In function `___divsf3':
 (.text+0x28c): additional relocation overflows omitted from the output
 collect2: ld returned 1 exit status
 Done. Build Failed!



What to do?
«1

Comments

  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-04-06 17:05
    Like Sheriff Brody said..."We're going to need a bigger boat." By boat I'm pretty sure he meant RAM. :D
  • Heater.Heater. Posts: 21,230
    edited 2013-04-06 17:21
    Well, I have a board here with 32MB ! That should be enough for anybody.

    If I try to build this for LMM it complains I am half a meg over the top, so that's not so bad.

    The guy(s) who wrote TinyJS have it running on ARMs with only 128K FLASH and 20K RAM.
  • jazzedjazzed Posts: 11,803
    edited 2013-04-06 17:51
    Heater. wrote: »
    Well, I have a board here with 32MB ! That should be enough for anybody.

    If I try to build this for LMM it complains I am half a meg over the top, so that's not so bad.

    The guy(s) who wrote TinyJS have it running on ARMs with only 128K FLASH and 20K RAM.

    Try XMM-SINGLE mode? XMMC uses HUB for data and that may be exceeded with C++.
  • Heater.Heater. Posts: 21,230
    edited 2013-04-06 18:52
    jazzed,

    No change I'm afraid:
    Project Directory: /home/michael/proptinyjs/
    
    propeller-elf-c++ -I . -L . -Os -mxmm-single -Wall -fno-exceptions -fno-rtti -std=c99 -c TinyJS.cpp -o xmm-single/TinyJS.opp
    
     cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default]
     propeller-elf-c++ -I . -L . -Os -mxmm-single -Wall -fno-exceptions -fno-rtti -std=c99 -c TinyJS_Functions.cpp -o xmm-single/TinyJS_Functions.opp
     cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default]
     propeller-elf-c++ -I . -L . -Os -mxmm-single -Wall -fno-exceptions -fno-rtti -std=c99 -c TinyJS_MathFunctions.cpp -o xmm-single/TinyJS_MathFunctions.opp
     cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default]
     propeller-elf-c++ -I . -L . -o xmm-single/proptinyjs.elf -Os -mxmm-single -Wall -fno-exceptions -fno-rtti -std=c99 xmm-single/TinyJS.opp xmm-single/TinyJS_Functions.opp xmm-single/TinyJS_MathFunctions.opp proptinyjs.cpp
     cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default]
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `.addinfA':
     (.text+0x1b8): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `__mul_excep':
     (.text+0x210): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `__mul_excep':
     (.text+0x21c): relocation truncated to fit: R_PROPELLER_23 against `.mulzeroA'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `__mul_excep':
     (.text+0x228): relocation truncated to fit: R_PROPELLER_23 against `.mulinfA'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `__mul_excep':
     (.text+0x234): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_zero'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `__mul_excep':
     (.text+0x23c): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_infinity'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `.mulzeroA':
     (.text+0x248): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `.mulzeroA':
     (.text+0x250): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_zero'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `.mulinfA':
     (.text+0x25c): relocation truncated to fit: R_PROPELLER_23 against `__return_nan'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `.mulinfA':
     (.text+0x264): relocation truncated to fit: R_PROPELLER_23 against `__return_signed_infinity'
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/xmm/libgcc.a(_loadfloat.o): In function `___divsf3':
     (.text+0x28c): additional relocation overflows omitted from the output
     collect2: ld returned 1 exit status
     Done. Build Failed!
    
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-04-06 19:06
    All the errors visible so far appear to be in the float modules.... Is there something funky in the float return from propgcc versus regular gcc? (totally guessing here)
  • jazzedjazzed Posts: 11,803
    edited 2013-04-06 19:13
    Is this compiler from the p2test branch or default? The default is currently the stable branch. We will be making a release branch tomorrow to freeze current code. Afterwards p2test will be merged to default.
  • Heater.Heater. Posts: 21,230
    edited 2013-04-06 23:16
    Its p2test from a week ago or so.
    $ hg branch
    p2test
    michael@debian:~/tools/propgcc$ /opt/parallax/bin/propeller-elf-g++ -v
    Using built-in specs.
    COLLECT_GCC=/opt/parallax/bin/propeller-elf-g++
    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_v0_3_5_1943 --with-bugurl=http://code.google.com/p/propgcc/issues
    Thread model: single
    gcc version 4.6.1 (propellergcc_v0_3_5_1943) 
    michael@debian:~/tools/propgcc$
    
  • Heater.Heater. Posts: 21,230
    edited 2013-04-07 00:18
    Bah. I can't build the default branch.
    $ hg update default --clean
    $ hg branch
    default
    $ ./rebuild.sh
    if [ -r syslex.c ]; then \
              gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -Wno-error syslex.c ; \
            else \
              gcc -c -I. -I../../../propgcc/binutils/binutils -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -Wno-error ../../../propgcc/binutils/binutils/syslex.c ;\
            fi
    syslex.l:31:21: fatal error: sysinfo.h: No such file or directory
    

    Debian wheezy 64 bit.
  • ReinhardReinhard Posts: 489
    edited 2013-04-07 02:09
    I tried compile the TinyJS Source without any (propeller-friendly) modifications.

    seems

    char *strdup(const char *source) from string.h

    is missing ?

    I use this version of propeller-elf-gcc:

    Using built-in specs.
    COLLECT_GCC=propeller-elf-gcc
    COLLECT_LTO_WRAPPER=/home/knoppix/SimpleIDE-0-7-2/parallax/bin/../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 --with-pkgversion=propellergcc_v0_3_4_1483 --with-bugurl=http://code.google.com/p/propgcc/issues
    Thread model: single
    gcc version 4.6.1 (propellergcc_v0_3_4_1483)

    best regards
    Reinhard
  • ersmithersmith Posts: 6,054
    edited 2013-04-07 04:18
    I think it is overflowing... not the memory per se, but the number of bits allocated for constants. The problem is the expansion of the "brw" macro in lib1funcs.asm (which contains the floating point code). "if_nz brw #__return_nan" expands to something like:
    if_nz   jmp #__LMM_JMP
       long __return_nan
    
    So far so good... but if the branch is not taken then we need the "long" data to be ignored (treated as a nop instruction). That requires that the condition code bits be all 0, and is what the R_PROPELLER_23 reloc checks.

    The C compiler itself actually works around this in XMM mode by inserting a short branch around the jump instead of relying on the jmp data turning into a no-op. Maybe we have to do that in lib1funcs.asm too.

    For now you may be able to work around it by replacing all .text directives in lib1funcs.asm with .section .hubtext, "ax" and recompiling. Let me know if that helps.

    Eric
  • Heater.Heater. Posts: 21,230
    edited 2013-04-07 05:24
    Reinhard, yes strdup was not found. I was getting tired and frustrated so I just quickly cut and pasted the strdup out of the propgcc source into TinyJS.cpp !!

    Eric, I'll get on to that later. My dev machine is tied up with farmville just now:(
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-04-07 05:29
    Heater. wrote: »
    My dev machine is tied up with farmville just now:(

    Wow! That must be interesting to be a developer for FarmVille!!! You must have lots of friends!! :)
  • Heater.Heater. Posts: 21,230
    edited 2013-04-07 05:49
    Err, no. I think it's my dev machine. The rest of the houshold thinks it's a FarmVille engine. Ever since they discovered it runs FarmVille 2 much better than the old XP box that is here. I think they have made Linux too easy to use:)
  • jazzedjazzed Posts: 11,803
    edited 2013-04-07 08:52
    Unfortunately there are a few header bugs in Propeller-GCC at the moment.
    Once they are addressed tiny-js builds no problem with the default branch.

    There is still the matter of making it "embedded" though. :)

    My files are attached for an easy fix.

    string.h should replace ${PROPGCC}/propeller-elf/include/string.h
    stat.h should replace ${PROPGCC}/propeller-elf/include/sys/stat.h

    ${PROPGCC} is your Propeller-GCC install path.


    Solve the header issues like this:

    Function strdup is in the library, but the declaration is missing from string.h.
    Add it here ${PROPGCC}/propeller-elf/include/string.h

    char * strdup (const char *s1);

    File sys/stat.h is missing the C++ wrapper. Add it after #include <sys/types.h>

    #if defined(__cplusplus)
    extern "C" {
    #endif

    // add this before the last #endif
    #if defined(__cplusplus)
    }
    #endif
    h
    h
    h
    h
    858B
  • Heater.Heater. Posts: 21,230
    edited 2013-04-07 10:33
    jazzed,

    OK I'll have a go at that now.

    I can't build the default branch anymore. See post #9 above.
  • jazzedjazzed Posts: 11,803
    edited 2013-04-07 10:41
    Heater. wrote: »
    jazzed,

    OK I'll have a go at that now.

    I can't build the default branch anymore. See post #9 above.

    Hi Heater,

    Looks like we can squeeze these two fixes into the next build(s) that David uploads.

    I'm testing builds with those changes now and will post them to both branches after some sanity checks.

    Do you have diffs or maybe a project clone for Propeller? With exceptions, i get 600KB of code :(

    Thanks,
    --Steve
  • ersmithersmith Posts: 6,054
    edited 2013-04-07 16:55
    Heater. wrote: »
    jazzed,

    OK I'll have a go at that now.

    I can't build the default branch anymore. See post #9 above.

    I think that's a Debian Wheezy problem; I don't think we've ever been able to build there (or at least I can't). p2test has a newer version of binutils now, and they've fixed the build.

    Eric
  • Heater.Heater. Posts: 21,230
    edited 2013-04-08 06:37
    jazzed,

    I have put up tiny-js-propeller on github:
    https://github.com/ZiCog/tiny-js-propeller


    Only changes so far are to crudely comment out the try/throw/catch stuff. Any errors in JS and the Script just dies now. Also added my .side file.

    In the original svn repo there is a branch that tries to make the thing more ECMAScript compliant. It's over 8000 lines of code so is even bigger and I guess we don't want to go there. Besides I cold not get it to compile. That branch is not in my repo.

    I can add you as a collaborator if you have a gihub account.

    I now have the default branch of propgcc working on Debian Wheezy, pulled last night, and I still can't compile tinyjs. Still get those floating point related errors.
  • jazzedjazzed Posts: 11,803
    edited 2013-04-08 08:46
    It builds for me using the latest default branch. Can also build with SimpleIDE.

    The question is, how to set it up to run javascript on Propeller? Use a simple monitor?
    $ make clean; make CC="propeller-elf-g++ -mxmmc"
    rm -f run_tests Script run_tests.o Script.o TinyJS.o TinyJS_Functions.o TinyJS_MathFunctions.o
    propeller-elf-g++ -mxmmc -c -g -Wall -rdynamic -D_DEBUG run_tests.cpp -o run_tests.o
    propeller-elf-g++ -mxmmc -c -g -Wall -rdynamic -D_DEBUG TinyJS.cpp -o TinyJS.o
    propeller-elf-g++ -mxmmc -c -g -Wall -rdynamic -D_DEBUG TinyJS_Functions.cpp -o TinyJS_Functions.o
    propeller-elf-g++ -mxmmc -c -g -Wall -rdynamic -D_DEBUG TinyJS_MathFunctions.cpp -o TinyJS_MathFunctions.o
    propeller-elf-g++ -mxmmc -g -rdynamic run_tests.o TinyJS.o TinyJS_Functions.o TinyJS_MathFunctions.o -o run_tests
    propeller-elf-g++ -mxmmc -c -g -Wall -rdynamic -D_DEBUG Script.cpp -o Script.o
    propeller-elf-g++ -mxmmc -g -rdynamic Script.o TinyJS.o TinyJS_Functions.o TinyJS_MathFunctions.o -o Script
    
  • ReinhardReinhard Posts: 489
    edited 2013-04-08 09:59
    Java on Propeller is sexy ;-))

    http://www.youtube.com/watch?v=Mk3qkQROb_k
  • Heater.Heater. Posts: 21,230
    edited 2013-04-08 11:05
    Reinnard,

    Java is not sexy anywhere. And here is a cool dude to explain why:
    http://www.youtube.com/watch?v=FJ7QsEytQq4
    JavaScript is a whole different, and superior, language.
    Although some would doubt the sanity of node.js
    http://www.youtube.com/watch?v=bzkRVzciAZg
  • Heater.Heater. Posts: 21,230
    edited 2013-04-08 11:10
    Jazzed,

    Bah, wah, this is not fair!. I cannot compile tiny-js with the latest default propgcc or the p2test branch.

    If Script runs on the Prop then we only need to cut and paste a JS program into the the serial terminal and it will run. at least that would be a start.

    Did I say we needed a JS editor in SimpleIDE?
  • jazzedjazzed Posts: 11,803
    edited 2013-04-08 11:16
    LOL At least that video is well produced and entertaining; however, the round Oracle buildings figure too prominently for my taste.

    Javelin Java (1.1) was ported to Propeller years ago in SPIN and PASM and performed better than ZOG in some tests ;)
    It could also run programs from EEPROM although slower than normal. At this time the compiler support seems to be broken though.

    I never had time or any earnest mandate to try porting Java 2. I do have a Java2 book for that purpose donated from a school.
  • Heater.Heater. Posts: 21,230
    edited 2013-04-08 15:26
    eric,

    I tried your hack to lib1funcs.asm to build tiny-js with p2test. It did not work:
    propeller-elf-c++ -I . -L . -Os -mxmm-split -Wall -fno-exceptions -mno-fcache -fno-rtti -c TinyJS.cpp -o xmm-split/TinyJS.opp
     propeller-elf-c++ -I . -L . -Os -mxmm-split -Wall -fno-exceptions -mno-fcache -fno-rtti -c TinyJS_Functions.cpp -o xmm-split/TinyJS_Functions.opp
     propeller-elf-c++ -I . -L . -Os -mxmm-split -Wall -fno-exceptions -mno-fcache -fno-rtti -c TinyJS_MathFunctions.cpp -o xmm-split/TinyJS_MathFunctions.opp
     propeller-elf-c++ -I . -L . -o xmm-split/Script.elf -Os -mxmm-split -Wall -fno-exceptions -mno-fcache -fno-rtti xmm-split/TinyJS.opp xmm-split/TinyJS_Functions.opp xmm-split/TinyJS_MathFunctions.opp Script.cpp
     xmm-split/TinyJS.opp: In function `CScriptVarLink::getIntName()':
     (.text+0xdf8): relocation truncated to fit: R_PROPELLER_23 against symbol `_atoi' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(atoi.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(system_error.o): In function `__static_initialization_and_destruction_0':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/src/../../../../../../propgcc/gcc/libstdc++-v3/src/system_error.cc:70:(.text.startup._GLOBAL__sub_I__ZNSt14error_categoryC2Ev+0x74): relocation truncated to fit: R_PROPELLER_23 against symbol `___cxa_atexit' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(atexit.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(misc-inst.o): In function `_ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE4syncEv':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/ext/stdio_sync_filebuf.h:162:(.text._ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE4syncEv+0x10): relocation truncated to fit: R_PROPELLER_23 against symbol `_fflush' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(fflush.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(misc-inst.o): In function `_ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE10syncungetcEi':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/ext/stdio_sync_filebuf.h:201:(.text._ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE9underflowEv+0x34): relocation truncated to fit: R_PROPELLER_23 against symbol `_ungetc' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(ungetc.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(misc-inst.o): In function `_ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE6xsputnEPKci':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/ext/stdio_sync_filebuf.h:223:(.text._ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE6xsputnEPKci+0x1c): relocation truncated to fit: R_PROPELLER_23 against symbol `_fwrite' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(fwrite.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(misc-inst.o): In function `_ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE8syncputcEi':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/ext/stdio_sync_filebuf.h:206:(.text._ZN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEE8overflowEi+0x34): relocation truncated to fit: R_PROPELLER_23 against symbol `_putc' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(putc.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(string-inst.o): In function `_ZNSt11char_traitsIcE4copyEPcPKcj':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/bits/char_traits.h:273:(.text._ZNSs7_M_copyEPcPKcj+0xc): relocation truncated to fit: R_PROPELLER_23 against symbol `_memcpy' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(memcpy.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(string-inst.o): In function `_ZNSt11char_traitsIcE4moveEPcPKcj':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/bits/char_traits.h:269:(.text._ZNSs7_M_moveEPcPKcj+0xc): relocation truncated to fit: R_PROPELLER_23 against symbol `_memmove' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(memmove.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(string-inst.o): In function `_ZNSt11char_traitsIcE6assignEPcjc':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/bits/char_traits.h:277:(.text._ZNSs9_M_assignEPcjc+0x18): relocation truncated to fit: R_PROPELLER_23 against symbol `_memset' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(memset.o)
     /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libstdc++.a(string-inst.o): In function `_ZNSt11char_traitsIcE4copyEPcPKcj':
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/bits/char_traits.h:273:(.text._ZNSs13_S_copy_charsEPcN9__gnu_cxx17__normal_iteratorIS_SsEES2_+0x10): relocation truncated to fit: R_PROPELLER_23 against symbol `_memcpy' defined in .text section in /opt/parallax/lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/lib/xmm/libc.a(memcpy.o)
     /home/michael/tools/build/gcc/propeller-elf/xmm/libstdc++-v3/include/bits/char_traits.h:273:(.text._ZNSs13_S_copy_charsEPcN9__gnu_cxx17__normal_iteratorIPKcSsEES4_+0x10): additional relocation overflows omitted from the output
     collect2: ld returned 1 exit status
     Done. Build Failed!
    
  • ersmithersmith Posts: 6,054
    edited 2013-04-08 16:57
    Ah, I think I see the problem. The assembler should use a full 32 bit reloc (instead of the abbreviated one that checks the condition bits) for unconditional branches, but it isn't doing that. So any program bigger than 256KB could run into problems :-(,

    I'll try to fix this; it may take a day or two. Thanks for bringing this to our attention!

    Eric
  • ersmithersmith Posts: 6,054
    edited 2013-04-08 18:35
    ersmith wrote: »
    Ah, I think I see the problem. The assembler should use a full 32 bit reloc (instead of the abbreviated one that checks the condition bits) for unconditional branches, but it isn't doing that. So any program bigger than 256KB could run into problems :-(,

    I'll try to fix this; it may take a day or two. Thanks for bringing this to our attention!

    It wasn't as bad as I thought, so the fix is checked in to the p2test branch. tiny-js compiles now, to a huge program with 651700 bytes of text. I don't know if it actually runs though, I wasn't brave enough to try it :-).

    One word of warning if you want to try it: the latest p2test branch also has a modified assembler that uses some of Jac's ideas to improve PASM compatibility. Instead of the .cog_ram directive there's a .pasm directive which causes addressing to be done in longs instead of bytes. This will only affect hand-written assembly that uses .cog_ram, and in many cases just changing ".cog_ram" to ".pasm" will work, but the semantics are slightly different. On the plus side, you can feed ASCII .spin files to gas now if you give it the --pasm option (or edit the .spin file to add .pasm at the top). Sometimes they even assemble correctly!

    Eric
  • jazzedjazzed Posts: 11,803
    edited 2013-04-08 19:30
    I couldn't resist. :)

    attachment.php?attachmentid=100769&d=1365474555
    1024 x 675 - 88K
  • Heater.Heater. Posts: 21,230
    edited 2013-04-09 00:39
    @Jazzed,

    You bounder! Well done.

    @Eric,

    Just finished rebuilding p2test again. Yes! It now builds TinyJS. You really are turbo. Now I have to run to work where my Propeller gear is and see if it runs.

    We have some issues here:

    TinyJS is huge! Jazzed's screen shot shows 800KBytes. I get nearly 700KBytes(-Os helps). We only have 3000 lines of code here so this is seriously bloated. God knows how Pur3 gets it down to 128K FLASH and 20K RAM.

    Of course it is making use of <string>, <sstream> and <vector>. Can I assume that pulls in a lot of junk we don't need.
    Those 64 bit doubles do not help but I can't see JS working with only 32 bit floats.

    I don't see any mention of an event loop in the interpreter, that's not good.

    Seems adding functions for tweaking pins and accessing other Prop features is easy enough.
  • doggiedocdoggiedoc Posts: 2,241
    edited 2013-04-09 03:43
    Nice job guys!
  • Heater.Heater. Posts: 21,230
    edited 2013-04-09 05:06
    Jazzed,

    I can't build propside with Spin support any more. When running the release script it fails to find the headers for quazip.
    I copied those headers to the propside source directory and things proceeded until: /usr/bin/ld: cannot find -lquazip

    Some how I managed to do this a few days ago, now what did I do then...?

    Anyway, now I find my GadgetGanster Prop hardware is not in the office after all...now what did I did with it...?
Sign In or Register to comment.