From patchwork Fri Nov 17 21:58:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 119228 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1045961qgn; Fri, 17 Nov 2017 13:58:32 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ1FNFFsk7z3SeLL76kbBah/xeYTSW6uraTrzloUGF7A8xOWtc7v5m48eujUk8mpdXOFvtr X-Received: by 10.84.168.35 with SMTP id e32mr6597992plb.122.1510955912018; Fri, 17 Nov 2017 13:58:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510955912; cv=none; d=google.com; s=arc-20160816; b=GL9NNWMWsD8Gtlke8Yy7DJ3hEZCK/1Vhv9aqz5mbhCkZCcWNzvRAFV+MI9m86txiwh x8SO7pBtpehgwEKq2R/ItbqBvqGfB3kSD+R7XTFLXY7tWet+u75trhlXdTVAjHMR7I32 Kcrr5UUiaNujuVkenSTolDpxxLB/ckMZs/kCdcR74Guxp3JDy1S/CVd4nLFPTdFD83ww FPm1nIzGRfqY0JdAlRIXqTDCp+C+eV6j38XzwyLyqO6XZIn/kdkaA4/hDFSO7wrgwpl/ P+uAC/df0E0FQ6zv7v6ZQuVVDmmbHfQHlk9Nu2lemMvUGpM5Kv93NhTAkeEPvSoiAWvK 7O+A== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=x6rPqTTuyqaK5bml+UoK8sragulV325ctwEl5s8KPe8=; b=rzWxcZ85ow2n2V1uilSJXi0+SrGvKA2H1m8PCYonFe/KDsjYwlI8HCsjW0+Un15hAI pW8AH2/7LO/alxgo9B0ms6MxkFjBBvu9UO+pfEIZ48BLb36oD4Ja7dNA0ypXCSQmgy8n AxBnqVq3KVIDXoRDmKbQE/daCww2POwmbcgnbmuuLLfhzHo8HZM3+LRyAXldtNV4+3hT U06fXgSHu6Gj8/zOFr0KcpAcky1jTYntRNkbfd+vZY4NywXynrNrEjNd0aqqiwgkAzlk IJb7LksYnNB35rTuiUHtPTrpPfHM+z44/+VKb9bu2XiTPoyg0pHaOUTooIlU4suPhwcT ogMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=jldnPhDT; 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 f9si3395010plt.372.2017.11.17.13.58.31; Fri, 17 Nov 2017 13:58:32 -0800 (PST) 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=jldnPhDT; 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 E80FD78866; Fri, 17 Nov 2017 21:58:27 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by mail.openembedded.org (Postfix) with ESMTP id 5BAB078786 for ; Fri, 17 Nov 2017 21:58:25 +0000 (UTC) Received: by mail-qt0-f193.google.com with SMTP id r39so8565805qtr.13 for ; Fri, 17 Nov 2017 13:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=J96ZYiVhoW9JXiSWpT2j0ZTL084ayvTbLXMaDzqfYew=; b=jldnPhDTIZjeI0vxrls7KYr6fwsGU61fFDjg4FeYbU1ArpzAuV+rPOMC7u9ZK7NEgZ CXWQudBlkBqEi7ZrgPP6CwcE9d6+VYWggRQeSijnemLTw13/wWYQbyhJK3ISJfFDzVpH 3RmuvThB+9MuxsoaOTupSIhbe7k6P1n876aNEvaMyMPMjKj8rWUcNlkBnE3VmJe0rik+ wLhI5gKLOCD9Ym36VjgAIE831JZFkCrCTk/qUPG4OFPhvrvf3uWrwiupkgsI7rFcGjEa ZRi3jvV6ZdggGLQqHfehCGLtx8WaVr+TTqtLWf6rZg1EVsgLIa7ksYjQ023/TpDyHS1B pudw== 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; bh=J96ZYiVhoW9JXiSWpT2j0ZTL084ayvTbLXMaDzqfYew=; b=J5FBqKKxrv1NKomMZgNVS2thc0dwtLM3c+W+huOwsHWeQ3lYDz/wvvDycDnBV7Svgo trPvLXLOWWwficmVqpzYUPsMZ0Lf+PeroLJPuGi9Hj7VKJCwD1zhNjwRFmt46fqmsbxt 9p7BVJcr3ODVBF8fnzKJMsnbS3kmOQlXzskOniB5eanoANTsdFc90mwTWm6IBmFYx7tH mZf1JDcgvEjD9vGM6zh/958BH1aUYpd2MavOJuepBoRW2FjxMX774zcgS8wRwlvcOiZQ Xx/WjI/8a0BpUlucAx0Fu6L8wpm5m6WHYG0sJGhhLb1LEb1xwTN3+dTPHAzOKGRDflc1 mYDQ== X-Gm-Message-State: AJaThX40WTU8kQpvJDFx+ufynd8za11c98kbmNj0N/e3FvKSVGa31XMf pwrZi/8ktqa5QNJR5pXNJa1ZuQ== X-Received: by 10.237.42.131 with SMTP id t3mr10701344qtd.188.1510955906928; Fri, 17 Nov 2017 13:58:26 -0800 (PST) Received: from localhost.localdomain ([2601:646:8882:b8c::a4a]) by smtp.gmail.com with ESMTPSA id g47sm3189880qtc.69.2017.11.17.13.58.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 13:58:26 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org, ross.burton@intel.com Date: Fri, 17 Nov 2017 13:58:18 -0800 Message-Id: <20171117215818.19430-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.15.0 Subject: [OE-core] [PATCH V2] go: Use right dynamic linker on musl 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 --- Changes since V1: Drop using pie by default patch meta/recipes-devtools/go/go-1.9.inc | 2 + .../go/go-1.9/set-external-linker.patch | 111 +++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.9/set-external-linker.patch -- 2.15.0 -- _______________________________________________ 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 65adaa8d72..60292651df 100644 --- a/meta/recipes-devtools/go/go-1.9.inc +++ b/meta/recipes-devtools/go/go-1.9.inc @@ -16,5 +16,7 @@ SRC_URI += "\ 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_append_libc-musl = " file://set-external-linker.patch" + SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" diff --git a/meta/recipes-devtools/go/go-1.9/set-external-linker.patch b/meta/recipes-devtools/go/go-1.9/set-external-linker.patch new file mode 100644 index 0000000000..d6bd7fa39c --- /dev/null +++ b/meta/recipes-devtools/go/go-1.9/set-external-linker.patch @@ -0,0 +1,111 @@ +Change the dynamic linker hardcoding to use musl when not using glibc +this should be applied conditional to musl being the system C library + +Upstream-Status: Inappropriate [Real Fix should be portable across libcs] + +Signed-off-by: Khem Raj + +Index: go/src/cmd/link/internal/amd64/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/amd64/obj.go ++++ go/src/cmd/link/internal/amd64/obj.go +@@ -67,7 +67,7 @@ func Init() { + ld.Thearch.Append64 = ld.Append64l + ld.Thearch.TLSIEtoLE = tlsIEtoLE + +- ld.Thearch.Linuxdynld = "/lib64/ld-linux-x86-64.so.2" ++ ld.Thearch.Linuxdynld = "/lib/ld-musl-x86_64.so.1" + ld.Thearch.Freebsddynld = "/libexec/ld-elf.so.1" + ld.Thearch.Openbsddynld = "/usr/libexec/ld.so" + ld.Thearch.Netbsddynld = "/libexec/ld.elf_so" +Index: go/src/cmd/link/internal/arm/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/arm/obj.go ++++ go/src/cmd/link/internal/arm/obj.go +@@ -63,7 +63,7 @@ func Init() { + ld.Thearch.Append32 = ld.Append32l + ld.Thearch.Append64 = ld.Append64l + +- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.3" // 2 for OABI, 3 for EABI ++ ld.Thearch.Linuxdynld = "/lib/ld-musl-armhf.so.1" + ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1" + ld.Thearch.Openbsddynld = "/usr/libexec/ld.so" + ld.Thearch.Netbsddynld = "/libexec/ld.elf_so" +Index: go/src/cmd/link/internal/arm64/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/arm64/obj.go ++++ go/src/cmd/link/internal/arm64/obj.go +@@ -62,7 +62,7 @@ func Init() { + ld.Thearch.Append32 = ld.Append32l + ld.Thearch.Append64 = ld.Append64l + +- ld.Thearch.Linuxdynld = "/lib/ld-linux-aarch64.so.1" ++ ld.Thearch.Linuxdynld = "/lib/ld-musl-aarch64.so.1" + + ld.Thearch.Freebsddynld = "XXX" + ld.Thearch.Openbsddynld = "XXX" +Index: go/src/cmd/link/internal/mips/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/mips/obj.go ++++ go/src/cmd/link/internal/mips/obj.go +@@ -77,7 +77,7 @@ func Init() { + ld.Thearch.Append64 = ld.Append64b + } + +- ld.Thearch.Linuxdynld = "/lib/ld.so.1" ++ ld.Thearch.Linuxdynld = "/lib/ld-musl-mipsle.so.1" + + ld.Thearch.Freebsddynld = "XXX" + ld.Thearch.Openbsddynld = "XXX" +Index: go/src/cmd/link/internal/mips64/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/mips64/obj.go ++++ go/src/cmd/link/internal/mips64/obj.go +@@ -75,7 +75,7 @@ func Init() { + ld.Thearch.Append64 = ld.Append64b + } + +- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1" ++ ld.Thearch.Linuxdynld = "/lib64/ld-musl-mips64le.so.1" + + ld.Thearch.Freebsddynld = "XXX" + ld.Thearch.Openbsddynld = "XXX" +Index: go/src/cmd/link/internal/ppc64/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/ppc64/obj.go ++++ go/src/cmd/link/internal/ppc64/obj.go +@@ -77,7 +77,7 @@ func Init() { + } + + // TODO(austin): ABI v1 uses /usr/lib/ld.so.1 +- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1" ++ ld.Thearch.Linuxdynld = "/lib/ld-musl-powerpc64le.so.1" + + ld.Thearch.Freebsddynld = "XXX" + ld.Thearch.Openbsddynld = "XXX" +Index: go/src/cmd/link/internal/s390x/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/s390x/obj.go ++++ go/src/cmd/link/internal/s390x/obj.go +@@ -62,7 +62,7 @@ func Init() { + ld.Thearch.Append32 = ld.Append32b + ld.Thearch.Append64 = ld.Append64b + +- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1" ++ ld.Thearch.Linuxdynld = "/lib/ld-musl-s390x.so.1" + + // not relevant for s390x + ld.Thearch.Freebsddynld = "XXX" +Index: go/src/cmd/link/internal/x86/obj.go +=================================================================== +--- go.orig/src/cmd/link/internal/x86/obj.go ++++ go/src/cmd/link/internal/x86/obj.go +@@ -63,7 +63,7 @@ func Init() { + ld.Thearch.Append32 = ld.Append32l + ld.Thearch.Append64 = ld.Append64l + +- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.2" ++ ld.Thearch.Linuxdynld = "/lib/ld-musl-i386.so.1" + ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1" + ld.Thearch.Openbsddynld = "/usr/libexec/ld.so" + ld.Thearch.Netbsddynld = "/usr/libexec/ld.elf_so"