libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MacOS X nested functions in libtool library


From: Bill Northcott
Subject: Re: MacOS X nested functions in libtool library
Date: Mon, 11 Jun 2007 10:34:09 +1000

Thanks for that, but I don't now think this is a libtool problem.

The MacOS linker will only accept -allow-stack-execute if the output file is of type MH_EXECUTE (ie an application not a library). So you cannot build a dylib with stack execute on.

We have a working example of adding code to the library to allow stack execution, but it can't be done with compiler or linker options.

Thanks again
Bill
On 10/06/2007, at 7:01 PM, Ralf Wildenhues wrote:

Hello, and apologies for the delay,

* Bill Northcott wrote on Tue, May 29, 2007 at 09:16:52AM CEST:
On 29/05/2007, at 4:36 PM, Peter O'Gorman wrote:
Adding '-fnested-functions' to the CFLAGS stops the compiler
barfing.  However as per Apple Tech note http://
developer.apple.com/technotes/tn2006/tn2161.html it is also
necessary to add -fnested-functions or an equivalent ld flag to
the compiler link command.  Without this flag, the linker defaults
to disable_stack_execute on i386 and the library crashes at runtime.

Adding -fnested-functions to libfoo_la_LDFLAGS does not work
because libtool strips it out before invoking gcc.

Try passing -Wc,-fnested-functions to GNU libtool.
Or -Xcompiler.

Is there a way around this or an actual fix?

LDFLAGS=-Wl,-allow_stack_execute does not work?

I just sent the message below to the Apple xcode-users list:
[...]

Cheers,
Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]