Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/5] Misc fixes predominantly for musl
@ 2017-11-09  1:58 Khem Raj
  2017-11-09  1:58 ` [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines Khem Raj
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Khem Raj @ 2017-11-09  1:58 UTC (permalink / raw)
  To: openembedded-core

upgrade musl past 1.1.18 release
fix armv5 codegen issue seen with gcc7 while compiling kernel
fix systemd for musl/64-bit
make binutils SRC_URI overridable
Fix go with PIE/musl

The following changes since commit 3717c76eb24217c14a22f72fdd8732923729dee8:

  gcc: fix miscompilation on mips64 (2017-11-08 22:23:45 +0000)

are available in the Git repository at:

  git://git.openembedded.org/openembedded-core-contrib kraj/pu
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=kraj/pu

Khem Raj (5):
  binutils: Convert SRC_URI and SRCREV to weak defines
  go: Fix build with PIE on musl
  systemd: Fix build with musl/mips64
  musl: Update to 1.1.18
  gcc7/gcc6: Fix unaligned STRD issue on ARM

 meta/recipes-core/musl/musl_git.bb                 |   4 +-
 .../0001-Use-uintmax_t-for-handling-rlim_t.patch   |  89 ++++++++++
 meta/recipes-core/systemd/systemd_234.bb           |   1 +
 meta/recipes-devtools/binutils/binutils-2.29.inc   |   5 +-
 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 +++++++++++++++++++++
 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 ++++++++++++
 11 files changed, 617 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-Use-uintmax_t-for-handling-rlim_t.patch
 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
 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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines
  2017-11-09  1:58 [PATCH 0/5] Misc fixes predominantly for musl Khem Raj
@ 2017-11-09  1:58 ` Khem Raj
  2017-11-09 20:54   ` Burton, Ross
  2017-11-09  1:58 ` [PATCH 2/5] go: Fix build with PIE on musl Khem Raj
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Khem Raj @ 2017-11-09  1:58 UTC (permalink / raw)
  To: openembedded-core

This makes it easy to override them in bbappends

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/binutils/binutils-2.29.inc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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<pver>\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 \
-- 
2.15.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] go: Fix build with PIE on musl
  2017-11-09  1:58 [PATCH 0/5] Misc fixes predominantly for musl Khem Raj
  2017-11-09  1:58 ` [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines Khem Raj
@ 2017-11-09  1:58 ` Khem Raj
  2017-11-09  1:58 ` [PATCH 3/5] systemd: Fix build with musl/mips64 Khem Raj
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Khem Raj @ 2017-11-09  1:58 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 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

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 <raj.khem@gmail.com>
+
+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 <raj.khem@gmail.com>
+
+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"
-- 
2.15.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] systemd: Fix build with musl/mips64
  2017-11-09  1:58 [PATCH 0/5] Misc fixes predominantly for musl Khem Raj
  2017-11-09  1:58 ` [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines Khem Raj
  2017-11-09  1:58 ` [PATCH 2/5] go: Fix build with PIE on musl Khem Raj
@ 2017-11-09  1:58 ` Khem Raj
  2017-11-09  1:58 ` [PATCH 4/5] musl: Update to 1.1.18 Khem Raj
  2017-11-09  1:58 ` [PATCH 5/5] gcc7/gcc6: Fix unaligned STRD issue on ARM Khem Raj
  4 siblings, 0 replies; 12+ messages in thread
From: Khem Raj @ 2017-11-09  1:58 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../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

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 <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+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"
 
-- 
2.15.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] musl: Update to 1.1.18
  2017-11-09  1:58 [PATCH 0/5] Misc fixes predominantly for musl Khem Raj
                   ` (2 preceding siblings ...)
  2017-11-09  1:58 ` [PATCH 3/5] systemd: Fix build with musl/mips64 Khem Raj
@ 2017-11-09  1:58 ` Khem Raj
  2017-12-02  0:31   ` Andre McCurdy
  2017-11-09  1:58 ` [PATCH 5/5] gcc7/gcc6: Fix unaligned STRD issue on ARM Khem Raj
  4 siblings, 1 reply; 12+ messages in thread
From: Khem Raj @ 2017-11-09  1:58 UTC (permalink / raw)
  To: openembedded-core

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 <raj.khem@gmail.com>
---
 meta/recipes-core/musl/musl_git.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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
 
-- 
2.15.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] gcc7/gcc6: Fix unaligned STRD issue on ARM
  2017-11-09  1:58 [PATCH 0/5] Misc fixes predominantly for musl Khem Raj
                   ` (3 preceding siblings ...)
  2017-11-09  1:58 ` [PATCH 4/5] musl: Update to 1.1.18 Khem Raj
@ 2017-11-09  1:58 ` Khem Raj
  4 siblings, 0 replies; 12+ messages in thread
From: Khem Raj @ 2017-11-09  1:58 UTC (permalink / raw)
  To: openembedded-core

Backport
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82445

Fixes [YOCTO 12297]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 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

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 <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
+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 <raj.khem@gmail.com>
+
+ 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 <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
+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 <raj.khem@gmail.com>
+
+ 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
+
-- 
2.15.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines
  2017-11-09  1:58 ` [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines Khem Raj
@ 2017-11-09 20:54   ` Burton, Ross
  2017-11-09 22:49     ` Khem Raj
  0 siblings, 1 reply; 12+ messages in thread
From: Burton, Ross @ 2017-11-09 20:54 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]

How does this help?  A bbappend is parsed after the bb so it can just
assign to SRCREV.

Also is it actually useful to change the git url but apply the same patches?

Ross

On 9 November 2017 at 01:58, Khem Raj <raj.khem@gmail.com> wrote:

> This makes it easy to override them in bbappends
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-devtools/binutils/binutils-2.29.inc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> 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<pver>\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
> \
> --
> 2.15.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 2862 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines
  2017-11-09 20:54   ` Burton, Ross
@ 2017-11-09 22:49     ` Khem Raj
  0 siblings, 0 replies; 12+ messages in thread
From: Khem Raj @ 2017-11-09 22:49 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Thu, Nov 9, 2017 at 12:54 PM, Burton, Ross <ross.burton@intel.com> wrote:
> How does this help?  A bbappend is parsed after the bb so it can just assign
> to SRCREV.
>
> Also is it actually useful to change the git url but apply the same patches?
>

yes, this helps with using local forks of upstream and at the same
time apply the
patches from OE-Core being on same version. Especially for new archirectures
where all support may not be upstream.

> Ross
>
> On 9 November 2017 at 01:58, Khem Raj <raj.khem@gmail.com> wrote:
>>
>> This makes it easy to override them in bbappends
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/recipes-devtools/binutils/binutils-2.29.inc | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> 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<pver>\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 \
>> --
>> 2.15.0
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] musl: Update to 1.1.18
  2017-11-09  1:58 ` [PATCH 4/5] musl: Update to 1.1.18 Khem Raj
@ 2017-12-02  0:31   ` Andre McCurdy
  2017-12-02  0:37     ` Khem Raj
  0 siblings, 1 reply; 12+ messages in thread
From: Andre McCurdy @ 2017-12-02  0:31 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE Core mailing list

On Wed, Nov 8, 2017 at 5:58 PM, Khem Raj <raj.khem@gmail.com> wrote:
> 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

With the version of musl currently included in rocko, various apps
(including bash) segfault at startup when compiled as Thumb2. The "fix
access by setjmp and longjmp to __hwcap on arm built as thumb2" commit
from musl 1.1.18 fixes that.

However the other changes in musl 1.1.18 look pretty useful too, so
unless there's strong objection, I'd like to suggest aligning rocko
with the musl 1.1.18 release. ie cherry-picking the following two
commits from oe-core master to rocko:

  c3f0a70 musl: Update to 1.1.18
  3953c54 musl: Update to latest


> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-core/musl/musl_git.bb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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
>
> --
> 2.15.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] musl: Update to 1.1.18
  2017-12-02  0:31   ` Andre McCurdy
@ 2017-12-02  0:37     ` Khem Raj
  2017-12-02  0:41       ` Andre McCurdy
  0 siblings, 1 reply; 12+ messages in thread
From: Khem Raj @ 2017-12-02  0:37 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: OE Core mailing list

On Fri, Dec 1, 2017 at 4:31 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
> On Wed, Nov 8, 2017 at 5:58 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> 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
>
> With the version of musl currently included in rocko, various apps
> (including bash) segfault at startup when compiled as Thumb2. The "fix
> access by setjmp and longjmp to __hwcap on arm built as thumb2" commit
> from musl 1.1.18 fixes that.
>
> However the other changes in musl 1.1.18 look pretty useful too, so
> unless there's strong objection, I'd like to suggest aligning rocko
> with the musl 1.1.18 release. ie cherry-picking the following two
> commits from oe-core master to rocko:
>
>   c3f0a70 musl: Update to 1.1.18
>   3953c54 musl: Update to latest
>

It seems good to me. Please send a pull and CC Armin

>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/recipes-core/musl/musl_git.bb | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> 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
>>
>> --
>> 2.15.0
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] musl: Update to 1.1.18
  2017-12-02  0:37     ` Khem Raj
@ 2017-12-02  0:41       ` Andre McCurdy
  2018-02-09 19:52         ` Andre McCurdy
  0 siblings, 1 reply; 12+ messages in thread
From: Andre McCurdy @ 2017-12-02  0:41 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE Core mailing list

On Fri, Dec 1, 2017 at 4:37 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Fri, Dec 1, 2017 at 4:31 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
>> On Wed, Nov 8, 2017 at 5:58 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>> 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
>>
>> With the version of musl currently included in rocko, various apps
>> (including bash) segfault at startup when compiled as Thumb2. The "fix
>> access by setjmp and longjmp to __hwcap on arm built as thumb2" commit
>> from musl 1.1.18 fixes that.
>>
>> However the other changes in musl 1.1.18 look pretty useful too, so
>> unless there's strong objection, I'd like to suggest aligning rocko
>> with the musl 1.1.18 release. ie cherry-picking the following two
>> commits from oe-core master to rocko:
>>
>>   c3f0a70 musl: Update to 1.1.18
>>   3953c54 musl: Update to latest
>
> It seems good to me. Please send a pull and CC Armin

Armin, please consider the following two commits for rocko:

  c3f0a70 musl: Update to 1.1.18
  3953c54 musl: Update to latest

>>
>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ---
>>>  meta/recipes-core/musl/musl_git.bb | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> 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
>>>
>>> --
>>> 2.15.0
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] musl: Update to 1.1.18
  2017-12-02  0:41       ` Andre McCurdy
@ 2018-02-09 19:52         ` Andre McCurdy
  0 siblings, 0 replies; 12+ messages in thread
From: Andre McCurdy @ 2018-02-09 19:52 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE Core mailing list

On Fri, Dec 1, 2017 at 4:41 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
> On Fri, Dec 1, 2017 at 4:37 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Fri, Dec 1, 2017 at 4:31 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
>>> On Wed, Nov 8, 2017 at 5:58 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>>> 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
>>>
>>> With the version of musl currently included in rocko, various apps
>>> (including bash) segfault at startup when compiled as Thumb2. The "fix
>>> access by setjmp and longjmp to __hwcap on arm built as thumb2" commit
>>> from musl 1.1.18 fixes that.
>>>
>>> However the other changes in musl 1.1.18 look pretty useful too, so
>>> unless there's strong objection, I'd like to suggest aligning rocko
>>> with the musl 1.1.18 release. ie cherry-picking the following two
>>> commits from oe-core master to rocko:
>>>
>>>   c3f0a70 musl: Update to 1.1.18
>>>   3953c54 musl: Update to latest
>>
>> It seems good to me. Please send a pull and CC Armin
>
> Armin, please consider the following two commits for rocko:
>
>   c3f0a70 musl: Update to 1.1.18
>   3953c54 musl: Update to latest

Ping.

Any comments Armin?


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-09 19:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-09  1:58 [PATCH 0/5] Misc fixes predominantly for musl Khem Raj
2017-11-09  1:58 ` [PATCH 1/5] binutils: Convert SRC_URI and SRCREV to weak defines Khem Raj
2017-11-09 20:54   ` Burton, Ross
2017-11-09 22:49     ` Khem Raj
2017-11-09  1:58 ` [PATCH 2/5] go: Fix build with PIE on musl Khem Raj
2017-11-09  1:58 ` [PATCH 3/5] systemd: Fix build with musl/mips64 Khem Raj
2017-11-09  1:58 ` [PATCH 4/5] musl: Update to 1.1.18 Khem Raj
2017-12-02  0:31   ` Andre McCurdy
2017-12-02  0:37     ` Khem Raj
2017-12-02  0:41       ` Andre McCurdy
2018-02-09 19:52         ` Andre McCurdy
2017-11-09  1:58 ` [PATCH 5/5] gcc7/gcc6: Fix unaligned STRD issue on ARM Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox