public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-developers@cygwin.com
Subject: Re: automake issue
Date: Thu, 21 Oct 2021 12:48:38 +0200	[thread overview]
Message-ID: <YXFFhhCCKguP6i7u@calimero.vinschen.de> (raw)
In-Reply-To: <620fad2f-74b0-4a39-45e0-bb2acc00129e@cornell.edu>

On Oct 20 16:58, Ken Brown wrote:
> I was debugging with what I thought was an unoptimized build of cygwin1.dll
> (with -O0 in CXXFLAGS), but then I discovered that malloc.cc was actually
> compiled with -O3.  This is because of the following snippet from
> winsup/cygwin/Makefile.am:
> 
> # If an optimization level is explicitly set in CXXFLAGS, set -O3 for these files
> # XXX: this seems to assume it's not -O0?
> #
> # (the indentation here prevents automake trying to process this as an automake
> # conditional)
>  ifneq "${filter -O%,$(CXXFLAGS)}" ""
>   malloc_CFLAGS=-O3
>   sync_CFLAGS=-O3
>  endif
> 
> I thought I could fix this by changing the snippet to
> 
>  ifneq "${filter -O%,$(CXXFLAGS)}" ""
>   ifeq "${filter -O0,$(CXXFLAGS)}" ""
>    malloc_CFLAGS=-O3
>    sync_CFLAGS=-O3
>   endif
>  endif
> 
> but this didn't work.  After running winsup/autogen.sh,
> winsup/cygwin/Makefile.in contained
> 
> malloc_CFLAGS = -O3
> sync_CFLAGS = -O3
> 
> unconditionally.
> 
> So in spite of the comment above about indentation, it seems that the
> conditional is being treated as an automake conditional.
> 
> Does anyone know how to fix this so that -O0 really produces an unoptimized build?

I workaround this by setting CFLAGS=-g on the command line.  There's no
-O then and it should work as desired.  The save thing would probably
be something like this, though:

https://stackoverflow.com/questions/4256609/makefile-conditional-with-automake-autoconf


Corinna

  reply	other threads:[~2021-10-21 10:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 20:58 Ken Brown
2021-10-21 10:48 ` Corinna Vinschen [this message]
2021-10-21 13:08   ` Jon Turney
2021-10-21 19:33     ` Ken Brown
2021-10-22  8:44       ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YXFFhhCCKguP6i7u@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-developers@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).