From mint-bounce@lists.fishpool.fi  Sun Apr 11 12:02:43 2010
X-Virus-Scanned: amavisd-new at demon.co.uk
Subject: Re: [MiNT] binutils ld enhancement ?
From: Alan Hourihane <alanh@fairlite.co.uk>
To: Vincent =?ISO-8859-1?Q?Rivi=E8re?= <vincent.riviere@freesbee.fr>
Cc: mint@lists.fishpool.fi
In-Reply-To: <4BC1948B.9020704@freesbee.fr>
References: <1270933424.10459.3.camel@jetpack.demon.co.uk>
	 <4BC1948B.9020704@freesbee.fr>
Content-Type: text/plain; charset="ISO-8859-1"
Date: Sun, 11 Apr 2010 16:59:55 +0100
Message-Id: <1271001595.16679.1.camel@jetpack.demon.co.uk>
Mime-Version: 1.0
X-Mailer: Evolution 2.26.3 
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: alanh@fairlite.co.uk
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id o3BG2hXS022286

On Sun, 2010-04-11 at 11:21 +0200, Vincent Rivière wrote:
> Alan Hourihane wrote:
> > Now, I know we have the --stack option to the linker, but that means
> > modifying the build files to add that and it's non-portable. So I'm
> > wondering if 'ld' can read this value from some pre-configured place,
> > like an /etc/xxx file or maybe /proc/xxx to find out what the current
> > stack size should be set to on compilations which would mean no changes
> > to the build files ? What do you think ?
> 
> I understand the problem. When building MiNT software, setting a correct 
> stack size is an absolute requirement. And the standard makefiles are not 
> aware of that. I guess this is especially a problem for Gentoo, where 
> standard source packages should be downloaded and compiled transparently.
> 
> However, I don't know the best way to do that. Certainly, as you proposed in 
> your other message, a specific environment variable used by the linker would 
> be simple and efficient. But it would be very nonstandard. Maybe the 
> binutils has some way to provide default options, I don't know.
> Or maybe Gentoo is flexible enough to customize makefiles ?
> Or maybe configure, with something like the file config.site ?
> 
> My feeling is that we should see how this kind of problem is solved on other 
> platforms before adding a new functionality inside the linker.

Which other platforms have our stack issues ?

It's not really new functionality either. It's just setting the --stack
option but from an ENV var instead.

> > Also, the ld --help output says that stack is set by --stack<size>
> > where it should say "--stack=<size', i.e. it's missing the equal.
> 
> Oh, I didn't notice, but both syntaxes work.
> In the --help message, I have used the same syntax as the --stack option 
> specific to the Win32 linker, described in "man ld".

For me, -Wl,--stack 512k did not work, I had to use -Wl,--stack=512k

> So I think it is correct like this (but the usage of = should be consistent 
> among all options).

Alan.


