From patchwork Mon Sep 24 21:40:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Xu X-Patchwork-Id: 186578 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 6D9222C0087 for ; Tue, 25 Sep 2012 07:40:54 +1000 (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=1349127655; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:To:Subject:Message-Id:Date: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=lLzH1j2 dtAvdtXg72fTc5R9jvYs=; b=ps5K6DUaIDfqw929Wg5rII5maPOCBVO6dL4LXfx QYKPkhLrkboaMTKebF2QqY1wjhOJQuLZjJDUgTDubHYmDBfmHAhlspbQmTyI2+nA XDL+HGI7e0n4DXSHPNs4egZmXbjk4QQAVxdTD9HaUofj+Jpirz/pAprvCUHMFk+d +IvA= 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:X-Google-DKIM-Signature:Received:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=sU/+hHaQ0anN3Z6kvU4g1L1tZTAQnYEoN/WpcwsQ/MqQ3eqUJmYTKdmEJbKQm6 +gqBQLFrwcAuEHqQXgmJorYep6Q1IvhkjuChcK0pzo8qUA74FDcbW32jdlJx2tDU U8kh3YT/vOpXH5/p7F1XZcRZC5ytC9ckeASfuY9oe4J1A=; Received: (qmail 10899 invoked by alias); 24 Sep 2012 21:40:51 -0000 Received: (qmail 10891 invoked by uid 22791); 24 Sep 2012 21:40:50 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, URIBL_DBL_REDIR X-Spam-Check-By: sourceware.org Received: from mail-ee0-f73.google.com (HELO mail-ee0-f73.google.com) (74.125.83.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Sep 2012 21:40:37 +0000 Received: by eekc4 with SMTP id c4so64863eek.2 for ; Mon, 24 Sep 2012 14:40:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=hztOPjc/G0ZUHA0hL/NDggVC2AiaMsodycBnmVxgx6A=; b=X/KSbecEd80Iq6N8YFllRd4HJ/OiQTNIOAQEXy5Z+VP/Rd+9DiA8P5SlkkqZ7Jdm7u CnGKW22+gY1x8AbVxVVD+H9s0mWVh7M0QnpUGtrfZHvDA1Bz0ur1KC3/O9YdR00wBt+O ZwXc9saX6HMoeh3mgzXPR0TjVyt032eV2ycOaWsuRvSgNIJgn8voCPDobFIf1QWa1Zhu jZKgdEKl9dJZBCm/O7dHXL3R8GcIrPLMFEFkzPHJCAIlF1usLM/RHKteGWF/oLPyRONG AnpZEh7TzWe9b/Rk+V36WJKeFQFn8NrWOvwhGAHPDwjIMSyeiXlI75cFh3mfZfXraGNT iUCw== Received: by 10.180.73.173 with SMTP id m13mr1720106wiv.4.1348522835824; Mon, 24 Sep 2012 14:40:35 -0700 (PDT) Received: by 10.180.73.173 with SMTP id m13mr1720103wiv.4.1348522835775; Mon, 24 Sep 2012 14:40:35 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id fb20si807815wid.3.2012.09.24.14.40.35 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 24 Sep 2012 14:40:35 -0700 (PDT) Received: from rong2.dls.corp.google.com (rong2.dls.corp.google.com [172.25.4.203]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 5D9F7200076; Mon, 24 Sep 2012 14:40:35 -0700 (PDT) Received: by rong2.dls.corp.google.com (Postfix, from userid 104659) id 4F23B55CAA; Mon, 24 Sep 2012 14:40:34 -0700 (PDT) To: reply@codereview.appspotmail.com, davidxl@google.com, gcc-patches@gcc.gnu.org Subject: [google 4.7] fix unsatified symbols in lipo-use (issue6562044) Message-Id: <20120924214034.4F23B55CAA@rong2.dls.corp.google.com> Date: Mon, 24 Sep 2012 14:40:34 -0700 (PDT) From: xur@google.com (Rong Xu) X-Gm-Message-State: ALoCoQk4zqfERC3GTmmmGCIVjB7VR0fQVsUOSytvYHi34h25xPwQoDo324/VG4DdadLBa3MNRbPj1XJpLyeTRMGpnHqTtgloGIYE8NrNS4jrlb/tu97ObUfL248p32rXnrh37b8EEX1g45Ou5iT/ZLKR0qLrNpvFmlT/YghJpz0idLUNSDquEBYlVEtjBM68xn7R9s9OoQMD X-IsSubscribed: yes 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 Hi, This patch is for google branches only. It fixes the unsatified symbol in lipo-use build. Tested with SPEC and google internal benchmarks. Thanks, -Rong 2012-09-24 Rong Xu * gcc/l-ipo.c (cgraph_is_aux_decl_external): output comdat virtual functions when they are auxiliary modules; otherwise we may get undefined symbol in linking. Google ref b/7078882. --- This patch is available for review at http://codereview.appspot.com/6562044 Index: gcc/l-ipo.c =================================================================== --- gcc/l-ipo.c (revision 191679) +++ gcc/l-ipo.c (working copy) @@ -1111,16 +1111,16 @@ if (node->is_versioned_clone) return false; - /* virtual functions won't be deleted in the primary module. */ - if (DECL_VIRTUAL_P (decl)) - return true; - /* Comdat or weak functions in aux modules are not external -- there is no guarantee that the definitition will be emitted in the primary compilation of this auxiliary module. */ if (DECL_COMDAT (decl) || DECL_WEAK (decl)) return false; + /* virtual functions won't be deleted in the primary module. */ + if (DECL_VIRTUAL_P (decl)) + return true; + if (!TREE_PUBLIC (decl)) return false;