From patchwork Thu Mar 1 19:35:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RG91ZyBLd2FuICjpl5zmjK/lvrcp?= X-Patchwork-Id: 144105 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 699CE1007D5 for ; Fri, 2 Mar 2012 06:36:17 +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=1331235378; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF:Received:Received:MIME-Version: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=JAshEC0Cm2dOtJ/1nhhwERW4c0w=; b=xfL9Fet/PqP6Aa5iYXh2FaqBIXxBlCi7ZUIRfDhZnX9T0d0O9tD/5ngCrRfxx2 uGSdTxxoUIr/ocl/RqQ+7IqPeBuYw5WaNzbo+zIv6iXnwvCxKeDLsRRM0pAABLdV 60HgSGIEXn6ER2S3vlOAxnhHe2YrPO4goYSZRP+F1FWY0= 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-SPF:Authentication-Results:Received:Received:MIME-Version: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=gDzNZBy89cDQ4oXGiUf40ntuJWKclsWx4yAPi7/iuDL4nen4BBV1ENmG9FKD5F BwbCHsd8/TXdFlSR2bgSK3rWl5+79LftipxrN4HMDO8bz5grwYbXlOm1Fuxcbk8Y IfyVMm0aH1/TXyjk76PhTXI3nK9vqvg7b2YUStVRJjnKA=; Received: (qmail 21033 invoked by alias); 1 Mar 2012 19:36:11 -0000 Received: (qmail 20829 invoked by uid 22791); 1 Mar 2012 19:36:09 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, TW_GR, T_RP_MATCHES_RCVD 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; Thu, 01 Mar 2012 19:35:55 +0000 Received: by eeit10 with SMTP id t10so34591eei.2 for ; Thu, 01 Mar 2012 11:35:53 -0800 (PST) Received-SPF: pass (google.com: domain of dougkwan@google.com designates 10.14.203.68 as permitted sender) client-ip=10.14.203.68; Authentication-Results: mr.google.com; spf=pass (google.com: domain of dougkwan@google.com designates 10.14.203.68 as permitted sender) smtp.mail=dougkwan@google.com; dkim=pass header.i=dougkwan@google.com Received: from mr.google.com ([10.14.203.68]) by 10.14.203.68 with SMTP id e44mr3345792eeo.3.1330630553954 (num_hops = 1); Thu, 01 Mar 2012 11:35:53 -0800 (PST) Received: by 10.14.203.68 with SMTP id e44mr2955070eeo.3.1330630553944; Thu, 01 Mar 2012 11:35:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.203.68 with SMTP id e44mr2955054eeo.3.1330630553847; Thu, 01 Mar 2012 11:35:53 -0800 (PST) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id y56si1983667eea.1.2012.03.01.11.35.53 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 01 Mar 2012 11:35:53 -0800 (PST) Received: from atree.mtv.corp.google.com (atree.mtv.corp.google.com [172.18.110.18]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 7F3675C0050; Thu, 1 Mar 2012 11:35:53 -0800 (PST) Received: by atree.mtv.corp.google.com (Postfix, from userid 51281) id B59302105E; Thu, 1 Mar 2012 11:35:52 -0800 (PST) To: reply@codereview.appspotmail.com, dnovillo@google.com, gcc-patches@gcc.gnu.org Subject: [google/4.6]Backport r184370 from integration (issue5716054) Message-Id: <20120301193552.B59302105E@atree.mtv.corp.google.com> Date: Thu, 1 Mar 2012 11:35:52 -0800 (PST) From: dougkwan@google.com (Doug Kwan) X-Gm-Message-State: ALoCoQmX6u3Ho0hLkaV56dckKJaK4jdpJTnSUeJZ0AxvNS7kJxiOfeZn7dji+g21eT8F7gsH5vPzaZ9BetQEEoEg5tI+ySqNzvM24N9bPAh5o5a8U3LibycnHdpzPtY7Rspr6AzQabjD4hy16YTwXPJKdsY+tqyPeE5kmPmzY/q/OPdwOhumQ7k= 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 Diego, This is a backport of r184370 from integration branch. I have tested this by building it for different configurations of powerpc. -Doug 2012-03-01 Doug Kwan Backport r184370 from integration branch. 2012-02-17 Doug Kwan * gcc/config.gcc (powerpc*-*-linux): Pull in GRTEv2 spec changes if target matches *-grtev2-*. * gcc/config/rs6000/linux64.h (GLIB_DYNAMIC_LINKER{32,64}): Add runtime root prefix to glibc's dynamic linker. * gcc/config/rs6000/linux-grtev2.h: New file. * gcc/config/rs6000/sysv4.h (GLIB_DYNAMIC_LINKER): Add runtime root prefix to glibc's dynamic linker. (LINUX_GRTE_EXTRA_SPECS): Define to be empty if no definition found. (SUBTARGET_EXTRA_SPECS): Include LINUX_GRTE_EXTRA_SPECS. --- This patch is available for review at http://codereview.appspot.com/5716054 Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 184683) +++ gcc/config.gcc (working copy) @@ -2198,6 +2198,12 @@ powerpc-*-linux* | powerpc64-*-linux*) if test x${enable_secureplt} = xyes; then tm_file="rs6000/secureplt.h ${tm_file}" fi + # Pull in spec changes for GRTEv2 configurations. + case ${target} in + *-grtev2-*) + tm_file="${tm_file} rs6000/linux-grtev2.h" + ;; + esac ;; powerpc64-*-gnu*) tm_file="${tm_file} elfos.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/default64.h rs6000/linux64.h rs6000/gnu.h glibc-stdint.h" Index: gcc/config/rs6000/linux64.h =================================================================== --- gcc/config/rs6000/linux64.h (revision 184683) +++ gcc/config/rs6000/linux64.h (working copy) @@ -372,8 +372,8 @@ extern int dot_symbols; #undef LINK_OS_DEFAULT_SPEC #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" -#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" -#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" +#define GLIBC_DYNAMIC_LINKER32 RUNTIME_ROOT_PREFIX "/lib/ld.so.1" +#define GLIBC_DYNAMIC_LINKER64 RUNTIME_ROOT_PREFIX "/lib64/ld64.so.1" #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" #if DEFAULT_LIBC == LIBC_UCLIBC Index: gcc/config/rs6000/linux-grtev2.h =================================================================== --- gcc/config/rs6000/linux-grtev2.h (revision 0) +++ gcc/config/rs6000/linux-grtev2.h (revision 0) @@ -0,0 +1,43 @@ +/* Definitions for Linux-based GRTE (Google RunTime Environment) version 2. + Copyright (C) 2009,2010,2011,2012 Free Software Foundation, Inc. + Contributed by Chris Demetriou and Ollie Wild. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +/* Overrides LIB_LINUX_SPEC from sysv4.h. */ +#undef LIB_LINUX_SPEC +#define LIB_LINUX_SPEC \ + "%{pthread:-lpthread} \ + %{shared:-lc} \ + %{!shared:%{mieee-fp:-lieee} %{profile:%(libc_p)}%{!profile:%(libc)}}" + +/* When GRTE links statically, it needs its NSS and resolver libraries + linked in as well. Note that when linking statically, these are + enclosed in a group by LINK_GCC_C_SEQUENCE_SPEC. */ +#undef LINUX_GRTE_EXTRA_SPECS +#define LINUX_GRTE_EXTRA_SPECS \ + { "libc", "%{static:%(libc_static);:-lc}" }, \ + { "libc_p", "%{static:%(libc_p_static);:-lc_p}" }, \ + { "libc_static", \ + "-lc -lnss_borg -lnss_cache -lnss_dns -lnss_files -lresolv" }, \ + { "libc_p_static", \ + "-lc_p -lnss_borg_p -lnss_cache_p -lnss_dns_p -lnss_files_p -lresolv_p" }, Index: gcc/config/rs6000/sysv4.h =================================================================== --- gcc/config/rs6000/sysv4.h (revision 184683) +++ gcc/config/rs6000/sysv4.h (working copy) @@ -818,7 +818,10 @@ extern int fixuplabelno; #define LINK_START_LINUX_SPEC "" -#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" +#ifndef RUNTIME_ROOT_PREFIX +#define RUNTIME_ROOT_PREFIX "" +#endif +#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld.so.1" #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" #if DEFAULT_LIBC == LIBC_UCLIBC #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" @@ -921,6 +924,11 @@ ncrtn.o%s" #define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" #endif +/* These may be provided by rs6000/linux-grtev2.h. */ +#ifndef LINUX_GRTE_EXTRA_SPECS +#define LINUX_GRTE_EXTRA_SPECS +#endif + /* Define any extra SPECS that the compiler needs to generate. */ /* Override rs6000.h definition. */ #undef SUBTARGET_EXTRA_SPECS @@ -995,6 +1003,7 @@ ncrtn.o%s" { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \ { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \ { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }, \ + LINUX_GRTE_EXTRA_SPECS \ SUBSUBTARGET_EXTRA_SPECS #define SUBSUBTARGET_EXTRA_SPECS