Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hitting OpenSpin's error : Limit of 256 subroutines + objects exceeded #34

Closed
drawkula opened this issue May 13, 2017 · 6 comments
Closed

Comments

@drawkula
Copy link

$ /opt/openspin/bin/openspin -u -L lib system/regnatix/regime.spin 
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.80 Compiled on May  8 2017 04:19:27
Compiling...
system/regnatix/regime.spin
reg-ios.spin(2754:5) : error : Limit of 256 subroutines + objects exceeded
Line:
PUB rd_next:stradr | i,j                                'ramdisk: verzeichniseintrag lesen
Offending Item: rd_next

Which constant (in PropellerCompiler/PropellerCompiler.h#L42-L57?) needs to be increased to compile sources with more than 256 such items?

@reltham
Copy link
Collaborator

reltham commented May 18, 2017

You can't increase this number. The Spin interpreter (in the ROM on the chip) would have to be changed to allow more, since the number has to fit in a byte.

@drawkula
Copy link
Author

drawkula commented May 18, 2017

Then something really strange is going on that I really do not understand...

$ ./bstc.linux -b -Oa -L lib system/regnatix/regime.spin
Brads Spin Tool Compiler v0.15.3 - Copyright 2008,2009 All rights reserved
Compiled for i386 Linux at 08:17:46 on 2009/07/20
Loading Object regime
Loading Object reg-ios
Loading Object glob-con
Loading Object glob-string
Program size is 9868 longs
2 Constants folded
Compiled 2868 Lines of Code in 0.15 Seconds
$ ls -l regime.binary 
-rw-r--r-- 1 yeti yeti 9872 Mai 18 07:46 regime.binary
$ asciiless lib/reg-ios.spin | grep PUB | wc -l
299

regime is the command line interpreter of TriOS (https://hive-project.de/) and the binary built by BSTC is in use for years now.

I'm trying to get TriOS built by OpenSpin.

@reltham
Copy link
Collaborator

reltham commented May 18, 2017

It's removing unused PUBs, -Oa includes that feature. Try using the -u feature of OpenSpin.

@drawkula
Copy link
Author

Using OpenSpin's "-u" makes no difference:

$ /opt/openspin/bin/openspin -L lib system/regnatix/regime.spin
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.80 Compiled on May  8 2017 04:19:27
Compiling...
system/regnatix/regime.spin
|-reg-ios.spin
reg-ios.spin(2754:5) : error : Limit of 256 subroutines + objects exceeded
Line:
PUB rd_next:stradr | i,j                                'ramdisk: verzeichniseintrag lesen
Offending Item: rd_next
$ /opt/openspin/bin/openspin -u -L lib system/regnatix/regime.spin
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.80 Compiled on May  8 2017 04:19:27
Compiling...
system/regnatix/regime.spin
reg-ios.spin(2754:5) : error : Limit of 256 subroutines + objects exceeded
Line:
PUB rd_next:stradr | i,j                                'ramdisk: verzeichniseintrag lesen
Offending Item: rd_next

...but indeed: Running BSTC without optimisations does fail:

$ ./bstc.linux -b -L lib system/regnatix/regime.spin
Brads Spin Tool Compiler v0.15.3 - Copyright 2008,2009 All rights reserved
Compiled for i386 Linux at 08:17:46 on 2009/07/20
Loading Object regime
Loading Object reg-ios
Loading Object glob-con
Loading Object glob-string

glob-string - Relocation pointer error!! 0B13
glob-string - FATAL! Unable to locate Object to fixup!! 19

Compiled 2868 Lines of Code in 0.1 Seconds

@reltham
Copy link
Collaborator

reltham commented May 18, 2017

Okay, I guess BSTC does things differently and manages to make it work.

I'm not sure this can be solved easily with OpenSpin, because of how the internal structure works (based on Chips original x86 code).

You might need to split apart the file that has 299 PUBs to be in separate objects in order to get it working. If that is even an option for you.

@drawkula
Copy link
Author

drawkula commented May 18, 2017

Thanks!

Maybe some PUBs could be used like a BDOS call with function numbers as 1st argument. That would be a dramatic change of the OS's function call API. This code in its current state is in use for years now.

IIRC the OS and it's transient programs (without counting some separately distributed add-ons) make >51000 lines of code now.

We definitely have something to discuss: Change or stick to BSTC forever?

Tertium non datur?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants