From patchwork Tue Apr 17 20:10:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 899635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476506-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=golang.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="yX1K0Mbj"; dkim-atps=neutral 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 40Qbx14RfLz9s19 for ; Wed, 18 Apr 2018 06:11:16 +1000 (AEST) 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:from:date:message-id:subject:to:content-type; q= dns; s=default; b=MtfDrcf63k/qLRtShDfYnxJ06a/2A708q9FcbbYAvchEn4 Jie14nr87seomdNxVk6VaE7eTe+bkzJekgoifqSwQaB/Axav+769gyjzHrYOmcOG 41koWkvJIqXk9Kjae+ClJ2ca3prNipPEj+9CiON3pj0sg0A9yKXcsOTOLLSoM= 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:from:date:message-id:subject:to:content-type; s= default; bh=kInHmMDUmCf5g3swDk0XezHH5+0=; b=yX1K0Mbj8eg6BSKZDw9t f6vUfTUlWwXTj0ENt0Bnm2m0RhgqmTtPeIHbPKVtgQsqkEbQDjT6/wxQdTxJQqdk CCZFpNmfbQ1Qn5e5lxPKrVMCmkV7Sjw0sZKuAEkY1wD7EZO4OZsGKctZT2D87dft B+4Qb6ZNgI/xVl9/qJTH6Eg= Received: (qmail 126238 invoked by alias); 17 Apr 2018 20:11:02 -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 126059 invoked by uid 89); 17 Apr 2018 20:11:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f182.google.com Received: from mail-wr0-f182.google.com (HELO mail-wr0-f182.google.com) (209.85.128.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Apr 2018 20:11:00 +0000 Received: by mail-wr0-f182.google.com with SMTP id q6so26758273wrd.6 for ; Tue, 17 Apr 2018 13:11:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KLWb9UluQs4i0cirgcnZvYN0euTJQy1jURfUrkZoVtI=; b=nyE8zZGLpJ4RmsXhlCvwDECGGR2JF3D+kZVRO6b+oJDJcVXqjm/2cDrUnXoR7CgBjk lXadlAfq+fR2jCA9JsSlUws//EtQghGG6cmDN6lKj0ZKXqUJCuvWRhyqLlqH+SZjNU2z xZ7ig/PxNuliWCgRz7MrmY7GRDcP3SDV6UeXfnAmtZppq3kbXTojBi/4AnrBQMAsDkyE LwK6rSoppqLWBMvLQuIo4BwC9cGAviFEM5yYUjuTXE3g1MX6Y21DyyKbTf3DUFz9pxe3 fQFIlyptAMynwNEDatVoh2+J0z/2sX9x4xrE9zvFmyirmrxReMN7oRw4/cnEaEsz1+oc Svgw== X-Gm-Message-State: ALQs6tBRlWuVlrhBh+TFBrcml9HaE4TIK/ZCQPtd9HIlrSVco+kkw83W vKvrM9s/5o/2mvDm9tQLogtYOYHwTA0t7yCGxy4sOycU X-Google-Smtp-Source: AIpwx49IfuHvERf0KogbLTMVlTGOzaoh4bqSeHmSIbXgoNUYTNLKDFdxazm4ZGO+QiVuiGZIi1KLh2f8ujgIsVcmkyI= X-Received: by 10.80.135.14 with SMTP id i14mr4822157edb.86.1523995858230; Tue, 17 Apr 2018 13:10:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.245.189 with HTTP; Tue, 17 Apr 2018 13:10:57 -0700 (PDT) From: Ian Lance Taylor Date: Tue, 17 Apr 2018 13:10:57 -0700 Message-ID: Subject: libgo patch committed: suppress "ar rcD" and "-zdefs" on AIX To: gcc-patches , gofrontend-dev@googlegroups.com This patch by Tony Reix fixes invocations of ar and ld on AIX. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 259359) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -3aa5fc91094c5f24b26747ec176ad44cde784fc7 +2c7093358e5f5ebeb102d44d1036ca0a807d46a5 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/cmd/go/internal/work/gccgo.go =================================================================== --- libgo/go/cmd/go/internal/work/gccgo.go (revision 259359) +++ libgo/go/cmd/go/internal/work/gccgo.go (working copy) @@ -190,15 +190,15 @@ func (gccgoToolchain) pack(b *Builder, a } absAfile := mkAbs(objdir, afile) // Try with D modifier first, then without if that fails. - if b.run(a, p.Dir, p.ImportPath, nil, "ar", "rcD", absAfile, absOfiles) != nil { + if cfg.Goos == "aix" || b.run(a, p.Dir, p.ImportPath, nil, "ar", "rcD", absAfile, absOfiles) != nil { + var arArgs []string if cfg.Goos == "aix" && cfg.Goarch == "ppc64" { // AIX puts both 32-bit and 64-bit objects in the same archive. // Tell the AIX "ar" command to only care about 64-bit objects. // AIX "ar" command does not know D option. - return b.run(a, p.Dir, p.ImportPath, nil, "ar", "-X64", "rc", absAfile, absOfiles) - } else { - return b.run(a, p.Dir, p.ImportPath, nil, "ar", "rc", absAfile, absOfiles) + arArgs = append(arArgs, "-X64") } + return b.run(a, p.Dir, p.ImportPath, nil, "ar", "rc", arArgs, absAfile, absOfiles) } return nil } @@ -466,7 +466,10 @@ func (tools gccgoToolchain) link(b *Buil ldflags = append(ldflags, goLibBegin...) ldflags = append(ldflags, "-lgo", "-lgcc_s", "-lgcc", "-lc", "-lgcc") case "shared": - ldflags = append(ldflags, "-zdefs", "-shared", "-nostdlib", "-lgo", "-lgcc_s", "-lgcc", "-lc") + if cfg.Goos != "aix" { + ldflags = append(ldflags, "-zdefs") + } + ldflags = append(ldflags, "-shared", "-nostdlib", "-lgo", "-lgcc_s", "-lgcc", "-lc") case "pie": ldflags = append(ldflags, "-pie")