From patchwork Mon Jun 16 10:56:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 360064 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 C64C61400AA for ; Mon, 16 Jun 2014 20:56:44 +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:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=fmvXh3+VVQjUK8Sf tJHeY57cLOPDelizvbqS+VACFvZvxBFMD3UAI8u2ntiNqw6G4C2TUvr0wDNv9Xo3 MhGapVx0jlr9z9L0r1EjrR0/UX6FrU0tYf7vwiUiYAKvW/m20VBL5B4mr5GCL4J8 dxhk9lLZMwKRHBo/IBkU+doAfJw= 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:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=z7eD2jeh+igOx09MICvsDr Mfwzg=; b=YxfApqqGvkxTW4+J827udlJGbmei3o9LaOOaDgtwBiE/0mxvdHvYCp M+Vu18/Gunbk9J/4hvMylqqhjf+aiDz+OHXvnx6nBiYompvhgslrSx6vfh+gsnCx hfv1+dtzNvAxuEJtdW9w0ei1fOejCslUVsMwlx0r06Od0zOSxgzrg= Received: (qmail 15834 invoked by alias); 16 Jun 2014 10:56:37 -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 15815 invoked by uid 89); 16 Jun 2014 10:56:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp-relay.CeBiTec.Uni-Bielefeld.DE Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Jun 2014 10:56:32 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id E224445A; Mon, 16 Jun 2014 12:56:29 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QsDHCBLoVOpb; Mon, 16 Jun 2014 12:56:27 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 8D830459; Mon, 16 Jun 2014 12:56:27 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.14.7+Sun/8.14.7/Submit) id s5GAuRkZ024500; Mon, 16 Jun 2014 12:56:27 +0200 (MEST) From: Rainer Orth To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Re: Go patch committed: Pass -t to native linker on Solaris References: Date: Mon, 16 Jun 2014 12:56:27 +0200 In-Reply-To: (Ian Lance Taylor's message of "Fri, 13 Jun 2014 15:30:48 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Ian Lance Taylor writes: > This patch changes the gccgo driver to pass -t to the native linker on > Solaris. This avoids warnings like > > ld: warning: symbol 'go$zerovalue' has differing sizes: > (file hello.o value=0x8; file > i386-pc-solaris2.11/libgo/.libs/libgo.so value=0x800); > hello.o definition taken and updated with larger size > > The symbol go$zerovalue is a common symbol and it's normal for it to > have different sizes in different object files and shared libraries. > The linker should take the larger size, which is what it does. > Unfortunately, by default, it emits a warning, which in this case is > useless. This patch passes the -t option to disable the warning. > > Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. > Bootstrapped and ran a few tests on x86_64-sun-solaris. Committed to > mainline. Works fine, thanks. Just before your patch arrived, I meant to test the following, slightly more general patch. Perhaps it's an option to handle other quirks like this? Rainer 2014-06-13 Rainer Orth gcc/go: PR go/61496 * gospec.c (lang_specific_driver) [TARGET_GO_LINK_OPTIONS]: Pass target specific link options. gcc: PR go/61496 * config/sol2.h [!USE_GLD] (TARGET_GO_LINK_OPTIONS): Define. # HG changeset patch # Parent 59e0e6f1eecd53ddab49b2cd5015be221b5e505a Suppress Solaris ld warnings about go$zerovalue sizes (PR go/61496) diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -303,6 +303,12 @@ along with GCC; see the file COPYING3. /* collect2.c can only parse GNU nm -n output. Solaris nm needs -png to produce the same format. */ #define NM_FLAGS "-png" + +#ifndef USE_GLD +/* Solaris ld warns about common symbols of differing sizes, which Go uses + for go$zerovalue. Pass -t to suppress that warning. */ +#define TARGET_GO_LINK_OPTIONS "-t" +#endif /* The system headers under Solaris 2 are C++-aware since 2.0. */ #define NO_IMPLICIT_EXTERN_C diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c --- a/gcc/go/gospec.c +++ b/gcc/go/gospec.c @@ -395,6 +395,12 @@ lang_specific_driver (struct cl_decoded_ } #endif +#ifdef TARGET_GO_LINK_OPTIONS + /* Pass target specific linker options if present. */ + generate_option (OPT_Wl_, TARGET_GO_LINK_OPTIONS, 1, CL_DRIVER, + &new_decoded_options[j++]); +#endif + *in_decoded_options_count = j; *in_decoded_options = new_decoded_options; *in_added_libraries = added_libraries;