From patchwork Tue Feb 5 08:37:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 218176 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id ACFF42C02A5 for ; Tue, 5 Feb 2013 19:42:49 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360658570; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Cc:Subject:Date:Message-ID:User-Agent: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=luhzL0eTmuXfunFcwRGMa6fiovk=; b=YKVtLTVJ4Nv9ZFp Ud1i9lwn2uZ5xc2l6sdBGQeJMxe1ro8gNfPCwPYkB+NJe9B1WDTPGktzdqd3DXWN 9Dp3cMadgPwAdw02tm9cjWOw8gJMsSvftjTng6JkY6PUx4lwTiNp2Qeh7ldhPkAV XH5j+pkeZN0IUT2rWC8dwLPuHNCc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-ID:User-Agent:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=aOd9nRHwT2XgKXgE7cd/4aJfhuVaveF7La+CkTg0tqGtbr1DAUbhsXzxgbsCSQ pZ3FpmBcHu/xtk5wYYX9j/h1/J+rTSg+dCS7Kk1lWx0c+LyKApEYztGEmaAIdXB9 4xagodo7P2oReaYndgpDTY8M2kYW0Wq6WQDtmVyFibdMo=; Received: (qmail 15909 invoked by alias); 5 Feb 2013 08:42:41 -0000 Received: (qmail 15807 invoked by uid 22791); 5 Feb 2013 08:42:40 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Feb 2013 08:42:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6C221290056; Tue, 5 Feb 2013 09:42:39 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OWC37W-CZdEM; Tue, 5 Feb 2013 09:42:39 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 06454290053; Tue, 5 Feb 2013 09:42:39 +0100 (CET) From: Eric Botcazou To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Dodji Seketeli , Konstantin Serebryany , Dmitry Vyukov Subject: Re: [PATCH] Put -lasan always very early on the ld command line (PR sanitizer/55374) Date: Tue, 05 Feb 2013 09:37:29 +0100 Message-ID: <1537661.SE9S0Nd4UY@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: <20130122165813.GY7269@tucnak.redhat.com> References: <20130122165813.GY7269@tucnak.redhat.com> MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org > 2013-01-22 Jakub Jelinek > > PR sanitizer/55374 > * gcc.c (LIBASAN_SPEC): Define just to ADD_STATIC_LIBASAN_LIBS if > LIBASAN_EARLY_SPEC is defined. > (LIBASAN_EARLY_SPEC): Define to empty string if not already defined. > (LINK_COMMAND_SPEC): Add LIBASAN_EARLY_SPEC for -fsanitize=address, > before %o. > * config/gnu-user.h (LIBASAN_EARLY_SPEC): Define. This has introduced a syntax error for gcc.c when you're building a quick cross-compiler. Fixed by the attached patchlet. Tested on x86_64-suse-linux, OK for the mainline? 2013-02-05 Eric Botcazou PR sanitizer/55374 * config/gnu-user.h (LIBASAN_EARLY_SPEC): Add missing guard. Index: config/gnu-user.h =================================================================== --- config/gnu-user.h (revision 195694) +++ config/gnu-user.h (working copy) @@ -102,10 +102,12 @@ see the files COPYING3 and COPYING.RUNTI it for -shared link, the executable should be compiled with -static-libasan in that case, and for executable link link with --{,no-}whole-archive around it to force everything into the executable. */ +#if defined(HAVE_LD_STATIC_DYNAMIC) #undef LIBASAN_EARLY_SPEC #define LIBASAN_EARLY_SPEC "%{static-libasan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \ LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}" +#endif /* Additional libraries needed by -static-libasan. */ #undef STATIC_LIBASAN_LIBS