[PATCH] Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD

Dmitry V. Levin ldv at altlinux.org
Wed Dec 7 21:39:39 UTC 2016


Hi Thomas,

On Wed, Dec 07, 2016 at 09:32:20PM +0100, Thomas De Schampheleire wrote:
> On Wed, Dec 7, 2016 at 4:18 PM, Dmitry V. Levin wrote:
> > On Wed, Dec 07, 2016 at 02:58:35PM +0300, Dmitry V. Levin wrote:
> >> On Tue, Dec 06, 2016 at 09:06:08PM +0100, Thomas De Schampheleire wrote:
> >> > On Wed, Nov 16, 2016 at 8:27 PM, Dmitry V. Levin wrote:
> >> [...]
> >> > > The correct fix is going to be more complex, e.g.
> >> > > - move all gl_WARN_ADD/WARN_CFLAGS related code from configure.ac to a
> >> > >   separate m4 macro, say st_WARN_CFLAGS;
> >> > > - call st_WARN_CFLAGS in configure.ac;
> >> > > - modify AX_PROG_CC_FOR_BUILD to
> >> > >   + pushdef WARN_CFLAGS to WARN_CFLAGS_FOR_BUILD,
> >> > >   + call st_WARN_CFLAGS,
> >> > >   + popdef WARN_CFLAGS back,
> >> > >   + AC_SUBST WARN_CFLAGS_FOR_BUILD;
> >> > > - add WARN_CFLAGS_FOR_BUILD to AM_CFLAGS_FOR_BUILD.
> >> >
> >> > Thanks for the suggestion.
> >> > I tried implementing it but got stuck. What I observe is that the
> >> > second invocation of ST_WARN_CFLAGS is using cached results, which
> >> > should not happen because the compiler can be different. Looking at
> >> > the definition of gl_WARN_ADD, I think that the cache_id of the
> >> > AC_CACHE_CHECK call in gl_COMPILER_OPTION_IF should contain CC or a
> >> > similar variable, so that caching does not happen.
> >> >
> >> > I'm sending what I have for now below.
> >>
> >> Yes, it appeared to be even more complicated than I expected.
> >> I've pushed a tentative fix to
> >> https://github.com/strace/strace/commits/ldv/WARN_CFLAGS_FOR_BUILD
> >> Please give it a try.
> >>
> >> I'm not quite happy with the change I made in m4/warnings.m4, though.
> >> The change of gl_Flags is just an ad hoc solution, and the tearing
> >> gl_UNKNOWN_WARNINGS_ARE_ERRORS off gl_WARN_ADD is not something
> >> I'd like to accept on gnulib side.
> >
> > I've pushed there a less hackish change to m4/warnings.m4; if the whole
> > thing works for you, I'm fine with pushing it on to master.
> 
> I tested commit 045228095418e2cc1469021ffa46cc9d7faa6f02 in the
> failure case and confirm that it works fine now: the configure script
> takes two passes for the warning flags, and sees that the host
> compiler gcc 4.1 does not respect the flags, while the more recent
> target compiler does.

Thanks, pushed to master.

> That commit was the last version, right?

Yes.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20161208/9a08d133/attachment.bin>


More information about the Strace-devel mailing list