autoconf
[Top][All Lists]
Advanced

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

Re: AC_*/AM_* macros for options


From: Gary V. Vaughan
Subject: Re: AC_*/AM_* macros for options
Date: Tue, 29 Oct 2013 14:06:08 +1300

Hi Jeff,

On Oct 29, 2013, at 12:05 PM, Jeffrey Walton <address@hidden> wrote:

> I'm reading Vaughan, Elliston, Tromey and Taylor's book on Autotools.
> At page 22, they list some macros and begin to explain them. The
> macros are AC_PROG_CC. AM_PROG_LEX, AC_PROG_YACC, and a few others.

Thanks for your interest in the book, but please beware that Autotools
have come a *really* long way since the book was written.

I have a back burner project to update the content, and self-publish a
second edition. I’d be delighted if you emailed me with details of anything
you find that really confounds you, or anything else you think needs
fixing.

> What are the canned macros to specify ASLR (-fPIE/-pie for a program;
> -fPIC/-shared for shared objects)

It’s a private API (per the leading _), but libtool.m4 sets PIC flags
with _LT_COMPILER_PIC, which uses tags to keep track of different
settings for cc/cxx etc.

Even libtool doesn’t deal with PIE flags though.

> Fortified Sources (-DFORTIFY_SOURCE),

You can set that in CPPFLAGS without any problems, though that doesn’t
tell you if it is changing compilation of course.

> Stack Protector (-fstack-protector-all and --param
> ssp-buffer-size), NX Stack (-Wl,-z,noexecstack), NX Heap
> (-Wl,-z,noexecheap), GOT hardening (-Wl,-z,relro), PLT hardening
> (-Wl,-z,now)?
> 
> Related: are there canned macros for warning such as -Wall, -Wextra,
> and -Wconversion?

For these others, there’s another private API in libtool.m4 for checking
whether compiler options work:  _LT_COMPILER_OPTION.

While I wouldn’t recommend relying on internal APIs in your own code, it’s
definitely useful to study the implementation to see how you can do something
similar for your own code.

HTH,
-- 
Gary V. Vaughan (gary AT gnu DOT org)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


reply via email to

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