473,408 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

GCC 3.3.4 setting Stack and Heap

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
Jul 22 '05 #1
1 2559
Dave Dons wrote:
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.
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Kevin Grigorenko | last post by:
Hello, I couldn't find an obvious answer to this in the FAQ. My basic question, is: Is there any difference in allocating on the heap versus the stack? If heap or stack implementation is not...
17
by: Jonas Rundberg | last post by:
Hi I just started with c++ and I'm a little bit confused where stuff go... Assume we have a class: class test { private: int arr; };
1
by: Geiregat Jonas | last post by:
I'm reading Eric Gunnerson's book. He is talking about the heap and stack, he says you have 2types, value wich are in the stack or inline or reference types wich are in the heap. I don't get...
2
by: Nick McCamy | last post by:
I have a question related to allocating on the stack. In this program below, are my following assumptions true? - variable a is allocated on the heap since it's static - variable b is...
3
by: nahur | last post by:
why do you need a heap and a stack why not all memory called a heap or call it a stack what is the purpose of having a heap and a stack
9
by: shine | last post by:
what is the difference between a heap and a stack?
24
by: arcticool | last post by:
I had an interview today and I got destroyed :( The question was why have a stack and a heap? I could answer all the practical stuff like value types live on the stack, enums are on the stack, as...
16
by: sarathy | last post by:
Hi all, I need a few clarifications regarding memory allocaion in C++. I apologize for the lengthy explanation. 1. In C++, Objects are allocated in heap. What does heap refer to? Is it an area...
9
by: Roman Mashak | last post by:
Hello, I'm confused about heap and stack memories management in C language. Most books explain that local stack variables for each function are automatically allocated when function starts and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.