GCC 3.3.4 setting Stack and Heap

D

Dave Dons

GCC 3.3.4 setting Stack and Heap

Help appreciated setting stack (and heap) in GCC in Linux:

gcc (GCC) 3.2.3 (mingw special 20030504-1) has no problems with:
g++ -Wl,--heap,1048576,--stack,10485760 axx1.cpp utils.cpp -Wall -Os
-o axxngcc
g++ -Wl,--heap=1048576,--stack=10485760 axx1.cpp utils.cpp -Wall -Os
-o axxgcc
g++ -Wl,--heap=0x00100000,--stack=0x00A00000 axx1.cpp -Wall -Os -o
axxgcc
or
g++ -Wl,--stack -Wl,10485760 axx1.cpp utils.cpp -Wall -Os -o axxgcc

However,
gcc (GCC) 3.3.4 (Debian 1:3.3.4-9) in ClusterKnoppix 3.6

g++ -Wl,--stack -Wl,10485760 axx1.cpp utils.cpp -Wall -Os -o axxgcc
and all the other variations above give similar to:

/usr/bin/ld: unrecognized option '--stack'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

I suspect that this is not an issue specific to Knoppix or Debian.

Searching the web yields the results I have tried, which all work in
3.2.3 (mingw)
.... and all consistently fail in Linux.

Suggestions?
Directions to definitive documentation?

Many thanks,
Dave D
 
R

Rolf Magnus

Dave said:
GCC 3.3.4 setting Stack and Heap

Help appreciated setting stack (and heap) in GCC in Linux:

It's not gcc, but ld. When you specify arguments like "-Wl,whatever",
"whatever" is passed to the linker.
g++ -Wl,--stack -Wl,10485760 axx1.cpp utils.cpp -Wall -Os -o axxgcc
and all the other variations above give similar to:

/usr/bin/ld: unrecognized option '--stack'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

Did you try "ld --help" or "man ld" to see whether your version of ld
supports those command line options?
I suspect that this is not an issue specific to Knoppix or Debian.

Searching the web yields the results I have tried, which all work in
3.2.3 (mingw)
... and all consistently fail in Linux.

Suggestions?
Directions to definitive documentation?

Btw: this is off-topic here. You should ask in comp.unix.programmer or maybe
in gnu.gcc.help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top