Skip to contentSkip to conversation

strace: Fix build for arc, metag, nios2, or1k, tile

PATCH New Marek Vasut 1 participant 8 messages Feb 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/7 strace: Fix build for arc, metag, nios2, or1k, tile

Upstream strace 4.11 does not build for arc, metag, nios2, or1k, tile. Backport patch from strace git master to fix the build issue.

Cc Robert Yang <[email protected]>
Cc Richard Purdie <[email protected]>
Cc Ross Burton <[email protected]>

---
V2: Add SoB line to the backported patch

---
 .../0001-arc-metag-nios2-or1k-tile-fix-build.patch | 117 +++++++++++++++++++++
 meta/recipes-devtools/strace/strace_4.11.bb        |   1 +
 2 files changed, 118 insertions(+)
 create mode 100644 meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch
meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch new file +117 -0
new file mode 100644
index 0000000..a9d3203
@@ -0,0 +1,117 @@
+From dd1a80c8d213eed95fe55b7ebcb07ee165dd8e4b Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <[email protected]>
+Date: Thu, 24 Dec 2015 15:40:55 +0000
+Subject: [PATCH] arc, metag, nios2, or1k, tile: fix build
+
+Fix build regression introduced by commit
+34683e3926d8c2daa368afb805da422ee7043396.
+
+* linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
+* linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
+* linux/nios2/syscallent.h: Likewise.
+* linux/or1k/syscallent.h: Likewise.
+* linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
+* pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
+* NEWS: Mention this build fix.
+
+Reported-by: Alexey Brodkin <[email protected]>
+Signed-off-by: Marek Vasut <[email protected]>
+Upstream-Status: Backport
+---
+ NEWS                     | 3 +++
+ linux/32/syscallent.h    | 6 +++---
+ linux/arc/syscallent.h   | 2 +-
+ linux/nios2/syscallent.h | 2 +-
+ linux/or1k/syscallent.h  | 2 +-
+ linux/tile/syscallent1.h | 2 +-
+ pathtrace.c              | 1 +
+ 7 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index fe40ca4..09263eb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,3 +1,9 @@
++Noteworthy changes in release ?.?? (????-??-??)
++===============================================
++
++* Bug fixes
++  * Fixed build on arc, metag, nios2, or1k, and tile architectures.
++
+ Noteworthy changes in release 4.11 (2015-12-21)
+ ===============================================
+ 
+diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
+index 5f997e7..e6f895c 100644
+--- a/linux/32/syscallent.h
++++ b/linux/32/syscallent.h
+@@ -1,5 +1,5 @@
+-#ifndef ARCH_mmap
+-# define ARCH_mmap mmap
++#ifndef sys_ARCH_mmap
++# define sys_ARCH_mmap sys_mmap
+ #endif
+ [  0] = { 2,	0,		SEN(io_setup),			"io_setup"		},
+ [  1] = { 1,	0,		SEN(io_destroy),		"io_destroy"		},
+@@ -276,5 +276,5 @@
+ [283] = { 2,	0,		SEN(membarrier),		"membarrier",		},
+ [284] = { 3,	TM,		SEN(mlock2),			"mlock2"		},
+ 
+-#undef ARCH_mmap
++#undef sys_ARCH_mmap
+ #undef ARCH_WANT_SYNC_FILE_RANGE2
+diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h
+index 5847dc4..1100008 100644
+--- a/linux/arc/syscallent.h
++++ b/linux/arc/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3,	0,	SEN(printargs),	"arc_cacheflush"},
+ [245] = { 1,	0,	SEN(printargs),	"arc_settls"	},
+diff --git a/linux/nios2/syscallent.h b/linux/nios2/syscallent.h
+index 8a4b70e..01efe3a 100644
+--- a/linux/nios2/syscallent.h
++++ b/linux/nios2/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = {4,    0,	SEN(cacheflush), "cacheflush"},
+ [245 ... 259] = { },
+diff --git a/linux/or1k/syscallent.h b/linux/or1k/syscallent.h
+index ed84b3b..351fe25 100644
+--- a/linux/or1k/syscallent.h
++++ b/linux/or1k/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3,	NF,	SEN(or1k_atomic),	"or1k_atomic"	},
+ [245 ... 259] = { },
+diff --git a/linux/tile/syscallent1.h b/linux/tile/syscallent1.h
+index c86f059..28dbab4 100644
+--- a/linux/tile/syscallent1.h
++++ b/linux/tile/syscallent1.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_4koff
++#define sys_ARCH_mmap sys_mmap_4koff
+ #define ARCH_WANT_SYNC_FILE_RANGE2 1
+ #include "32/syscallent.h"
+ [244] = { 1,	0,	SEN(printargs),	"cmpxchg_badaddr"	},
+diff --git a/pathtrace.c b/pathtrace.c
+index d530ec2..e72cdf7 100644
+--- a/pathtrace.c
++++ b/pathtrace.c
+@@ -216,6 +216,7 @@ pathtrace_match(struct tcb *tcp)
+ 	case SEN_mmap:
+ 	case SEN_mmap_4koff:
+ 	case SEN_mmap_pgoff:
++	case SEN_ARCH_mmap:
+ 		/* x, x, x, x, fd */
+ 		return fdmatch(tcp, tcp->u_arg[4]);
+ 
+-- 
+2.6.4
+
meta/recipes-devtools/strace/strace_4.11.bb +1 -0
index a72a1f9..6b889de 100644
@@ -8,6 +8,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
            file://disable-git-version-gen.patch \
            file://more-robust-test-for-m32-mx32-compile-support.patch \
            file://update-gawk-paths.patch \
+           file://0001-arc-metag-nios2-or1k-tile-fix-build.patch \
            file://Makefile-ptest.patch \
            file://run-ptest \
           "
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 2/7 binutils: Repair nios2 PLT and GP handling

Repair corner cases in nios2 PLT and GP handling. See the patches themselves for extensive detailed explanation.

The patches don't contain the ChangeLog entries, since the changelog entries often cause trouble when applying the patch.

Cc Ross Burton <[email protected]>
Cc Richard Purdie <[email protected]>

---
V2: Add SoB lines to the backported patches
Update to binutils 2.26

---
 meta/recipes-devtools/binutils/binutils-2.26.inc   |   2 +
 ...ress-computations-in-initial-PLT-entries-.patch |  72 ++++++++++++++
 ...014-Correct-nios2-_gp-address-computation.patch | 106 +++++++++++++++++++++
 3 files changed, 180 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch
meta/recipes-devtools/binutils/binutils-2.26.inc +2 -0
index c955471..dd5c8ca 100644
@@ -32,6 +32,8 @@ SRC_URI = "\
      file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
      file://0011-Change-default-emulation-for-mips64-linux.patch \
      file://0012-Add-XLP-instructions-support.patch \
+     file://0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch \
+     file://0014-Correct-nios2-_gp-address-computation.patch \
      "
 S  = "${WORKDIR}/git"
 
meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch new file +72 -0

72 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch new file +106 -0

106 lines not on this page · raw message

Signature · 1 line
2.1.4
#2 lore raw

PATCH 3/7 dpkg: Update to 1.18.4

In reply to Marek Vasut

Update dpkg version to 1.18.4 . This adds nios2 architecture support among other fixes. One patch was updated so it would apply to 1.18.4.

Cc Alexander Kanavin <[email protected]>
Cc Richard Purdie <[email protected]>
Cc Ross Burton <[email protected]>
---
 ...g-do_package_write_deb-we-have-trees-of-h.patch | 52 +++++++++++++---------
 .../dpkg/{dpkg_1.18.2.bb => dpkg_1.18.4.bb}        |  4 +-
 2 files changed, 32 insertions(+), 24 deletions(-)
 rename meta/recipes-devtools/dpkg/{dpkg_1.18.2.bb => dpkg_1.18.4.bb} (85%)
meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch +30 -22
index 6967ef4..49ef853 100644
@@ -1,7 +1,7 @@
-From d14ffd786993da60ca84c4812da8a6594a8c764e Mon Sep 17 00:00:00 2001
+From e391bdba238d1371fc5b67cdae08b06eb5ada5c2 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Wed, 26 Aug 2015 15:48:13 +0300
-Subject: [PATCH 1/5] When running do_package_write_deb, we have trees of
+Subject: [PATCH] When running do_package_write_deb, we have trees of
  hardlinked files such as the dbg source files in ${PN}-dbg. If something
  makes another copy of one of those files (or deletes one), the number of
  links a file has changes and tar can notice this, e.g.:
@@ -19,23 +19,43 @@ place to avoid that kind of issue).
 Upstream-Status: Inappropriate
 RP 2015/3/27
 ---
- dpkg-deb/build.c | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
+ dpkg-deb/build.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
 
 diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
-index ea3d861..1589927 100644
+index 2ddeec6..af363f0 100644
 --- a/dpkg-deb/build.c
 +++ b/dpkg-deb/build.c
-@@ -458,7 +458,7 @@ do_build(const char *const *argv)
+@@ -452,7 +452,7 @@ static void
+ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+              struct compress_params *tar_compress_params, int fd_out)
+ {
+-  int pipe_filenames[2], pipe_tarball[2];
++  int pipe_filenames[2], pipe_tarball[2], rc;
+   pid_t pid_tar, pid_comp;
+ 
+   /* Fork off a tar. We will feed it a list of filenames on stdin later. */
+@@ -493,7 +493,9 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+   /* All done, clean up wait for tar and <compress> to finish their job. */
+   close(pipe_filenames[1]);
+   subproc_reap(pid_comp, _("<compress> from tar -cf"), 0);
+-  subproc_reap(pid_tar, "tar -cf", 0);
++  rc = subproc_reap(pid_tar, "tar -cf", SUBPROC_RETERROR);
++  if (rc && rc != 1)
++    ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
+ }
+ 
+ /**
+@@ -509,7 +511,7 @@ do_build(const char *const *argv)
    char *debar;
    char *tfbuf;
    int arfd;
--  int p1[2], p2[2], gzfd;
-+  int p1[2], p2[2], gzfd, rc;
+-  int p1[2], gzfd;
++  int p1[2], gzfd, rc;
    pid_t c1, c2;
  
    /* Decode our arguments. */
-@@ -538,7 +538,9 @@ do_build(const char *const *argv)
+@@ -590,7 +592,9 @@ do_build(const char *const *argv)
    }
    close(p1[0]);
    subproc_reap(c2, _("<compress> from tar -cf"), 0);
@@ -46,18 +66,6 @@ index ea3d861..1589927 100644
  
    if (lseek(gzfd, 0, SEEK_SET))
      ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
-@@ -626,7 +628,10 @@ do_build(const char *const *argv)
-   /* All done, clean up wait for tar and <compress> to finish their job. */
-   close(p1[1]);
-   subproc_reap(c2, _("<compress> from tar -cf"), 0);
--  subproc_reap(c1, "tar -cf", 0);
-+  rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
-+  if (rc && rc != 1)
-+    ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
-+
-   /* Okay, we have data.tar as well now, add it to the ar wrapper. */
-   if (deb_format.major == 2) {
-     char datamember[16 + 1];
 -- 
-2.1.4
+2.7.0
 
meta/recipes-devtools/dpkg/dpkg_1.18.4.bb renamed from meta/recipes-devtools/dpkg/dpkg_1.18.2.bb +2 -2
similarity index 85%
rename from meta/recipes-devtools/dpkg/dpkg_1.18.2.bb
rename to meta/recipes-devtools/dpkg/dpkg_1.18.4.bb
index eab896c..76fb2d1 100644
@@ -16,6 +16,6 @@ SRC_URI += "file://noman.patch \
 	    file://dpkg-CVE-2015-0860.patch \
            "
 
-SRC_URI[md5sum] = "63b9d869081ec49adeef6c5ff62d6576"
-SRC_URI[sha256sum] = "11484f2a73d027d696e720a60380db71978bb5c06cd88fe30c291e069ac457a4"
+SRC_URI[md5sum] = "e95b513c89693f6ec3ab53b6b1c3defd"
+SRC_URI[sha256sum] = "fe89243868888ce715bf45861f26264f767d4e4dbd0d6f1a26ce60bbbbf106da"
 
Signature · 1 line
2.1.4
#3 lore raw

Re: [PATCH 3/7] dpkg: Update to 1.18.4

Quoted 7 lines · Marek Vasut

Update dpkg version to 1.18.4 . This adds nios2 architecture support among other fixes. One patch was updated so it would apply to 1.18.4.

Cc Alexander Kanavin <[email protected]>
Cc Richard Purdie <[email protected]>
Cc Ross Burton <[email protected]>

Looks like I will have to do a V2 of this dpkg patch, please skip this one and I will repost it after I do one more rebuild. The other patches should be fine.

#4 lore raw

PATCH 4/7 guile: Fix nios2 support

In reply to Marek Vasut

Add minor patch to recognize nios2 build target.

Cc Richard Purdie <[email protected]>
Cc Ross Burton <[email protected]>
---
 ...002-Recognize-nios2-as-compilation-target.patch | 36 ++++++++++++++++++++++
 meta/recipes-devtools/guile/guile_2.0.11.bb        |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch
meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch new file +36 -0
new file mode 100644
index 0000000..519585b
@@ -0,0 +1,36 @@
+From 76155065c70b5ab65c6c805423183b360141db84 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <[email protected]>
+Date: Thu, 28 Jan 2016 04:46:23 +0100
+Subject: [PATCH] Recognize nios2 as compilation target
+
+Signed-off-by: Marek Vasut <[email protected]>
+Upstream-Status: Submitted [ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22480 ]
+---
+ module/system/base/target.scm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/module/system/base/target.scm b/module/system/base/target.scm
+index d60a8e0..d1f6cff 100644
+--- a/module/system/base/target.scm
++++ b/module/system/base/target.scm
+@@ -65,7 +65,7 @@
+       (cond ((string-match "^i[0-9]86$" cpu)
+              (endianness little))
+             ((member cpu '("x86_64" "ia64"
+-                           "powerpcle" "powerpc64le" "mipsel" "mips64el"))
++                           "powerpcle" "powerpc64le" "mipsel" "mips64el" "nios2"))
+              (endianness little))
+             ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+                            "mips" "mips64"))
+@@ -100,7 +100,7 @@
+ 
+           ((string-match "64$" cpu) 8)
+           ((string-match "64[lbe][lbe]$" cpu) 8)
+-          ((member cpu '("sparc" "powerpc" "mips" "mipsel")) 4)
++          ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2")) 4)
+           ((string-match "^arm.*" cpu) 4)
+           (else (error "unknown CPU word size" cpu)))))
+ 
+-- 
+2.7.0.rc3
+
meta/recipes-devtools/guile/guile_2.0.11.bb +1 -0
index 6815e25..6cefe66 100644
@@ -25,6 +25,7 @@ SRC_URI = "${GNU_MIRROR}/guile/guile-${PV}.tar.xz \
            file://libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch \
            file://remove_strcase_l_funcs.patch \
            file://0001-libguile-Check-for-strtol_l-during-configure.patch \
+           file://0002-Recognize-nios2-as-compilation-target.patch \
            "
 
 #           file://debian/0001-Change-guile-to-guile-X.Y-for-info-pages.patch
Signature · 1 line
2.1.4
#5 lore raw

PATCH 5/7 nspr: Add nios2 support

In reply to Marek Vasut

Add small patch to support nios2 in NSPR.

Cc Richard Purdie <[email protected]>
Cc Ross Burton <[email protected]>
---
 .../nspr/nspr/0002-Add-nios2-support.patch         | 105 +++++++++++++++++++++
 meta/recipes-support/nspr/nspr_4.11.bb             |   1 +
 2 files changed, 106 insertions(+)
 create mode 100644 meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch
meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch new file +105 -0
new file mode 100644
index 0000000..2322806
@@ -0,0 +1,105 @@
+From 95bda64fb4cf1825fea745e918cfe8202843f0ba Mon Sep 17 00:00:00 2001
+From: Marek Vasut <[email protected]>
+Date: Sat, 30 Jan 2016 07:18:02 +0100
+Subject: [PATCH] Add nios2 support
+
+Add support for the nios2 CPU.
+
+Signed-off-by: Marek Vasut <[email protected]>
+Upstream-Status: Submitted [ https://bugzilla.mozilla.org/show_bug.cgi?id=1244421 ]
+---
+ nspr/pr/include/md/_linux.cfg | 45 +++++++++++++++++++++++++++++++++++++++++++
+ nspr/pr/include/md/_linux.h   | 14 ++++++++++++++
+ 2 files changed, 59 insertions(+)
+
+diff --git a/pr/include/md/_linux.cfg b/nspr/pr/include/md/_linux.cfg
+index 8cbf0cb..150676b 100644
+--- a/pr/include/md/_linux.cfg
++++ b/pr/include/md/_linux.cfg
+@@ -972,6 +972,51 @@
+ #define PR_BYTES_PER_WORD_LOG2   2
+ #define PR_BYTES_PER_DWORD_LOG2  3
+ 
++#elif defined(__nios2__)
++
++#define IS_LITTLE_ENDIAN    1
++#undef  IS_BIG_ENDIAN
++
++#define PR_BYTES_PER_BYTE   1
++#define PR_BYTES_PER_SHORT  2
++#define PR_BYTES_PER_INT    4
++#define PR_BYTES_PER_INT64  8
++#define PR_BYTES_PER_LONG   4
++#define PR_BYTES_PER_FLOAT  4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD   4
++#define PR_BYTES_PER_DWORD  8
++
++#define PR_BITS_PER_BYTE    8
++#define PR_BITS_PER_SHORT   16
++#define PR_BITS_PER_INT     32
++#define PR_BITS_PER_INT64   64
++#define PR_BITS_PER_LONG    32
++#define PR_BITS_PER_FLOAT   32
++#define PR_BITS_PER_DOUBLE  64
++#define PR_BITS_PER_WORD    32
++
++#define PR_BITS_PER_BYTE_LOG2   3
++#define PR_BITS_PER_SHORT_LOG2  4
++#define PR_BITS_PER_INT_LOG2    5
++#define PR_BITS_PER_INT64_LOG2  6
++#define PR_BITS_PER_LONG_LOG2   5
++#define PR_BITS_PER_FLOAT_LOG2  5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2   5
++
++#define PR_ALIGN_OF_SHORT   2
++#define PR_ALIGN_OF_INT     4
++#define PR_ALIGN_OF_LONG    4
++#define PR_ALIGN_OF_INT64   4
++#define PR_ALIGN_OF_FLOAT   4
++#define PR_ALIGN_OF_DOUBLE  4
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD    4
++
++#define PR_BYTES_PER_WORD_LOG2   2
++#define PR_BYTES_PER_DWORD_LOG2  3
++
+ #elif defined(__or1k__)
+ 
+ #undef  IS_LITTLE_ENDIAN
+diff --git a/pr/include/md/_linux.h b/nspr/pr/include/md/_linux.h
+index d378db5..18260be 100644
+--- a/pr/include/md/_linux.h
++++ b/pr/include/md/_linux.h
+@@ -55,6 +55,8 @@
+ #define _PR_SI_ARCHITECTURE "avr32"
+ #elif defined(__m32r__)
+ #define _PR_SI_ARCHITECTURE "m32r"
++#elif defined(__nios2__)
++#define _PR_SI_ARCHITECTURE "nios2"
+ #elif defined(__or1k__)
+ #define _PR_SI_ARCHITECTURE "or1k"
+ #else
+@@ -125,6 +127,18 @@ extern PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval);
+ #define _MD_ATOMIC_SET                _PR_x86_64_AtomicSet
+ #endif
+ 
++#if defined(__nios2__)
++#if defined(__GNUC__)
++/* Use GCC built-in functions */
++#define _PR_HAVE_ATOMIC_OPS
++#define _MD_INIT_ATOMIC()
++#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1)
++#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1)
++#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i)
++#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv)
++#endif
++#endif
++
+ #if defined(__or1k__)
+ #if defined(__GNUC__)
+ /* Use GCC built-in functions */
+-- 
+2.7.0.rc3
+
meta/recipes-support/nspr/nspr_4.11.bb +1 -0
index 3dabcb6..a38e20c 100644
@@ -9,6 +9,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz
            file://remove-rpath-from-tests.patch \
            file://fix-build-on-x86_64.patch \
            file://remove-srcdir-from-configure-in.patch \
+	   file://0002-Add-nios2-support.patch \
           "
 
 SRC_URI += "file://nspr.pc.in"
Signature · 1 line
2.1.4
#6 lore raw

PATCH v2 6/7 liburcu: Add nios2 support

In reply to Marek Vasut

Add support for the nios2 into the liburcu.

Cc Richard Purdie <[email protected]>
Cc Ross Burton <[email protected]>

---
V2: Patch is now Backport
The patch is updated according to mainline feedback

NOTE: LICENSE file checksum changed, because the patch adds an entry into the
LICENSE file.

---
 .../0001-Support-for-NIOS2-architecture.patch      | 144 +++++++++++++++++++++
 meta/recipes-support/liburcu/liburcu_0.9.1.bb      |   8 +-
 2 files changed, 149 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch
meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch new file +144 -0
new file mode 100644
index 0000000..690872b
@@ -0,0 +1,144 @@
+From add566b913e1b5cd4974a2167157dc08d8245ab0 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <[email protected]>
+Date: Tue, 9 Feb 2016 01:52:26 +0100
+Subject: [PATCH] Support for NIOS2 architecture
+
+Add support for the Altera NIOS2 CPU archirecture. The atomic operations
+are handled by the GCC. The memory barriers on this systems are entirely
+trivial too, since the CPU does not support SMP at all.
+
+Signed-off-by: Marek Vasut <[email protected]>
+Upstream-Status: Backport [ http://git.lttng.org/?p=userspace-rcu.git;a=commit;h=859050b3088aa3f0cb59d7f51ce24b9a0f18faa5 ]
+---
+ LICENSE              |  1 +
+ README.md            |  1 +
+ configure.ac         |  1 +
+ urcu/arch/nios2.h    | 40 ++++++++++++++++++++++++++++++++++++++++
+ urcu/uatomic/nios2.h | 32 ++++++++++++++++++++++++++++++++
+ 5 files changed, 75 insertions(+)
+ create mode 100644 urcu/arch/nios2.h
+ create mode 100644 urcu/uatomic/nios2.h
+
+diff --git a/LICENSE b/LICENSE
+index 3147094..a06fdcc 100644
+--- a/LICENSE
++++ b/LICENSE
+@@ -45,6 +45,7 @@ compiler.h
+ arch/s390.h
+ uatomic/alpha.h
+ uatomic/mips.h
++uatomic/nios2.h
+ uatomic/s390.h
+ system.h
+ 
+diff --git a/README.md b/README.md
+index f6b290f..6fe9c1e 100644
+--- a/README.md
++++ b/README.md
+@@ -43,6 +43,7 @@ Currently, the following architectures are supported:
+   - S390, S390x
+   - ARM 32/64
+   - MIPS
++  - NIOS2
+   - Alpha
+   - ia64
+   - Sparcv9 32/64
+diff --git a/configure.ac b/configure.ac
+index 39a7777..71a7d71 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -124,6 +124,7 @@ AS_CASE([$host_cpu],
+ 	[arm*], [ARCHTYPE="arm"],
+ 	[aarch64], [ARCHTYPE="aarch64"],
+ 	[mips*], [ARCHTYPE="mips"],
++	[nios2*], [ARCHTYPE="nios2"],
+ 	[tile*], [ARCHTYPE="tile"],
+ 	[hppa*], [ARCHTYPE="hppa"],
+ 	[ARCHTYPE="unknown"]
+diff --git a/urcu/arch/nios2.h b/urcu/arch/nios2.h
+new file mode 100644
+index 0000000..030d1bc
+--- /dev/null
++++ b/urcu/arch/nios2.h
+@@ -0,0 +1,40 @@
++#ifndef _URCU_ARCH_NIOS2_H
++#define _URCU_ARCH_NIOS2_H
++
++/*
++ * arch_nios2.h: trivial definitions for the NIOS2 architecture.
++ *
++ * Copyright (c) 2016 Marek Vasut <[email protected]>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#include <urcu/compiler.h>
++#include <urcu/config.h>
++#include <urcu/syscall-compat.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define cmm_mb()	cmm_barrier()
++
++#ifdef __cplusplus
++}
++#endif
++
++#include <urcu/arch/generic.h>
++
++#endif /* _URCU_ARCH_NIOS2_H */
+diff --git a/urcu/uatomic/nios2.h b/urcu/uatomic/nios2.h
+new file mode 100644
+index 0000000..5b3c303
+--- /dev/null
++++ b/urcu/uatomic/nios2.h
+@@ -0,0 +1,32 @@
++#ifndef _URCU_UATOMIC_ARCH_NIOS2_H
++#define _URCU_UATOMIC_ARCH_NIOS2_H
++
++/*
++ * Atomic exchange operations for the NIOS2 architecture. Let GCC do it.
++ *
++ * Copyright (c) 2016 Marek Vasut <[email protected]>
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to
++ * deal in the Software without restriction, including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ * sell copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <urcu/compiler.h>
++#include <urcu/system.h>
++#include <urcu/uatomic/generic.h>
++
++#endif /* _URCU_UATOMIC_ARCH_NIOS2_H */
+-- 
+2.7.0
+
meta/recipes-support/liburcu/liburcu_0.9.1.bb +5 -3
index 39348d7..dccc05c 100644
@@ -3,12 +3,14 @@ HOMEPAGE = "http://lttng.org/urcu"
 BUGTRACKER = "http://lttng.org/project/issues"
 
 LICENSE = "LGPLv2.1+ & MIT-style"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0f060c30a27922ce9c0d557a639b4fa3 \
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e548d28737289d75a8f1e01ba2fd7825 \
                     file://urcu.h;beginline=4;endline=32;md5=4de0d68d3a997643715036d2209ae1d9 \
                     file://urcu/uatomic/x86.h;beginline=4;endline=21;md5=58e50bbd8a2f073bb5500e6554af0d0b"
 
-SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
-          "
+SRC_URI = " \
+	http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
+	file://0001-Support-for-NIOS2-architecture.patch \
+	"
 
 SRC_URI[md5sum] = "124eaeea06863271c0bdf2a0cc1d8e4b"
 SRC_URI[sha256sum] = "f8d278e9d95bec97c9ba954fc4c3fb584936bc0010713a8fe358b916bafd8715"
Signature · 1 line
2.1.4
#7 lore raw

PATCH v2 7/7 oprofile: Add nios2 support

In reply to Marek Vasut

Add support for the nios2 architecture.

Cc Richard Purdie <[email protected]>
Cc Ross Burton <[email protected]>

---
V2: Patch is now Submitted

---
 meta/recipes-kernel/oprofile/oprofile.inc          |  3 ++-
 ...Add-rmb-definition-for-NIOS2-architecture.patch | 30 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch
meta/recipes-kernel/oprofile/oprofile.inc +2 -1
index faf0e53..cf3ad43 100644
@@ -23,7 +23,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
            file://automake-foreign.patch \
            file://oprofile-cross-compile-tests.patch \
            file://run-ptest \
-           file://root-home-dir.patch"
+           file://root-home-dir.patch \
+           file://0001-Add-rmb-definition-for-NIOS2-architecture.patch"
 
 SRC_URI_append_libc-musl = " file://musl.patch"
 
meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch new file +30 -0
new file mode 100644
index 0000000..ae8562a
@@ -0,0 +1,30 @@
+From 34b0d9b1a32fb404a30327a7ae8931c7c75583bf Mon Sep 17 00:00:00 2001
+From: Marek Vasut <[email protected]>
+Date: Tue, 9 Feb 2016 02:00:29 +0100
+Subject: [PATCH] Add rmb() definition for NIOS2 architecture
+
+Signed-off-by: Marek Vasut <[email protected]>
+Upstream-Status: Submitted [ http://marc.info/?l=oprofile-list&m=145501915931874&w=2 ]
+---
+ libperf_events/operf_utils.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h
+index 32954cc..8270e53 100644
+--- a/libperf_events/operf_utils.h
++++ b/libperf_events/operf_utils.h
+@@ -178,6 +178,11 @@ void op_release_resources(void);
+ #define cpu_relax()	asm volatile("" ::: "memory")
+ #endif
+ 
++#ifdef __nios2__
++#define rmb()		asm volatile("" ::: "memory")
++#define cpu_relax()	asm volatile("" ::: "memory")
++#endif
++
+ #ifdef __tile__
+ #include <asm/unistd.h>
+ #define rmb()		__insn_mf()
+-- 
+2.7.0
+
Signature · 1 line
2.1.4