bebbo / gcc

Bebbo's gcc-6-branch for m68k-amigaos
GNU General Public License v2.0
33 stars 11 forks source link

-mstackextend unavailable? #138

Closed githubaf closed 3 years ago

githubaf commented 3 years ago

I tried to compile/link a program with -noixemul -mstackextend -lstack but get an error message error: unrecognized command line option '-mstackextend';

How can I get stack extension?

bebbo commented 3 years ago

since this affects each function entry/exit and slows down, I consider this option as a very bad idea. Better give your application a sufficient stack size.

githubaf commented 3 years ago

Sure, the overhead is there. (I actually wanted to test the time overhead in my application right now) But if the code has recursive calls you never know in advance how much stack is needed, do you?

githubaf commented 3 years ago

How can I enforce a minimum stack? (apart from stack command in cli?)

I added a line unsigned long __stack={1000000}; // are the {} necesarry?

and linked libnix/lib/swapstack.o to the program. I always use -noixemul. The program still crashes.

Is that supposed to do the job?

bebbo commented 3 years ago

How can I enforce a minimum stack? (apart from stack command in cli?)

I added a line unsigned long __stack={1000000}; // are the {} necesarry?

and linked libnix/lib/swapstack.o to the program. I always use -noixemul. The program still crashes.

Is that supposed to do the job?

I guess you have to add the file /opt/amiga/m68k-amigaos/libnix/lib/swapstack.o to the link command and use __stack:

 * Usage: Define some variable 'unsigned long __stack={desired size};'
 *    somewhere in your code and link with this module.
githubaf commented 3 years ago

Ok, thanks. That seem not to work correctly. (only partly) I will open another issue.