From patchwork Fri Apr 24 22:08:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 464423 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 044931402DC for ; Sat, 25 Apr 2015 08:09:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=qejuA5iN; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=iTX8Z1940vpL4sMmtdUsB3c7xaevFkl503vMp7rge0NPGx bTGUI6s4rIorQWM0u2YYdJ/kN6WE+oGCUS4TDNr+S8F9s2/1ARrt8ephTBhxZ/pd iK8xXL7sTOJ9wEFVvOhT6+mUsl6p/EMw9szHsD7RKQyjlp0vPEZzhPeYdWEXQ= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=O1h77jZjjgLovB20ivcK++FBeK0=; b=qejuA5iN0txsp/Ll7bqz LWt7ScnSb+mce871+WFsIp74j2lNAh1T/fk8JyY3KNFLv72cHDshge7taTaY0VMh wCCqXT6WugdWP6AY/CcLib2nkJnOIsykfNn7ce6mNQZ3d86dj4OWymKnkfCSl6TR 7c9Ptp86C6zx/DbTLdMQoAY= Received: (qmail 56737 invoked by alias); 24 Apr 2015 22:08:54 -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 56712 invoked by uid 89); 24 Apr 2015 22:08:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f174.google.com Received: from mail-qk0-f174.google.com (HELO mail-qk0-f174.google.com) (209.85.220.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 24 Apr 2015 22:08:52 +0000 Received: by qkgx75 with SMTP id x75so38723395qkg.1 for ; Fri, 24 Apr 2015 15:08:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=vvKPhLGQg1qsPxhqN9JpcshE8YhOPSCahNY1DicXEfs=; b=SJBPdvl137tkFSAebEFx8EF8qtPIuPh133ppCoC55Po/CI1E1lEpCqp2rBqW1qCBeS afe9UQ78MsXZyEYyl4O63kfV3fFsXDGl2DW//lZq6MH7ChWZOUGRXcRCgdV3Hd7nUuSZ OfYW3Em2Lh5d7spb4ZbwcSeAU4Ydlhf44lTnJ9/tBOxBsXPzPqlfUQkmnpIC2xzMaY6Y QXzdB1fBs6WFOFn3SRehjP2eKzVQcwleabXCHdDpjIWSmQXo+PEz/b+w6wnVbxbW6W8M SFL4C6dGvry82pl1AfOY+IHI4E3tZmBLFffsD1so/6MIkZxYvVu9HAH61Li9PN/4ZGhZ HH1A== X-Gm-Message-State: ALoCoQlgDUlMnOINqsR4rEpGxs4sG0w5CtlTkf7VzaVlPAhvbZs+5bjhXfihekdJxpPaxYI+anwc MIME-Version: 1.0 X-Received: by 10.55.24.169 with SMTP id 41mr966695qky.35.1429913330500; Fri, 24 Apr 2015 15:08:50 -0700 (PDT) Received: by 10.96.150.99 with HTTP; Fri, 24 Apr 2015 15:08:50 -0700 (PDT) Date: Fri, 24 Apr 2015 15:08:50 -0700 Message-ID: Subject: libgo patch committed: Compile go-main with -fPIC From: Ian Lance Taylor To: gcc-patches , "gofrontend-dev@googlegroups.com" PR 65616 points out that you can't use gccgo to build a PIE because go-main.c is not compiled with -fPIC. This patch fixes that. I could have used -fPIE, but -fPIC is essentially the same here and seems more flexible. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and GCC 5 branch. Ian diff -r c713e818f342 libgo/Makefile.am --- a/libgo/Makefile.am Fri Apr 17 14:58:05 2015 -0700 +++ b/libgo/Makefile.am Fri Apr 24 09:40:23 2015 -0700 @@ -2032,6 +2032,10 @@ libgobegin_llgo_a_SOURCES = \ runtime/go-main.c +# Use -fPIC for libgobegin so that it can be put in a PIE. +libgobegin_a_CFLAGS = $(AM_CFLAGS) -fPIC +libgobegin_llgo_a_CFLAGS = $(AM_CFLAGS) -fPIC + libnetgo_a_SOURCES = $(go_netgo_files) libnetgo_a_LIBADD = netgo.o