From patchwork Mon Aug 25 07:04:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: max X-Patchwork-Id: 382640 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 30C151400AB for ; Mon, 25 Aug 2014 17:05:13 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=j0O6FQpBIbSC7+yrprRbismNUit7cRyfTh01LDZvtm2 V0v21b83lB0OA5tBfAScGPgctaEYtroqurFFWyiSUuJ9yqDY44gMK6zIIEm+rnOL 2lSoZbu3Ps87PwTAHVMDbmxopSH1SdslrQC6DtNaRfxvzndHmzKnqXkqvg6tfGR0 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=HorTsmuJoz4n0ElaIAhVdnspxO4=; b=UQkL2XOlqRuzldwdB XZKEqvQI+EbwXVuSc3Dltn0rQXVwx209CY/2D7YRDwYJlnKoPYMiLrFJ9PpomeXW Ce2ljX6ErVb1qVerF27jQoBPkx69Qy25hAOStC0BCHwVIWvl3lAZDVPXfEZSu0UZ XrQyprzqWMADLdKLsgNbGrTlk4= Received: (qmail 18887 invoked by alias); 25 Aug 2014 07:05:02 -0000 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 Received: (qmail 18858 invoked by uid 89); 25 Aug 2014 07:04:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, T_HDRS_LCASE, T_MANY_HDRS_LCASE autolearn=ham version=3.3.2 X-HELO: mailout3.w1.samsung.com Received: from mailout3.w1.samsung.com (HELO mailout3.w1.samsung.com) (210.118.77.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Mon, 25 Aug 2014 07:04:55 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAU00FJFP4TWH70@mailout3.w1.samsung.com> for gcc-patches@gcc.gnu.org; Mon, 25 Aug 2014 08:07:41 +0100 (BST) Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 80.49.25543.210EAF35; Mon, 25 Aug 2014 08:04:50 +0100 (BST) Received: from [106.109.130.31] by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NAU00COZP00JJ40@eusync1.samsung.com>; Mon, 25 Aug 2014 08:04:50 +0100 (BST) Message-id: <53FAE010.30604@partner.samsung.com> Date: Mon, 25 Aug 2014 11:04:48 +0400 From: Maxim Ostapenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-version: 1.0 To: GCC Patches Cc: Yury Gribov , Slava Garbuzov Subject: [PATCH] Fix libbacktrace and libiberty tests fail on sanitized GCC due to wrong link options. Content-type: multipart/mixed; boundary=------------090905040702010600060103 X-IsSubscribed: yes Hi, When I ran Asan tests under Asan-bootstrapped GCC 5.0, I've noted, that tests for libiberty and libbacktrace fail to link with sanitized libbacktrace.a and libiberty.a because of missing -static-libasan -fsanitize=address linker flags. This patch adds necessary flags to provide a linkage of these tests in bootstrap-asan case. I've checked that regression tests pass with disabled bootstrap, normal bootstrap (stage1, stage3) and Asan-bootstrap (stage 1, stage3) on x86_64-pc-linux-gnu. Does the patch look sane? -Maxim libiberty/ChangeLog: 2014-08-25 Max Ostapenko * testsuite/Makefile.in(LIBCFLAGS): Add LDFLAGS. ChangeLog: 2014-08-25 Max Ostapenko * Makefile.in (EXTRA_HOST_EXPORTS): New variables. (EXTRA_BOOTSTRAP_FLAGS): Likewise. (check-libiberty): Add EXTRA_HOST_EXPORTS and EXTRA_BOOTSTRAP_FLAGS. (check-libbacktrace): Likewise. diff --git a/Makefile.in b/Makefile.in index add8cf6..93d48b8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20541,8 +20541,9 @@ check-libbacktrace: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ + $(EXTRA_HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libbacktrace && \ - $(MAKE) $(FLAGS_TO_PASS) check) + $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_BOOTSTRAP_FLAGS) check) @endif libbacktrace @@ -23597,6 +23598,13 @@ clean-stagefeedback-libiberty: @endif libiberty-bootstrap +@if gcc-bootstrap +EXTRA_HOST_EXPORTS = if [ $(current_stage) != stage1 ]; then \ + $(POSTSTAGE1_HOST_EXPORTS) \ + fi ; + +EXTRA_BOOTSTRAP_FLAGS = CC="$$CC" CXX="$$CXX" LDFLAGS="$$LDFLAGS" +@endif gcc-bootstrap @@ -23610,8 +23618,9 @@ check-libiberty: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ + $(EXTRA_HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) check) + $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_BOOTSTRAP_FLAGS) check) @endif libiberty diff --git a/libiberty/testsuite/Makefile.in b/libiberty/testsuite/Makefile.in index d23c09c..ef693c2 100644 --- a/libiberty/testsuite/Makefile.in +++ b/libiberty/testsuite/Makefile.in @@ -33,7 +33,7 @@ SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ -LIBCFLAGS = $(CFLAGS) +LIBCFLAGS = $(CFLAGS) $(LDFLAGS) # Multilib support variables. MULTISRCTOP =