From patchwork Thu Sep 13 16:45:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Shen X-Patchwork-Id: 183681 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 2D3FE2C0089 for ; Fri, 14 Sep 2012 02:46:18 +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=1348159579; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=zoQlAfs 2HqEpzB4chy4GfAS4xXQ=; b=pqFHajl8YphWKAWFJFcNBAr9cGPyXAH33Y4T/BV 8MMzVReWxgQXHUEEmGmwq8Zah1zbN2J2q4SN/kTCq8sjXdXzwJ9N/qFH1CEPXw7i lEG1HqomCh8L+feAFC8ZmEPHUdhAdNqkHLgrfpgJNm615hWxR/MvhE3UH3FIcHxT Z41I= 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:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-System-Of-Record:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=W81AYlpPeLnfewojr2Z9Ky7y7xYwCUhPqcYQswu6tI8VInPxMiENLbxtHSX7g5 g7czDSJOVM5AgePnQeswPTtN5iETBvM4+pNE+EonOx7p8WlyBlVxBlWz4dAi0lR1 oAdp4Y5aeNKQo4UVLEvsNJnuRwYNkkOv843GJh7r4c230=; Received: (qmail 15710 invoked by alias); 13 Sep 2012 16:46:12 -0000 Received: (qmail 15694 invoked by uid 22791); 13 Sep 2012 16:46:10 -0000 X-SWARE-Spam-Status: No, hits=-4.4 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 X-Spam-Check-By: sourceware.org Received: from mail-vb0-f47.google.com (HELO mail-vb0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Sep 2012 16:45:57 +0000 Received: by vbbez10 with SMTP id ez10so4087261vbb.20 for ; Thu, 13 Sep 2012 09:45:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-system-of-record:x-gm-message-state; bh=JUEF1Vjnle46EMhSiMRQ9DXt31c+cCrO8ie0y8TY2mA=; b=KyDBqB6Ijpyyd3fhqC4soow92gXGGD/VfHE85Tc3f0sHR/2BYMM6VC2ZNyW3R3MclP ZcreR8upuZT8ITVwld9lgM5Bh9StgyTOA79kTMzPyqQa07UflCyVsfNAJvhP69pJ0nPu 8m17PbIJiwh4QzzfkU+9zP96u101S+SVAfWJgNGVRPrfLaIX65qggoNB6qqBHPYd/F0G EWzyHjitxx5IMp5KWXUefWhzwW9r5T25XubMihPVrjJJNc15XtdmSeIrl+wNy6FAx1sg /la3Dyy2AzXuYfYNa1ZKySUkyLRJMRZj+QpHZ+WeQi7CBLUZtTWK4DmKge1Ia60y6LSc 0q6w== Received: by 10.52.174.72 with SMTP id bq8mr1387852vdc.65.1347554756149; Thu, 13 Sep 2012 09:45:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.174.72 with SMTP id bq8mr1387841vdc.65.1347554755975; Thu, 13 Sep 2012 09:45:55 -0700 (PDT) Received: by 10.220.79.66 with HTTP; Thu, 13 Sep 2012 09:45:55 -0700 (PDT) Date: Thu, 13 Sep 2012 09:45:55 -0700 Message-ID: Subject: [google/main] Fix regression - SUBTARGET_EXTRA_SPECS overridden by LINUX_GRTE_EXTRA_SPECS From: =?UTF-8?B?SGFuIFNoZW4o5rKI5ra1KQ==?= To: Jing Yu , gcc-patches@gcc.gnu.org, Ahmad Sharif , Luis Lozano X-System-Of-Record: true X-Gm-Message-State: ALoCoQmmb8/awffVs4hReSoEe40zuD5cb9KKYtjCzajli/1ne2FFe1/YvaKncSMn2CeC88xShu5QcsF7I1XhD1tQ0K/qxyFOXi91jDJUg/V6mlR6sslvTXHUeKQYHd9NknMC2DpDwzjtMHwTbjSsAuxiNKiPsCKLnFKx470IZHoj3a8BD/GARkC4K+LDawGLzXUV06sn7LBg 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, the google/gcc-main fails to linking anything (on x86-generic chromeos). By looking into specs file, it seems that 'link_emulation' section is missing in specs. The problem is in config/i386/linux.h, SUBTARGET_EXTRA_SPECS (which is not empty for chrome x86-generic) is overridden by "LINUX_GRTE_EXTRA_SPECS". My fix is to prepend LINUX_GRTE_EXTRA_SPECS to SUBTARGET_EXTRA_SPECS in linux.h This fix was submitted to google/gcc-4_7 and had gone thorough tests for past weeks. Tested by crosstool-validate.py --crosstool_ver=v16 --gcc_dir=`pwd` --testers=crosstool Jing, could you take a look at this? --- Han Shen 2012-09-13 Han Shen * gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS): Compute new value of LINUX_GRTE_EXTRA_SPECS by pre-pending LINUX_GRTE_EXTRA_SPECS to its origin value. * gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS_STR): Add new MACRO to hold value of SUBTARET_EXTRA_SPECS so that SUBTARET_EXTRA_SPECS could be replaced later in gnu-user.h diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h index 98d0a25..ba120b8 100644 --- a/gcc/config/i386/gnu-user.h +++ b/gcc/config/i386/gnu-user.h @@ -92,10 +92,12 @@ along with GCC; see the file COPYING3. If not see #define ASM_SPEC \ "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}" -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ +#undef SUBTARGET_EXTRA_SPECS_STR +#define SUBTARGET_EXTRA_SPECS_STR \ { "link_emulation", GNU_USER_LINK_EMULATION },\ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER } +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS SUBTARGET_EXTRA_SPECS_STR #undef LINK_SPEC #define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index ade524c..61d5c68 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -32,5 +32,11 @@ along with GCC; see the file COPYING3. If not see #endif #undef SUBTARGET_EXTRA_SPECS +#ifndef SUBTARGET_EXTRA_SPECS_STR #define SUBTARGET_EXTRA_SPECS \ LINUX_GRTE_EXTRA_SPECS +#else +#define SUBTARGET_EXTRA_SPECS \ + LINUX_GRTE_EXTRA_SPECS \ + SUBTARGET_EXTRA_SPECS_STR +#endif