From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E0E5D386EC42 for ; Wed, 7 Apr 2021 11:38:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0E5D386EC42 Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 92CC5335D91; Wed, 7 Apr 2021 11:38:21 +0000 (UTC) Date: Wed, 7 Apr 2021 07:38:20 -0400 From: Mike Frysinger To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] sim/m32c: fix memory leaks in opc2c Message-ID: Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org References: <20210405145856.3925296-1-simon.marchi@polymtl.ca> <13aff427-e308-33cb-0aed-4b4285c52df6@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <13aff427-e308-33cb-0aed-4b4285c52df6@polymtl.ca> X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 11:38:24 -0000 On 06 Apr 2021 21:45, Simon Marchi via Gdb-patches wrote: > > i'm not keen on pushing it in this direction exactly. it would mean every > > caller would have to update & keep track. > > > > i think you could define an IGEN variable in common/Make-common.in and change > > all callers over to that. then that would be the only place you'd have to add > > any sanitizer related variables to. > > I can do that, but I'm not sure where in common/Make-common.in I should > add the variable. There seems to be a logic to the organization in that > file, but I don't get it. *shrug* there isn't much to it. you can put it after the POSTCOMPILE= line. > Also, not that ppc has its own igen, so I > guess it will still use its own definition. correct, for now, it's duplicated and we eat that cost > Another option is to just factor out the env var: > > DISABLE_LSAN = ASAN_OPTIONS=detect_leaks=0 > > ... and still use it in rules: > > target: source > $(DISABLE_LSAN) ../igen/igen --blah i'm not keen on doing sanitizer-specific vars. there's ASAN, LSAN, TSAN, UBSAN, KSAN, and prob more in the future. that's why having a common IGEN var and then having it use a generic name (SANITIZE_ENV?) would work best imo. > Side-note, I saw some `@GMAKE_TRUE@` in Make-common.in. In GDB, we > decided to require GNU make and remove that complexity, in case you want > to do the same. sim/ is changing to automake, so a lot of that stuff will go away entirely. i'm focusing on that rather than chipping away at smaller bits. you can see this with the igen/ dir: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b6b1c790843087e67e85e7cfd3327a872c03c6bc although i need to do more groundwork in the C side first. -mike