From patchwork Thu Nov 9 01:58:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 118358 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6012581qgn; Wed, 8 Nov 2017 17:59:43 -0800 (PST) X-Google-Smtp-Source: ABhQp+SpdXyWbIVyswSQq4lk38pLBqkta6Y9omad5dHxGv+lu8x0zwEHYVzyL+gLExSM0wALJKDD X-Received: by 10.84.169.36 with SMTP id g33mr2272804plb.10.1510192783793; Wed, 08 Nov 2017 17:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510192783; cv=none; d=google.com; s=arc-20160816; b=rbJ96+J7mn32tjPXwSqAzAfmAJSt+H6epd+7pAx69fIoqrbnieBB2UTwrV3fUuM9W9 qwVFxVsuGSzLmTOeb+QCi2+j0AT7aAsS7nHIeMD2vOuFcI+AGDNGM6pGmXZc9q+XOp9G xRp/ilzHrgZT7n4jB90+8LYsETNuJRHrTdTEBr9YpyDgN2HvCFaZIk0y52QA0745jJiq K6JWlJGKIMu7sDz9Zspkb2xe4NkAPelSKjEc5bwpVxnh0DnoAuSC4nE+p1J2FKTMMu2j RJwNJAgRfPXYVh5r9jw30rVWPNu588KIiicBctCgH2c1yg9+mndiChlJTV9IArK9xjFg VkaA== 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=EElDs5EEbSX4O6HkGTKdN+7mJ7rw7+Qi1zOn7IGA/R0=; b=rUb8oZ9rY0Un7zMcTdHad2OMP/icmyMU0MXYG0S1N80YX4rTVcB0gRPB2Ch67PvYBl 4Ah82fZ+CQ9YCLMHyPKmU8jSlcnDQL+uHSK2xBdabY2BeUPfM+n8rgCZr2YbaUXppD3b XAA9PsBrkLZJI9BcWUKe+5SJxBYMSS9lbWXHhKprWg0d81kAsydGDdA5+UxRNuDLaFiC 0epP09/L2I5TN5zPTS40CmPA6ylPuXMuszj+xu8pJSNR4aecsPIUK7W3fOe7OBo0SVmN oMJtI17ghT95q47VNnuYt0vuM56xoQurY99hIYsBPlqtrDCKacQIEaWPni3FA6Op4WXK 7ylg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Z1RQ1Sln; 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 q186si893380pga.657.2017.11.08.17.59.43; Wed, 08 Nov 2017 17:59:43 -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=Z1RQ1Sln; 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 5EA5B784ED; Thu, 9 Nov 2017 01:59:02 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by mail.openembedded.org (Postfix) with ESMTP id 61A97784E3 for ; Thu, 9 Nov 2017 01:58:59 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id z80so3087947pff.4 for ; Wed, 08 Nov 2017 17:59:01 -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:in-reply-to:references; bh=eYKHUsABohQy4Im3fp1UP6sRLfgaU2dq94EkWZ53QXo=; b=Z1RQ1SlnJ3nw6zE4UuYwmkVcDfqBghl1t9VdcpWmzF0bsvriYsHBWQpwSQnru6oTMV 6PuZNlIrp4+af+3tlRbXX+e5UFQ0lRoxfUXCk2NM8iWnBu909CQAhc+2XuYd0KLgVmOJ nzG6Ji5d7ovDVXyYXiHAUL6Xa9SjSHU8WD+/GsjS2IqXhTejqNnOuSSTyCBZT5DE47kK hg36mQAKiolntudnH1K7+NeqZkLaTwcrO1dt25xNyj4c8JkTG1hk3NYpGdFNskuNQgGa AdUWr2r7O72IF0mySkqTh/KDJIDZPbX5jEIaS4YNZpRNINJ5c0Qb2XoRaJIQzAup8Da0 vDcQ== 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=eYKHUsABohQy4Im3fp1UP6sRLfgaU2dq94EkWZ53QXo=; b=tN83Zrt5qGNQxbUKdlzTzYWxHsAh6WZpGf0YPoDVFhIpvzW7XrIgmJWvEG3JKLsLqr KqAir73DRJbdsWcbdVMU161g0jvF4deOJ1JTOC0d6aTnhNpMdnhQ5XJNfJ2dbYUFG99H 3ZEvBD/YfPZ7PpkkOPi+cDebYYCvVD7dXuH1rMU8xrB6BlKouXJWWWr2YnSHPDMXxK+h UO2QdkZiq93fudVzqqqzxH3ECGyGN49Xr8GhKKmwoHahZOcs5iY0jk+olW5/Ts00xvnk NiBOD3tWX+N7z5gFb8Rkyp000Wrd7opNY9+9iU0pGXRHPN+bBu5Fd1GBaXbU2g4pL3oc 3Qmw== X-Gm-Message-State: AJaThX4kzYEum18kJgEtHuXPamhhtOuV7zCxtko8fpUj+FpBNUvoHtsV zjVf64nz6NlUxtgx0T0mwcsnFA== X-Received: by 10.99.132.72 with SMTP id k69mr2305039pgd.437.1510192741280; Wed, 08 Nov 2017 17:59:01 -0800 (PST) Received: from localhost.localdomain ([2601:646:8882:b8c::a4a]) by smtp.gmail.com with ESMTPSA id w17sm10156709pfa.70.2017.11.08.17.58.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 17:58:59 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 8 Nov 2017 17:58:48 -0800 Message-Id: <6eb7d501a2a8422cf0ee6a36bb99143f39255be3.1510192517.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Subject: [OE-core] [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines 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 This makes it easy to override them in bbappends Signed-off-by: Khem Raj --- meta/recipes-devtools/binutils/binutils-2.29.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.15.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core Signed-off-by: Khem Raj <raj.khem@gmail.com>
diff --git a/meta/recipes-devtools/binutils/binutils-2.29.inc b/meta/recipes-devtools/binutils/binutils-2.29.inc index 27d46eb088..35f76cba6d 100644 --- a/meta/recipes-devtools/binutils/binutils-2.29.inc +++ b/meta/recipes-devtools/binutils/binutils-2.29.inc @@ -18,9 +18,10 @@ BINUPV = "${@binutils_branch_version(d)}" UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P\d+_(\d_?)*)" -SRCREV = "37e991bb143ca2106330bcdc625590d53838b7a1" +SRCREV ?= "37e991bb143ca2106330bcdc625590d53838b7a1" +BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=binutils-${BINUPV}-branch;protocol=git" SRC_URI = "\ - git://sourceware.org/git/binutils-gdb.git;branch=binutils-${BINUPV}-branch;protocol=git \ + ${BINUTILS_GIT_URI} \ file://0003-configure-widen-the-regexp-for-SH-architectures.patch \ file://0004-Point-scripts-location-to-libdir.patch \ file://0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ From patchwork Thu Nov 9 01:58:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 118359 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6012690qgn; Wed, 8 Nov 2017 17:59:51 -0800 (PST) X-Google-Smtp-Source: ABhQp+Qx2NjSaU+q0nO05jtmxkDWboMIvkcRqXUvCs6b/550sNXCupYiw6yUU7GRITbfNZ3CFHZD X-Received: by 10.84.148.203 with SMTP id y11mr2210176plg.198.1510192791321; Wed, 08 Nov 2017 17:59:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510192791; cv=none; d=google.com; s=arc-20160816; b=LQThEH7Y+6zw063dLuWO1HR3FdNYZ8d+aOJwnufXURK4GxoAg66E2F//vJvCiYpkiU pZh3mfSDi4Es0VbRkNqWCycvdoCg2TevxR8LG3lZ7aqUpDDkUtqhGbwYAFZ2UzYhtOOw FN+KlNBfucWB7P5dm83TMXN1oLS1Yupw+7svpxFABJ8rIs2+XBVoRIwB+iwzdEecCYkM ild3+OZ41kDz/u2CORolpkGncfomu1rUhHKFr/TkTQrYiD98XESh6IcJSLDE9DfNuqEM aU3BYRgh/wb+FMeP9ECMrBiFph88780Kuz3LYQmEJbfsiFsWK1c2Zq1q62gFXXtRbuzT OFxw== 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=h1PivJUgrV/ka7LgXQtfqd6CfhqkbDUa25evNYHAcHw=; b=vf2BU2nq3b7PscoKTArutYJ9KZL4pq4y10z8EjHSKyEqdMk3iXpjlEYRysHZEexMEA 1EENsGZIH6Nc9aRZl2j/xAukVAoKm0WcEX3J6J+xxHLvTaVgWsNhvnDoS33S90c6lEwb CIAPz6NC1I+EaijcC3ti3+PEePw6t0a8GmnfEJ9V/nx/fVmbdcmX2470noKVXUNCp3th pU5tlqc9Sa0m2jMX236f5SbQ8P0m0b0+2Rhs6wqHjKCeaNJEJKC9+Hmg61bWDBYV9BIY 4dr30Pk5xKKxk0qDMvyBGQMOcTbMS3zuKoa28KZQlUDvsgJOxBb/CXWp2IVfeZyRFiK5 Gu/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=MEZInTsZ; 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 k25si2302459pfb.304.2017.11.08.17.59.51; Wed, 08 Nov 2017 17:59:51 -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=MEZInTsZ; 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 C647A7851D; Thu, 9 Nov 2017 01:59:03 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by mail.openembedded.org (Postfix) with ESMTP id 1E678784ED for ; Thu, 9 Nov 2017 01:59:01 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id o7so3444829pgc.4 for ; Wed, 08 Nov 2017 17:59:03 -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:in-reply-to:references; bh=NDxRfl1TcxhKtro2718wHMSUJ/zrNh637rMne58or0o=; b=MEZInTsZA/rXvgtDyLFomsmBvg3zHwdF7JWRBrFkhWYVG9nQGwIEW7XIJnufH8DCvC jv0BYEZvzq9wf1GO3hJ7hwZY1Ona6TPQ6RHi/rKXGjehqJLwrSM4lIus7sKm4VQBMsVt zwfHCUnJzV4Dx7U/fTqn6NCOjeUi+dhEcr5iLnplvV58Nk/gUjzO8rywZdWQ+Odtr53T KpOxLcRmg6dVjj0rmjnPrAt1UapD+QOUckIXjWCjH2u+TBUXAzM/QbLi1q/WbmODdRX6 vIMwd0VcciHRdioNDRDmXmYUo9PEbOHz6vBTWr/ENShurEXnZZO8EJr7Cl7M2VsI3Snl ZXfQ== 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=NDxRfl1TcxhKtro2718wHMSUJ/zrNh637rMne58or0o=; b=cg8zShTAORWCV4P/TMOKrJCkwbC70VpRj5McPj32SFOBB63eZK97yayFPqfGkHn1q1 6f/Tmo1lx0L9QhQrIkHEyhbtsHrasbKRDKeh1kAudehXz/p0xulhkhHjuVQfhCwhI+Ne E3eiy+j8zDJnYexE6cDHwOn+M/vKhAh1pKobjnJ67H8xaWZCRBb6HxxHOTtntVtyTZkt Si5r+cglcQCyc0JAlvQTuc6LSGR+98R7ln8SeIH/gQ0W3OKoNJw1m/JV7fIiYLB0nF/c qVtMZadtqKWx4sxJIhV355f/WUD2Zv4Ar+rtqE5wSzeI6xlR+kS7pLXqX/LaGSdLRzgN U0zg== X-Gm-Message-State: AJaThX685wOnyZ2mMf7PC2kxP9IdDl+/+OdPKPbIeZSSm/HmfgauUaSs 659ZX1C1kXJASCuWqCXAYiBhbQ== X-Received: by 10.101.81.139 with SMTP id h11mr2258681pgq.233.1510192743141; Wed, 08 Nov 2017 17:59:03 -0800 (PST) Received: from localhost.localdomain ([2601:646:8882:b8c::a4a]) by smtp.gmail.com with ESMTPSA id w17sm10156709pfa.70.2017.11.08.17.59.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 17:59:01 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 8 Nov 2017 17:58:49 -0800 Message-Id: <59fa19d2f199771d480a8443fee2f7b728ad38e2.1510192517.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Subject: [OE-core] [PATCH 2/5] go: Fix build with PIE 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 --- meta/recipes-devtools/go/go-1.9.inc | 3 + .../go/go-1.9/default-buildmode-pie.patch | 18 ++++ .../go/go-1.9/set-external-linker.patch | 111 +++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.9/default-buildmode-pie.patch 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..f52abb5735 100644 --- a/meta/recipes-devtools/go/go-1.9.inc +++ b/meta/recipes-devtools/go/go-1.9.inc @@ -15,6 +15,9 @@ SRC_URI += "\ 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 \ + file://default-buildmode-pie.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/default-buildmode-pie.patch b/meta/recipes-devtools/go/go-1.9/default-buildmode-pie.patch new file mode 100644 index 0000000000..a7933bd39e --- /dev/null +++ b/meta/recipes-devtools/go/go-1.9/default-buildmode-pie.patch @@ -0,0 +1,18 @@ +Default to PIE on linux platforms + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +diff -upr src/go.orig/src/cmd/go/internal/work/build.go src/go/src/cmd/go/internal/work/build.go +--- go.orig/src/cmd/go/internal/work/build.go 2017-08-27 17:38:26.354750979 +0200 ++++ go/src/cmd/go/internal/work/build.go 2017-08-27 17:40:27.555130105 +0200 +@@ -304,7 +304,8 @@ func BuildModeInit() { + ldBuildmode = "c-shared" + case "default": + switch platform { +- case "android/arm", "android/arm64", "android/amd64", "android/386": ++ case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x", ++ "android/arm", "android/arm64", "android/amd64", "android/386": + codegenArg = "-shared" + ldBuildmode = "pie" + case "darwin/arm", "darwin/arm64": 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" From patchwork Thu Nov 9 01:58:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 118360 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6012771qgn; Wed, 8 Nov 2017 17:59:59 -0800 (PST) X-Google-Smtp-Source: ABhQp+T4oV06lPGmQdGVF0FHsE7W2WcnDEg1BIerqczYvlAEfK91c56V5uS2iuZw2f9Ok3Tpww2t X-Received: by 10.99.164.18 with SMTP id c18mr2273091pgf.167.1510192798999; Wed, 08 Nov 2017 17:59:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510192798; cv=none; d=google.com; s=arc-20160816; b=B6sM4h/N32tUvCVYOi0uSqEvJVcL4V9Vf0EFi/HO2I9EVheN1qs5nPepGyjLTXPsLn K7IyJ4fl97PbJAsTM8sFq2MuzDN1WfieHQ1cBVYKfqJc3PPJP7mTznsDYmDNiH9wKJLl tJXaTjkoyUMCOBjDAehhHFBnJ+gOHA3wladwRrhWPu8Jk1WPgA/y289UiigKcLBgIqwD nAtDrpkv47vz8JJrgZQUkDGoWTajGBTou6S5RgEiT5FJfmZ+ior6cdq5C3091AykEgj5 Kdje+Olc0+KIazpP+ORYyn7YnIlnuYBXbC2qHrWx9YQ0AUg8qTXYdp4qO81zLcPsEmns omaw== 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=J6vIIBp3yj55AVY5QE/7tChYr8dQRAnFTuwtAIHc6dc=; b=fFbZPgeOwV5DBu6q+vfS/8uga/PwEQSEiAbS7AurEaD5wvKCEQsSMAQw4xcEsP+Thq VS8cYwHhAtyVhoMKkGtBJy4U9R7WflDSMX7rI5AoF6Z/I75eqbVaD6m07vh0SOZJtW3A SYJc2Qj9uXsriZr9LbjhcXRyXRj9TX4I/YTMcGCgbPlD01UJVq/GXFu5mfhqfVTvyysE Wc7Jd71bHmsEbVXwUMGYHQlq/SpE366wM5BkIlwcXZsvg5s5VnL8rZ+S59omoHtpmNMa g7JMDY/hr2050cx34SIluciB4jr/5MrF/2todoRloMB4RHKDcaAwrdjMZedaI4KZsNQL EyyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=EUx6ZCPx; 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 d2si4966056plh.216.2017.11.08.17.59.58; Wed, 08 Nov 2017 17:59:58 -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=EUx6ZCPx; 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 C69007852E; Thu, 9 Nov 2017 01:59:05 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by mail.openembedded.org (Postfix) with ESMTP id 5E7E878513 for ; Thu, 9 Nov 2017 01:59:03 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id d28so3148150pfe.2 for ; Wed, 08 Nov 2017 17:59:05 -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:in-reply-to:references; bh=yo+zF2CrZ40v5BOdyWtSblI6LjyITppZDIqaufsLv+0=; b=EUx6ZCPxkikjlI4FyB9JriRmyR/vL46uILVagmfRX9BQg+O1v6CrlwBhUqwmJ2C4ou Zq8e9veZKHbs7uLwtN9wzbKZmKRk8LcNy++iUBB6M6Kk44mqwMwfGQ0+7CCy4qbQPqEe nnddjH8iIJcgyQWBfz/2C1Mec+VDKbZZgrklAZGyQP8YI7qm9VGasImigTFL96r8eubl sz0ZibYqqCF3RE6Px+cV0d115ECjoDFLUZiN/Du1Kmmlu6CKvOMAIOvMHz+b5Ji8xdsX TBcJrLNPrYCrWXf0bzY4cl3uX3Lj0qCkQNtGWRl8BPCIn6aXR73GdDEp2ptBMozEh+rp qkqw== 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=yo+zF2CrZ40v5BOdyWtSblI6LjyITppZDIqaufsLv+0=; b=P2df6bzo+O/dRp5TYiUjJJeNYf4SatEjWkfkOatsyzkbAInq2d/zBDlro9tMMxJLru ebjt35tHcIMFVE3IA0gZWulOUnFnKsFls8Rocss3Dfskq1EhcK1Gb+R8txE/vQV0QaZV eKf/pPV+OoC2druBFgrkmKooNCTce78cDFqP/lS/rO2NbPeOLAxMsUu3GwaDemKFXNcI CJEoo3Xz3wDbCkDOayCgobdvsaLsXOTgknFfLYap17pEAe46nr7mFzpmu/w16S98Yyi/ GCr30m7BE+ghNgpvSONWpJGUDvPb2K7sXeaNvR3hcoiChbGI+8wWj+LUSVUWJ0kiGqJB FyZg== X-Gm-Message-State: AJaThX7fDKvOrYVCTR+ikHq8WFNBYU1/9R4dIiPgmHlHCWKZhufP7uSf mklfqpBegSoo6v2MPgZdovaRVw== X-Received: by 10.99.121.197 with SMTP id u188mr2344431pgc.416.1510192745276; Wed, 08 Nov 2017 17:59:05 -0800 (PST) Received: from localhost.localdomain ([2601:646:8882:b8c::a4a]) by smtp.gmail.com with ESMTPSA id w17sm10156709pfa.70.2017.11.08.17.59.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 17:59:03 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 8 Nov 2017 17:58:50 -0800 Message-Id: <0329390219aeeadf8204b2220c87a6373d0d42bf.1510192517.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Subject: [OE-core] [PATCH 3/5] systemd: Fix build with musl/mips64 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 --- .../0001-Use-uintmax_t-for-handling-rlim_t.patch | 89 ++++++++++++++++++++++ meta/recipes-core/systemd/systemd_234.bb | 1 + 2 files changed, 90 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.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-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch b/meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch new file mode 100644 index 0000000000..779dc78fd3 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch @@ -0,0 +1,89 @@ +From b2d4171c6e521cf1e70331fb769234d63a4a6d44 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 27 Oct 2017 13:00:41 -0700 +Subject: [PATCH] Use uintmax_t for handling rlim_t + +PRIu{32,64} is not right format to represent rlim_t type +therefore use %ju and typecast the rlim_t variables to +uintmax_t. + +Fixes portablility errors like + +execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=] +| fprintf(f, "%s%s: " RLIM_FMT "\n", +| ^~~~~~~~ +| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max); +| ~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Khem Raj +--- +Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/7199] + + src/basic/format-util.h | 8 -------- + src/basic/rlimit-util.c | 8 ++++---- + src/core/execute.c | 8 ++++---- + 3 files changed, 8 insertions(+), 16 deletions(-) + +diff --git a/src/basic/format-util.h b/src/basic/format-util.h +index ae42a8f89..144249cd6 100644 +--- a/src/basic/format-util.h ++++ b/src/basic/format-util.h +@@ -60,14 +60,6 @@ + # define PRI_TIMEX "li" + #endif + +-#if SIZEOF_RLIM_T == 8 +-# define RLIM_FMT "%" PRIu64 +-#elif SIZEOF_RLIM_T == 4 +-# define RLIM_FMT "%" PRIu32 +-#else +-# error Unknown rlim_t size +-#endif +- + #if SIZEOF_DEV_T == 8 + # define DEV_FMT "%" PRIu64 + #elif SIZEOF_DEV_T == 4 +diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c +index ca834df62..41fcebb74 100644 +--- a/src/basic/rlimit-util.c ++++ b/src/basic/rlimit-util.c +@@ -284,13 +284,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) { + if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY) + s = strdup("infinity"); + else if (rl->rlim_cur >= RLIM_INFINITY) +- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max); ++ (void) asprintf(&s, "infinity:%ju", (uintmax_t)rl->rlim_max); + else if (rl->rlim_max >= RLIM_INFINITY) +- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur); ++ (void) asprintf(&s, "%ju:infinity", (uintmax_t)rl->rlim_cur); + else if (rl->rlim_cur == rl->rlim_max) +- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur); ++ (void) asprintf(&s, "%ju", (uintmax_t)rl->rlim_cur); + else +- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max); ++ (void) asprintf(&s, "%ju:%ju", (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max); + + if (!s) + return -ENOMEM; +diff --git a/src/core/execute.c b/src/core/execute.c +index d72e5bf08..d38946002 100644 +--- a/src/core/execute.c ++++ b/src/core/execute.c +@@ -3443,10 +3443,10 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { + + for (i = 0; i < RLIM_NLIMITS; i++) + if (c->rlimit[i]) { +- fprintf(f, "%s%s: " RLIM_FMT "\n", +- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max); +- fprintf(f, "%s%sSoft: " RLIM_FMT "\n", +- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur); ++ fprintf(f, "%s%s: %ju\n", ++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max); ++ fprintf(f, "%s%sSoft: %ju\n", ++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur); + } + + if (c->ioprio_set) { +-- +2.14.3 + diff --git a/meta/recipes-core/systemd/systemd_234.bb b/meta/recipes-core/systemd/systemd_234.bb index bcb683f10a..6b8745b93f 100644 --- a/meta/recipes-core/systemd/systemd_234.bb +++ b/meta/recipes-core/systemd/systemd_234.bb @@ -40,6 +40,7 @@ SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \ file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \ file://0013-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \ file://0001-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch \ + file://0001-Use-uintmax_t-for-handling-rlim_t.patch \ " SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch" From patchwork Thu Nov 9 01:58:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 118361 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6012843qgn; Wed, 8 Nov 2017 18:00:06 -0800 (PST) X-Google-Smtp-Source: ABhQp+TZt28aZnsOIfsGolODktGfPxKlX3BDPlw5k/jF35Uzps0Qh+tx5NHWNMhLGZDYKFMM76Tz X-Received: by 10.101.66.1 with SMTP id c1mr2283051pgq.100.1510192806080; Wed, 08 Nov 2017 18:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510192806; cv=none; d=google.com; s=arc-20160816; b=j4LYpURFO0aqlQe3h8ZimwvMSUtWlpa+NvqpQdEAMZT5xAM5EC2dRduKoghh4X4V6g 1EqmFn/IH1OcxvdPIc8extVbl+7VbPD0eFK4mjeBlpNr2TpbBgMjdOCCp6TeXjPq/oQ+ JQI/lRrfvzlBnS+HvkMMUWtRfs5Wsstlp34Jauabc2WNW6VzS1MXQMEXA+qlnH55xabf oXMNDzbu/qLKWIKUhkjJoSgPRV/5bpYyBYCjugjN5A2D8MR7gFstTXSs4YniRM32h32E dkAEdAavRAOSagN8LaR0l/PG0KMd1ni4L25YGo8K6TzbfgCzT0ih7fv2hveH5KlxLu/B YbRg== 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=vnXWJIypuMvBvjTrwKlCb+oz8adv9MvLN9U55DtmopU=; b=EnaDvxRJnCzp0cAqeZrO30j+5VtDGzo5ZAcqytFk8ywX+ZyfDspVdUSwZD5XYyVysu 67zZ3mVDKtvaoAMOJquAddX/7h71//4gTTh4kc2htHh87dp9Dk/d178UkbMWGHH5Bpx3 IFjmQANCsLPCnODqeQmHPSbfrduBx7TP3edWEZiRirQXC4tXrPtoRmo8yf3BdzcTma1l zD/m0wDivm1lQCcMw47KE8/pSbCzs2nuX5hgAOnlNDcwNbl9gs/V3HSorh0sDunbmM5C yCGcYCOPer1MeaKAsaRGGI54Qi/+D+W/U0w6QwMH8nuE/UETYsC3OA3jLsYQKjJr+81F irmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=fxZjuG7L; 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 e68si4891910pgc.143.2017.11.08.18.00.05; Wed, 08 Nov 2017 18:00:06 -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=fxZjuG7L; 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 C879B7853D; Thu, 9 Nov 2017 01:59:06 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by mail.openembedded.org (Postfix) with ESMTP id 3490E7852D for ; Thu, 9 Nov 2017 01:59:05 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id d28so3148185pfe.2 for ; Wed, 08 Nov 2017 17:59:07 -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:in-reply-to:references; bh=JuO5Cls2RAnmoowbPXMskATd/GFearYwW/s7AEKAjTA=; b=fxZjuG7Lza0NUgVt6UebGAukKLl+YZxYmtFpEUIFIdwSlMN/AfhVgOmsh5DS8JG1Ba 825vWSqQLzRiPZNmGeF7UIa8Oq2DBS1QDHGdz4eBfD2QPDLwoutQXXWn2UaXidxMdjY/ 6IPpNLI3qDafe7HaKv0Z/cdacl0w+Sl9LBaoZyNU4+WHAqR+ekCo4ORWt8WInXsmnAnh YqBa6jLnLJxOvKD5Sx9d64MIWMKMPgnmEjdNre1HBLF+OLs/MKi0GHnL1UW4oqZuHh9G KtCyI5SYFO8WUOtW57SwML237LJ7b1+NvUpO2h+ix11lbVRWLqgwnX1vEsGpBjc2P7k5 V5Dw== 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=JuO5Cls2RAnmoowbPXMskATd/GFearYwW/s7AEKAjTA=; b=uCIsbRLCpDOyyBiVTYVncLoRqQp5d4culbp5oHAFycWLk420bwrTkCjk42d+Q8jbA4 +XH5D34HAcJIBBelzwuAes8dtyA/rx9vnN/a3qM6wLETQ0xKqonsGl1ltnPDZACrdLc9 XGwWo0UcROm6l9KB5DxRBcpqeMmwIZw4eYfc+G6B8JcsD24RU/Fr+161prprFFcHLVQx O3a961XS5NY5Q+l52hhOi9W8y32B7hSGaex08dKWTu52CLFcbihLsx0aKHIBxBmtyNy3 PxVojLbzURKV/dnxlnVEIPpPc4eqIefhtXAuuQMcjJVkCMmEVxxRkgBuaqKPWt9qFUQ0 luVw== X-Gm-Message-State: AJaThX4iWbgUfHY6jHuKtLfQaI3GldURYrVCQDMn9TZNc1OBiwkBEEez OiuF+lfMhR7oN3x4DcipGIk6Pw== X-Received: by 10.99.160.25 with SMTP id r25mr2258519pge.67.1510192746512; Wed, 08 Nov 2017 17:59:06 -0800 (PST) Received: from localhost.localdomain ([2601:646:8882:b8c::a4a]) by smtp.gmail.com with ESMTPSA id w17sm10156709pfa.70.2017.11.08.17.59.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 17:59:05 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 8 Nov 2017 17:58:51 -0800 Message-Id: <826373113902dd8d6284ec49a2ea2076c7e298c0.1510192517.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Subject: [OE-core] [PATCH 4/5] musl: Update to 1.1.18 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 Rich Felker (9): fix access by setjmp and longjmp to __hwcap on arm built as thumb2 for executing init array functions, use function type with prototype fix read-after-free type error in pthread_detach fix incorrect base name offset from nftw when pathname ends in slash(es) in dns parsing callback, enforce MAXADDRS to preclude overflow release 1.1.17 fix regression in glob with literal . or .. path component fix build regression on ARM for ISA levels less than v5 release 1.1.18 Szabolcs Nagy (1): math: rewrite fma with mostly int arithmetics Will Dietz (1): posix_spawn: use larger stack to cover worst-case in execvpe Signed-off-by: Khem Raj --- meta/recipes-core/musl/musl_git.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 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-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb index 671de326fb..932c9a27a0 100644 --- a/meta/recipes-core/musl/musl_git.bb +++ b/meta/recipes-core/musl/musl_git.bb @@ -3,9 +3,9 @@ require musl.inc -SRCREV = "48be5b6313d7b827acf555769e93b389fa9f6307" +SRCREV = "eb03bde2f24582874cb72b56c7811bf51da0c817" -PV = "1.1.16+git${SRCPV}" +PV = "1.1.18+git${SRCPV}" # mirror is at git://github.com/kraj/musl.git From patchwork Thu Nov 9 01:58:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 118362 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6012989qgn; Wed, 8 Nov 2017 18:00:14 -0800 (PST) X-Google-Smtp-Source: ABhQp+Tpc+V1xSF1TxeDpc6+mbksgvQEGoZOjMuvcibv2ciTrFGwgKNs2mOx6S2hj9MbzEGGDqP4 X-Received: by 10.84.246.9 with SMTP id k9mr2230351pll.234.1510192814668; Wed, 08 Nov 2017 18:00:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510192814; cv=none; d=google.com; s=arc-20160816; b=QS6rVZlr52qlvkEu/v2Ibc6lP8zpBjiFYZQpCPWsIVBP5FUUDGrnfJwXgBxbImFDPM 4qm8RQWOPddCbpyeim8IsMXfnzrNrGucwXo6A42eCJc+ToE51rrb8lB3W1b/Vb2cxn20 nKIZyj3mlVjJ9dLK0YoIffBpcwwb7T/yoDYMf6PVtSC6TFrLCQe1K7aWKuLqRs49KLIv l7bjbBwv++jk8FQ+i9iLOiZur9fNFPpL36GWVzzxMX/xzCp/4ga5sn4cJlcvMk0gyjvz EEHd/+vyydDW+nZzXLTwUYg4I+sb6R0Xig1di2Ub3WcEG83cUVe3HFarLfZVOn3BgsGY 8MAg== 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=Zyyklq4ZLgUzJF46hIDHhlAulqIH40558smoq6q7Gzw=; b=Y45HMGpsqkgfkGekO1nJrItp5RnDr8JIWVoCVIKb+R/XKzuUaqB+AsqkrEILQeuwOY h9fKJdl1o+lUBGsjpAg9yBawwRJNeB+uOlK6rV4zA4MnMk74ZBq11Reusrgi5m9xbNx1 L4BHGASAXCDb+92699ZMF6k7LxQ6GoMlu2aYKA4PcbX6d34/+8ZG0+KzfLi5FTwde2Bh QS8b/dGWmbJ7Oemcfdsk0ZnT+RFFKdkjqlPT1SbCthBgIcUTJ9dAXyEcHNKTYaCwavrM Los+M5yimrEu+bgZIng+whnGGblb8lVTng1wV8Py6ED4KpyTS4uCZE6r37f7lPVxjyT+ fJJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=UIpy1Lvf; 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 bb5si4756163plb.22.2017.11.08.18.00.14; Wed, 08 Nov 2017 18:00:14 -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=UIpy1Lvf; 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 EE3707854C; Thu, 9 Nov 2017 01:59:08 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg0-f47.google.com (mail-pg0-f47.google.com [74.125.83.47]) by mail.openembedded.org (Postfix) with ESMTP id 59D7578505 for ; Thu, 9 Nov 2017 01:59:06 +0000 (UTC) Received: by mail-pg0-f47.google.com with SMTP id v78so3451349pgb.5 for ; Wed, 08 Nov 2017 17:59:08 -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:in-reply-to:references; bh=LTt12y/ccPNJkcu10FCAcpVKsj2rhK3BVvLHvRgY83o=; b=UIpy1LvfXCt46EgZnu2WE/B3yyjaqbibJBgJqyQHw4xw5p6cTPfBg/S5KThcn3VZaQ 3fgxOKHdVOzZPbdIJE91YGY1n/89jxKOqk9hNwhQ+QIGODD4HsiM+zAhb7msCo+9P0Yk Ws/hOIBppNFuOAxNAXyzWdQlj5rwrgKiv9TpTsulr8YkAWihWWtfdzUeAPNBixDQrm6x g4z/hBGJ9KjJQoksxiJk8wLXU3U+xCcJX/hXX2KgZqIUqvg2lUAJyDrAIrGx6kco97oJ 2d4tB2ew2SsWOsCTj5OcY9lUmLi7nMZolvMklKd7Lony1sdD/hyMVDSXInR3A+0RT1sD i19A== 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=LTt12y/ccPNJkcu10FCAcpVKsj2rhK3BVvLHvRgY83o=; b=dAg4ayHkbVHcYwcJ6Ivw298CNp8B369Zfx8XPL0fo/8HUbtA4KOJlFg1Ck/tM6v1An OK2PsQBvEDTqcMkoIpJqFYAsldy2Hyqta3nM2z70nVX9qNCa+8kIagUsXKdOonc9tmgR HlmTFOM6XKB6hsLPMTnzJqEBSs6gjOHuemYhPG/OECiwbkEjhkh50CWvmXjeyoOziRh1 WwPbRhFJjECdX9TTamF7i7z+Qt+VBUUp9PeLOF0x8FavZ4TieMUMbfw70MVs6bgJYIt2 LIIKt2qH3LFo6WdtY0NmWsBtPjxZsJws2TkciAe093yR6bcOIgdTY8Bp65hK4irTOnVr cTgQ== X-Gm-Message-State: AJaThX7P3/8HhhY+/yBEZ+6xNiAtOI0oc01Z107B+xEKbqj29RxflNhT J7PwIjcHktgi6YPMBN1NRdHfVw== X-Received: by 10.99.95.216 with SMTP id t207mr2295153pgb.185.1510192747936; Wed, 08 Nov 2017 17:59:07 -0800 (PST) Received: from localhost.localdomain ([2601:646:8882:b8c::a4a]) by smtp.gmail.com with ESMTPSA id w17sm10156709pfa.70.2017.11.08.17.59.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 17:59:06 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 8 Nov 2017 17:58:52 -0800 Message-Id: <0239ade9c4122c44ac274e7e03004c74749a38c4.1510192517.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Subject: [OE-core] [PATCH 5/5] gcc7/gcc6: Fix unaligned STRD issue on ARM 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 Backport https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82445 Fixes [YOCTO 12297] Signed-off-by: Khem Raj --- meta/recipes-devtools/gcc/gcc-6.4.inc | 1 + ...5-suppress-32-bit-aligned-ldrd-strd-peeph.patch | 194 +++++++++++++++++++++ meta/recipes-devtools/gcc/gcc-7.2.inc | 1 + ...5-suppress-32-bit-aligned-ldrd-strd-peeph.patch | 194 +++++++++++++++++++++ 4 files changed, 390 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc-6.4/0057-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch create mode 100644 meta/recipes-devtools/gcc/gcc-7.2/0051-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.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/gcc/gcc-6.4.inc b/meta/recipes-devtools/gcc/gcc-6.4.inc index a42b7d83ca..37e996afb7 100644 --- a/meta/recipes-devtools/gcc/gcc-6.4.inc +++ b/meta/recipes-devtools/gcc/gcc-6.4.inc @@ -80,6 +80,7 @@ SRC_URI = "\ " BACKPORTS = "\ file://CVE-2016-6131.patch \ + file://0057-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch \ " SRC_URI[md5sum] = "11ba51a0cfb8471927f387c8895fe232" SRC_URI[sha256sum] = "850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4" diff --git a/meta/recipes-devtools/gcc/gcc-6.4/0057-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch b/meta/recipes-devtools/gcc/gcc-6.4/0057-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch new file mode 100644 index 0000000000..0214ab83d9 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-6.4/0057-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch @@ -0,0 +1,194 @@ +From ad5bf450aef2ffee6d57ed193fabc5f72f8eaa65 Mon Sep 17 00:00:00 2001 +From: rearnsha +Date: Thu, 19 Oct 2017 13:16:42 +0000 +Subject: [PATCH] [ARM] PR 82445 - suppress 32-bit aligned ldrd/strd peepholing + with -mno-unaligned-access + +Peephole patterns exist in the arm backend to spot load/store +operations to adjacent memory operations in order to convert them into +ldrd/strd instructions. However, when we have strict alignment +enforced, then we can only do this if the accesses are known to be +64-bit aligned; this is unlikely to be the case for most loads. The +patch adds some alignment checking to the code that validates the +addresses for use in the peephole patterns. This should also fix +incorrect generation of ldrd/strd with unaligned accesses that could +previously have occurred on ARMv5e where all such operations must be +64-bit aligned. + +I've added some new tests as well. In doing so I discovered that the +ldrd/strd peephole tests could never fail since they would match the +source file name in the scanned assembly as well as any instructions +of the intended type. I've fixed those by tightening the scan results +slightly. + +gcc: + +* config/arm/arm.c (align_ok_ldrd_strd): New function. +(mem_ok_for_ldrd_strd): New parameter align. Extract the alignment of the +mem into it. +(gen_operands_ldrd_strd): Validate the alignment of the accesses. + +testsuite: + +* gcc.target/arm/peep-ldrd-1.c: Tighten test scan pattern. +* gcc.target/arm/peep-strd-1.c: Likewise. +* gcc.target/arm/peep-ldrd-2.c: New test. +* gcc.target/arm/peep-strd-2.c: New test. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@253892 138bc75d-0d04-0410-961f-82ee72b054a4 +--- +Upstream-Status: Backport +Signed-off-by: Khem Raj + + gcc/ChangeLog | 8 +++++++ + gcc/config/arm/arm.c | 27 ++++++++++++++++++---- + gcc/testsuite/ChangeLog | 8 +++++++ + gcc/testsuite/gcc.target/arm/peep-ldrd-1.c | 2 +- + .../arm/{peep-ldrd-1.c => peep-ldrd-2.c} | 4 ++-- + gcc/testsuite/gcc.target/arm/peep-strd-1.c | 2 +- + .../arm/{peep-strd-1.c => peep-strd-2.c} | 4 ++-- + 7 files changed, 44 insertions(+), 11 deletions(-) + copy gcc/testsuite/gcc.target/arm/{peep-ldrd-1.c => peep-ldrd-2.c} (63%) + copy gcc/testsuite/gcc.target/arm/{peep-strd-1.c => peep-strd-2.c} (58%) + +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c +index 9c0813d598d..e3da9f77fb6 100644 +--- a/gcc/config/arm/arm.c ++++ b/gcc/config/arm/arm.c +@@ -15926,12 +15926,23 @@ operands_ok_ldrd_strd (rtx rt, rtx rt2, rtx rn, HOST_WIDE_INT offset, + return true; + } + ++/* Return true if a 64-bit access with alignment ALIGN and with a ++ constant offset OFFSET from the base pointer is permitted on this ++ architecture. */ ++static bool ++align_ok_ldrd_strd (HOST_WIDE_INT align, HOST_WIDE_INT offset) ++{ ++ return (unaligned_access ++ ? (align >= BITS_PER_WORD && (offset & 3) == 0) ++ : (align >= 2 * BITS_PER_WORD && (offset & 7) == 0)); ++} ++ + /* Helper for gen_operands_ldrd_strd. Returns true iff the memory + operand MEM's address contains an immediate offset from the base +- register and has no side effects, in which case it sets BASE and +- OFFSET accordingly. */ ++ register and has no side effects, in which case it sets BASE, ++ OFFSET and ALIGN accordingly. */ + static bool +-mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset) ++mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset, HOST_WIDE_INT *align) + { + rtx addr; + +@@ -15950,6 +15961,7 @@ mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset) + gcc_assert (MEM_P (mem)); + + *offset = const0_rtx; ++ *align = MEM_ALIGN (mem); + + addr = XEXP (mem, 0); + +@@ -15990,7 +16002,7 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + bool const_store, bool commute) + { + int nops = 2; +- HOST_WIDE_INT offsets[2], offset; ++ HOST_WIDE_INT offsets[2], offset, align[2]; + rtx base = NULL_RTX; + rtx cur_base, cur_offset, tmp; + int i, gap; +@@ -16002,7 +16014,8 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + registers, and the corresponding memory offsets. */ + for (i = 0; i < nops; i++) + { +- if (!mem_ok_for_ldrd_strd (operands[nops+i], &cur_base, &cur_offset)) ++ if (!mem_ok_for_ldrd_strd (operands[nops+i], &cur_base, &cur_offset, ++ &align[i])) + return false; + + if (i == 0) +@@ -16114,6 +16127,7 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + /* Swap the instructions such that lower memory is accessed first. */ + std::swap (operands[0], operands[1]); + std::swap (operands[2], operands[3]); ++ std::swap (align[0], align[1]); + if (const_store) + std::swap (operands[4], operands[5]); + } +@@ -16127,6 +16141,9 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + if (gap != 4) + return false; + ++ if (!align_ok_ldrd_strd (align[0], offset)) ++ return false; ++ + /* Make sure we generate legal instructions. */ + if (operands_ok_ldrd_strd (operands[0], operands[1], base, offset, + false, load)) +diff --git a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c +index eb2b86ee7b6..d49eff6b87e 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c +@@ -8,4 +8,4 @@ int foo(int a, int b, int* p, int *q) + *p = a; + return a; + } +-/* { dg-final { scan-assembler "ldrd" } } */ ++/* { dg-final { scan-assembler "ldrd\\t" } } */ +diff --git a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c b/gcc/testsuite/gcc.target/arm/peep-ldrd-2.c +similarity index 63% +copy from gcc/testsuite/gcc.target/arm/peep-ldrd-1.c +copy to gcc/testsuite/gcc.target/arm/peep-ldrd-2.c +index eb2b86ee7b6..6822c2b1454 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-ldrd-2.c +@@ -1,6 +1,6 @@ + /* { dg-do compile } */ + /* { dg-require-effective-target arm_prefer_ldrd_strd } */ +-/* { dg-options "-O2" } */ ++/* { dg-options "-O2 -mno-unaligned-access" } */ + int foo(int a, int b, int* p, int *q) + { + a = p[2] + p[3]; +@@ -8,4 +8,4 @@ int foo(int a, int b, int* p, int *q) + *p = a; + return a; + } +-/* { dg-final { scan-assembler "ldrd" } } */ ++/* { dg-final { scan-assembler-not "ldrd\\t" } } */ +diff --git a/gcc/testsuite/gcc.target/arm/peep-strd-1.c b/gcc/testsuite/gcc.target/arm/peep-strd-1.c +index bd330769599..fe1beac7229 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-strd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-strd-1.c +@@ -6,4 +6,4 @@ void foo(int a, int b, int* p) + p[2] = a; + p[3] = b; + } +-/* { dg-final { scan-assembler "strd" } } */ ++/* { dg-final { scan-assembler "strd\\t" } } */ +diff --git a/gcc/testsuite/gcc.target/arm/peep-strd-1.c b/gcc/testsuite/gcc.target/arm/peep-strd-2.c +similarity index 58% +copy from gcc/testsuite/gcc.target/arm/peep-strd-1.c +copy to gcc/testsuite/gcc.target/arm/peep-strd-2.c +index bd330769599..bfc5ebe9eec 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-strd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-strd-2.c +@@ -1,9 +1,9 @@ + /* { dg-do compile } */ + /* { dg-require-effective-target arm_prefer_ldrd_strd } */ +-/* { dg-options "-O2" } */ ++/* { dg-options "-O2 -mno-unaligned-access" } */ + void foo(int a, int b, int* p) + { + p[2] = a; + p[3] = b; + } +-/* { dg-final { scan-assembler "strd" } } */ ++/* { dg-final { scan-assembler-not "strd\\t" } } */ +-- +2.15.0 + diff --git a/meta/recipes-devtools/gcc/gcc-7.2.inc b/meta/recipes-devtools/gcc/gcc-7.2.inc index 04edad77cb..02b8e03482 100644 --- a/meta/recipes-devtools/gcc/gcc-7.2.inc +++ b/meta/recipes-devtools/gcc/gcc-7.2.inc @@ -79,6 +79,7 @@ SRC_URI = "\ ${BACKPORTS} \ " BACKPORTS = "\ + file://0051-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch \ " SRC_URI[md5sum] = "ff370482573133a7fcdd96cd2f552292" SRC_URI[sha256sum] = "1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a" diff --git a/meta/recipes-devtools/gcc/gcc-7.2/0051-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch b/meta/recipes-devtools/gcc/gcc-7.2/0051-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch new file mode 100644 index 0000000000..021250700d --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-7.2/0051-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch @@ -0,0 +1,194 @@ +From 8c18b422211878ba02503462cb22a2cc25a0a325 Mon Sep 17 00:00:00 2001 +From: rearnsha +Date: Thu, 19 Oct 2017 13:14:55 +0000 +Subject: [PATCH] [ARM] PR 82445 - suppress 32-bit aligned ldrd/strd peepholing + with -mno-unaligned-access + +Peephole patterns exist in the arm backend to spot load/store +operations to adjacent memory operations in order to convert them into +ldrd/strd instructions. However, when we have strict alignment +enforced, then we can only do this if the accesses are known to be +64-bit aligned; this is unlikely to be the case for most loads. The +patch adds some alignment checking to the code that validates the +addresses for use in the peephole patterns. This should also fix +incorrect generation of ldrd/strd with unaligned accesses that could +previously have occurred on ARMv5e where all such operations must be +64-bit aligned. + +I've added some new tests as well. In doing so I discovered that the +ldrd/strd peephole tests could never fail since they would match the +source file name in the scanned assembly as well as any instructions +of the intended type. I've fixed those by tightening the scan results +slightly. + +gcc: + +* config/arm/arm.c (align_ok_ldrd_strd): New function. +(mem_ok_for_ldrd_strd): New parameter align. Extract the alignment of the +mem into it. +(gen_operands_ldrd_strd): Validate the alignment of the accesses. + +testsuite: + +* gcc.target/arm/peep-ldrd-1.c: Tighten test scan pattern. +* gcc.target/arm/peep-strd-1.c: Likewise. +* gcc.target/arm/peep-ldrd-2.c: New test. +* gcc.target/arm/peep-strd-2.c: New test. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@253891 138bc75d-0d04-0410-961f-82ee72b054a4 +--- +Upstream-Status: Backport +Signed-off-by: Khem Raj + + gcc/ChangeLog | 8 +++++++ + gcc/config/arm/arm.c | 27 ++++++++++++++++++---- + gcc/testsuite/ChangeLog | 8 +++++++ + gcc/testsuite/gcc.target/arm/peep-ldrd-1.c | 2 +- + .../arm/{peep-ldrd-1.c => peep-ldrd-2.c} | 4 ++-- + gcc/testsuite/gcc.target/arm/peep-strd-1.c | 2 +- + .../arm/{peep-strd-1.c => peep-strd-2.c} | 4 ++-- + 7 files changed, 44 insertions(+), 11 deletions(-) + copy gcc/testsuite/gcc.target/arm/{peep-ldrd-1.c => peep-ldrd-2.c} (63%) + copy gcc/testsuite/gcc.target/arm/{peep-strd-1.c => peep-strd-2.c} (58%) + +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c +index 1ded0d2a17d..989957f048e 100644 +--- a/gcc/config/arm/arm.c ++++ b/gcc/config/arm/arm.c +@@ -15199,12 +15199,23 @@ operands_ok_ldrd_strd (rtx rt, rtx rt2, rtx rn, HOST_WIDE_INT offset, + return true; + } + ++/* Return true if a 64-bit access with alignment ALIGN and with a ++ constant offset OFFSET from the base pointer is permitted on this ++ architecture. */ ++static bool ++align_ok_ldrd_strd (HOST_WIDE_INT align, HOST_WIDE_INT offset) ++{ ++ return (unaligned_access ++ ? (align >= BITS_PER_WORD && (offset & 3) == 0) ++ : (align >= 2 * BITS_PER_WORD && (offset & 7) == 0)); ++} ++ + /* Helper for gen_operands_ldrd_strd. Returns true iff the memory + operand MEM's address contains an immediate offset from the base +- register and has no side effects, in which case it sets BASE and +- OFFSET accordingly. */ ++ register and has no side effects, in which case it sets BASE, ++ OFFSET and ALIGN accordingly. */ + static bool +-mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset) ++mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset, HOST_WIDE_INT *align) + { + rtx addr; + +@@ -15223,6 +15234,7 @@ mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset) + gcc_assert (MEM_P (mem)); + + *offset = const0_rtx; ++ *align = MEM_ALIGN (mem); + + addr = XEXP (mem, 0); + +@@ -15263,7 +15275,7 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + bool const_store, bool commute) + { + int nops = 2; +- HOST_WIDE_INT offsets[2], offset; ++ HOST_WIDE_INT offsets[2], offset, align[2]; + rtx base = NULL_RTX; + rtx cur_base, cur_offset, tmp; + int i, gap; +@@ -15275,7 +15287,8 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + registers, and the corresponding memory offsets. */ + for (i = 0; i < nops; i++) + { +- if (!mem_ok_for_ldrd_strd (operands[nops+i], &cur_base, &cur_offset)) ++ if (!mem_ok_for_ldrd_strd (operands[nops+i], &cur_base, &cur_offset, ++ &align[i])) + return false; + + if (i == 0) +@@ -15389,6 +15402,7 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + /* Swap the instructions such that lower memory is accessed first. */ + std::swap (operands[0], operands[1]); + std::swap (operands[2], operands[3]); ++ std::swap (align[0], align[1]); + if (const_store) + std::swap (operands[4], operands[5]); + } +@@ -15402,6 +15416,9 @@ gen_operands_ldrd_strd (rtx *operands, bool load, + if (gap != 4) + return false; + ++ if (!align_ok_ldrd_strd (align[0], offset)) ++ return false; ++ + /* Make sure we generate legal instructions. */ + if (operands_ok_ldrd_strd (operands[0], operands[1], base, offset, + false, load)) +diff --git a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c +index eb2b86ee7b6..d49eff6b87e 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c +@@ -8,4 +8,4 @@ int foo(int a, int b, int* p, int *q) + *p = a; + return a; + } +-/* { dg-final { scan-assembler "ldrd" } } */ ++/* { dg-final { scan-assembler "ldrd\\t" } } */ +diff --git a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c b/gcc/testsuite/gcc.target/arm/peep-ldrd-2.c +similarity index 63% +copy from gcc/testsuite/gcc.target/arm/peep-ldrd-1.c +copy to gcc/testsuite/gcc.target/arm/peep-ldrd-2.c +index eb2b86ee7b6..6822c2b1454 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-ldrd-2.c +@@ -1,6 +1,6 @@ + /* { dg-do compile } */ + /* { dg-require-effective-target arm_prefer_ldrd_strd } */ +-/* { dg-options "-O2" } */ ++/* { dg-options "-O2 -mno-unaligned-access" } */ + int foo(int a, int b, int* p, int *q) + { + a = p[2] + p[3]; +@@ -8,4 +8,4 @@ int foo(int a, int b, int* p, int *q) + *p = a; + return a; + } +-/* { dg-final { scan-assembler "ldrd" } } */ ++/* { dg-final { scan-assembler-not "ldrd\\t" } } */ +diff --git a/gcc/testsuite/gcc.target/arm/peep-strd-1.c b/gcc/testsuite/gcc.target/arm/peep-strd-1.c +index bd330769599..fe1beac7229 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-strd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-strd-1.c +@@ -6,4 +6,4 @@ void foo(int a, int b, int* p) + p[2] = a; + p[3] = b; + } +-/* { dg-final { scan-assembler "strd" } } */ ++/* { dg-final { scan-assembler "strd\\t" } } */ +diff --git a/gcc/testsuite/gcc.target/arm/peep-strd-1.c b/gcc/testsuite/gcc.target/arm/peep-strd-2.c +similarity index 58% +copy from gcc/testsuite/gcc.target/arm/peep-strd-1.c +copy to gcc/testsuite/gcc.target/arm/peep-strd-2.c +index bd330769599..bfc5ebe9eec 100644 +--- a/gcc/testsuite/gcc.target/arm/peep-strd-1.c ++++ b/gcc/testsuite/gcc.target/arm/peep-strd-2.c +@@ -1,9 +1,9 @@ + /* { dg-do compile } */ + /* { dg-require-effective-target arm_prefer_ldrd_strd } */ +-/* { dg-options "-O2" } */ ++/* { dg-options "-O2 -mno-unaligned-access" } */ + void foo(int a, int b, int* p) + { + p[2] = a; + p[3] = b; + } +-/* { dg-final { scan-assembler "strd" } } */ ++/* { dg-final { scan-assembler-not "strd\\t" } } */ +-- +2.15.0 +