From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by sourceware.org (Postfix) with ESMTPS id 221D83858D39 for ; Thu, 21 Oct 2021 10:48:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 221D83858D39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M9ZRc-1maDq62aVI-005ZOx for ; Thu, 21 Oct 2021 12:48:38 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 0CF88A810A5; Thu, 21 Oct 2021 12:48:38 +0200 (CEST) Date: Thu, 21 Oct 2021 12:48:38 +0200 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: automake issue Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <620fad2f-74b0-4a39-45e0-bb2acc00129e@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <620fad2f-74b0-4a39-45e0-bb2acc00129e@cornell.edu> X-Provags-ID: V03:K1:Wdn+UDi+i+HA3GUrC79z461fp2MoVbEmzfpCK9hyPS5p2WfCtJi wwASIIu8uzz7N/+lh3TDUhZVkub80eRK/jZlVzja3Cp72t4XiBUwJKnGxOivUqiYikUz/Lq bLM83KQnE+xMqD860VjtYgaZA/KlNq5MPqB2L4cDHG+VZUqj41OkXfNLkaZLVCS3rDfx1GE Y/P3X1P+ZVCBTv8ASuoqQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:fPL5JYPs3aA=:uEmy4v0J3e/EdLsgcGc15S nXv/rOvK77WXSFn/YkYqmkd1giRfJrxoBipquXra3075Z1MNnpa97ixrWoL+cyUUp5KD7YdZB P7BN9dLMwSwUDfvLAV77AZi8NtqrUmwAtLpt1YKRfB1FxQ7Qz1gnU3Tql6JJc4q88V/lzdk1C 5remZkPE6vxgmxbyq0fg1GUxLmPaC9nNbTUesF4PJny+7u+xIYsh8pD8mkAR3ORi4Lx0fXOkZ 3xyvkC0XxWk2nuImc2MC9GeNquJqL66JytGovf35g3kWmzPDA6w81uutGtOMYfAWLclUGjLhr QjfAYvcZhfLW+O7pfH0sQXYmVFogusm1qQ8OqWIn14tGQDAYHTueNcI+hO2iYDVIaM02Z9Qxu IYfHBRlCKYdhXcHBEKXl86RfjrOaH80uBq2L7LkqX8ASgRQYxOIVd4JhG7lNVwP4o2kDmZiPv hAhSQMjeNJaYmRSY4wCUNtaRXARBfOWyc2ettWQW5LitXfkpNjNWtpXcOe5UUlB31zsCbhWpM OXFD7PEK0Ff78IHXauyYBMgE0Nfo1j3+OnFY0FBO6fklAsOOv0Va03R/zR0UzMAaJxtS+yUwN HAJkKt2glnXWnRzhIh9gQLebzLFCUR1BtGu5dtfbz09v/ae7Tw0XvpIRC8PU0AHqDbVV3EYzj iTn8MZ2VA0cgs7QnSYq2upKcn94nZpcPG74WostmrUoXrnUhVaug1O2JkP2xYwcvScoMDoSMs tSudUJgSYZLI0js8 X-Spam-Status: No, score=-99.5 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2021 10:48:42 -0000 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