From patchwork Sat Sep 23 00:58:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 114115 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp136071qgf; Fri, 22 Sep 2017 17:59:05 -0700 (PDT) X-Received: by 10.98.16.80 with SMTP id y77mr704940pfi.261.1506128345233; Fri, 22 Sep 2017 17:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506128345; cv=none; d=google.com; s=arc-20160816; b=aT+Xw997GLQWvQoZOExGxpLr8WzNIj7KM4deIR8VjMtvW3yMGlWQTke8FeHwvRXKn+ st0il550LE0FPW07tlZ5xWVsKhRwqa7fGBNzRV1KCzh2dfCQSdYzfxkkhFezIw5ECcny YVQH2Y2W655DK1CyfYOqWp7r69MnwCnNjZUQk9fXT8ch28+MFa3OcJQlynsnpZ8HdHxo AsNG/wmzfw8DAVOzj5ucsAPydmgWiiDkPloWe3UIQVMekngqJv6wUEgioQ0Ebm6KxRr7 /NH7RdmPRvShwSLPAmg+UP6FzHLV1fBNRDSpR0ilpAUly6vuw2mMdIP2vDUMqYDkP0qa uuww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=SUcIDT+PIZ0lnj80imxAZKRWYNmAjrCrZuijHit4ZC4=; b=07HAsf614cERiBQ1/AobsyZS0ZHMfWDX3+tpVsptVTgvk3xJN9yGUMnuPyPLPuMNHV iZdA3iM0XCMG610aSA7YFuHcKuMpktO0TDwl73U4pRoR/rB1+KVzxVSabyWccdlZBgEA vEBEwOwrUcl/9VR8GL9CQcNqrhSW83+7JIlRaRDpIWiUA6srRRg/tMQnqKV5B/HGtNyZ QrQqgqF2xbmLLuoLqu3/7yYGG+XttvWB9XtPulHSPtk1cbh1BqFdjkRWKYu2ZwaCcF3r d89QfOrfG79fkE1valNFfums/Bzx5qj/A/sxs8bzloLx93JVKIrpbnhHRd3pmgPH1lRE RaCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=KsLpeJnG; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id m14si580185pgs.511.2017.09.22.17.59.04; Fri, 22 Sep 2017 17:59:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=KsLpeJnG; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 2DF8678485; Sat, 23 Sep 2017 00:58:55 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f171.google.com (mail-pf0-f171.google.com [209.85.192.171]) by mail.openembedded.org (Postfix) with ESMTP id 5843178477 for ; Sat, 23 Sep 2017 00:58:34 +0000 (UTC) Received: by mail-pf0-f171.google.com with SMTP id r71so1297344pfe.12 for ; Fri, 22 Sep 2017 17:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1DATQQ64B8Z0/lIAY5SbSSTZ1AitA0d/Lb50Th0RVjk=; b=KsLpeJnGikPmsHIfY94mZBZNhukdcYfU1sBX3ehtvJo8Y5YK9ZW3BIhksh+70cuGL3 q+wKGM1XIVThnpbERNJFXC36nPqXhNCCT4QC0vpxWc/32qCuHhXyYa0B4NX+i9uuNL2m PZzvscHR2v8OD/hzANl7fZ/Nlq47CMv/Vf8Jp4JVHMKOzBImdE0g5rHMcMhBMC/Y93IJ inIa+WVpE29rBXn8/c/xUNOXkwDWSJmUJOd2lY/9kTexOP1oTPVj2MiEZhRRM2oIkq4x BLDrqKAilCSzde1ghEfucTLvLviSlvlfEr8OyInbovqtfpRAZN5rCDpg97X/4UMWjoaN aREA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1DATQQ64B8Z0/lIAY5SbSSTZ1AitA0d/Lb50Th0RVjk=; b=D9iLuavEJtsWii5Qo7Zd1ysc/XNg8zHE9n+ZBHBuBE60drztiEY8OEAXFxvowHp4kQ 1gDWoCVknWvbrOO8Nz/UUlG/Ja6/JveL+jetG9SQwRr9T428/aCds+UVThtxM0lWfZLg nP/UDSAAbDovr2UYgIFAAemzQAelMV1qdQN97fcUFDMgonVEUHVubqWdURskWlGLJXtl gEPtO3tbU1CMzJoFrs7ot76FXKHlC7biwa4pgDIiYFF2YjgXGZzmfn6g5ietjrWauS9S BjVrqLVANdmuFyJR9Tr2TjO5H3k4C02LhrMidxIZHj0sEWkjf8EPPFgUqLARA28cqGe6 pnSA== X-Gm-Message-State: AHPjjUhadFOTBjREe1KdYNGPnSGcXalQIUR9wO7jmJS34u9KrQ5abaTg bqxpNBmJSPgMyA0ormYdvti7Jg== X-Google-Smtp-Source: AOwi7QCHSJ2o7X2FxVntUvLbCAzmtFGmdqbKMAR5JqTg1h8o3QfDFu+uTqaaGNBuFT1GfzO3TbSX0w== X-Received: by 10.98.236.17 with SMTP id k17mr730761pfh.191.1506128316360; Fri, 22 Sep 2017 17:58:36 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c::e57f]) by smtp.gmail.com with ESMTPSA id b66sm1151521pfe.165.2017.09.22.17.58.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2017 17:58:35 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Fri, 22 Sep 2017 17:58:23 -0700 Message-Id: <20170923005823.10278-4-raj.khem@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170923005823.10278-1-raj.khem@gmail.com> References: <20170923005823.10278-1-raj.khem@gmail.com> Subject: [OE-core] [PATCH 4/4] go: Fix build with -buildmode=pie X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Khem Raj --- meta/recipes-devtools/go/go-1.9.inc | 1 + ...dmode-pie-forces-external-linking-mode-on.patch | 46 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch -- 2.14.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/go/go-1.9.inc b/meta/recipes-devtools/go/go-1.9.inc index 0b0aca3fbe..65adaa8d72 100644 --- a/meta/recipes-devtools/go/go-1.9.inc +++ b/meta/recipes-devtools/go/go-1.9.inc @@ -14,6 +14,7 @@ SRC_URI += "\ file://0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch \ file://0007-ld-add-soname-to-shareable-objects.patch \ file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ + file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ " SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" diff --git a/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch b/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch new file mode 100644 index 0000000000..7475d9338a --- /dev/null +++ b/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch @@ -0,0 +1,46 @@ +From aae44527c8065d54f6acaf87c82cba1ac96fae59 Mon Sep 17 00:00:00 2001 +From: Ian Lance Taylor +Date: Fri, 18 Aug 2017 17:46:03 -0700 +Subject: [PATCH] cmd/go: -buildmode=pie forces external linking mode on all + systems + +The go tool assumed that -buildmode=pie implied internal linking on +linux-amd64. However, that was changed by CL 36417 for issue #18968. + +Fixes #21452 + +Change-Id: I8ed13aea52959cc5c53223f4c41ba35329445545 +Reviewed-on: https://go-review.googlesource.com/57231 +Run-TryBot: Ian Lance Taylor +TryBot-Result: Gobot Gobot +Reviewed-by: Avelino +Reviewed-by: Rob Pike +--- +Upstream-Status: Backport + + src/cmd/go/internal/load/pkg.go | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go +index 2660d3f..d40773b 100644 +--- a/src/cmd/go/internal/load/pkg.go ++++ b/src/cmd/go/internal/load/pkg.go +@@ -954,11 +954,12 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) *Package + + if cfg.BuildContext.CgoEnabled && p.Name == "main" && !p.Goroot { + // Currently build modes c-shared, pie (on systems that do not +- // support PIE with internal linking mode), plugin, and +- // -linkshared force external linking mode, as of course does ++ // support PIE with internal linking mode (currently all ++ // systems: issue #18968)), plugin, and -linkshared force ++ // external linking mode, as of course does + // -ldflags=-linkmode=external. External linking mode forces + // an import of runtime/cgo. +- pieCgo := cfg.BuildBuildmode == "pie" && (cfg.BuildContext.GOOS != "linux" || cfg.BuildContext.GOARCH != "amd64") ++ pieCgo := cfg.BuildBuildmode == "pie" + linkmodeExternal := false + for i, a := range cfg.BuildLdflags { + if a == "-linkmode=external" { +-- +2.14.1 +