From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12819 invoked by alias); 30 Nov 2012 13:55:08 -0000 Received: (qmail 12797 invoked by uid 22791); 30 Nov 2012 13:55:05 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qa0-f47.google.com (HELO mail-qa0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Nov 2012 13:54:56 +0000 Received: by mail-qa0-f47.google.com with SMTP id a19so1331184qad.20 for ; Fri, 30 Nov 2012 05:54:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.185.79 with SMTP id cn15mr3198657qab.14.1354283695198; Fri, 30 Nov 2012 05:54:55 -0800 (PST) Received: by 10.49.12.210 with HTTP; Fri, 30 Nov 2012 05:54:55 -0800 (PST) In-Reply-To: References: <20121129173813.GA31323@intel.com> <20121129174031.GA31369@intel.com> Date: Fri, 30 Nov 2012 14:21:00 -0000 Message-ID: Subject: Re: [PATCH] Filter out -fsanitize=address if not in combined tree in libiberty From: "H.J. Lu" To: Richard Biener Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02546.txt.bz2 On Fri, Nov 30, 2012 at 5:30 AM, Richard Biener wrote: > On Fri, Nov 30, 2012 at 2:17 PM, H.J. Lu wrote: >> On Fri, Nov 30, 2012 at 12:45 AM, Richard Biener >> wrote: >>> On Thu, Nov 29, 2012 at 6:40 PM, H.J. Lu wrote: >>>> Hi, >>>> >>>> When GCC is configured with --with-build-config="bootstrap-asan", all >>>> -flto tests will fail since -fsanitize=address is used to compile host >>>> libiberty, which is used to create liblto_plugin.so, and linker isn't >>>> compiled with -fsanitize=address. This patch filters out >>>> -fsanitize=address from CFLAGS if we aren't in a combined tree with >>>> binutils. OK to install? >>> >>> Why not simply ensure that only host _executables_ are sanitized? >>> >> >> Host libiberty library is used to create both host executables and >> host plugins. We don't have separate host libiberty libraries for them. > > So don't instrument libiberty then. > When you bootstrap, all host libraries are compiled with the same CFLAGS as gcc itself in 3 stages. That means stage2 and stage3 libiberty are compiled with -fsanitize=address if it is added to stage2/stage3 CFLAGS for gcc. My patch filters it out when compiling stage2/stage3 libiberty. -- H.J.