summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-05-28 18:15:43 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-05-28 18:16:38 +0100
commit72cb8bef5540cc97e369c0e5754af35add9e776d (patch)
treefb3200b97437c134eac7820deba810fde651a3ee
parent0498d005a489508a2dbd181d4cf145b2224a61de (diff)
downloadtoolchains-72cb8bef5540cc97e369c0e5754af35add9e776d.tar.gz
toolchains-72cb8bef5540cc97e369c0e5754af35add9e776d.tar.bz2
arm-unknown-riscos: update to 4.7.4r6
-rw-r--r--arm-unknown-riscos/Makefile4
-rw-r--r--arm-unknown-riscos/recipes/patches/gcc4/binutils-download.p4
-rw-r--r--arm-unknown-riscos/recipes/patches/gcc4/cloog-ppl-download.p2
-rw-r--r--arm-unknown-riscos/recipes/patches/gcc4/gmp-download.p4
-rw-r--r--arm-unknown-riscos/recipes/patches/gcc4/ppl-download.p4
-rw-r--r--arm-unknown-riscos/recipes/patches/gcc4/ppl-version.p175
-rw-r--r--arm-unknown-riscos/recipes/patches/gcc4/unixlib-ldrex-strex.p304
7 files changed, 9 insertions, 488 deletions
diff --git a/arm-unknown-riscos/Makefile b/arm-unknown-riscos/Makefile
index 64516de..017dcd9 100644
--- a/arm-unknown-riscos/Makefile
+++ b/arm-unknown-riscos/Makefile
@@ -1,5 +1,5 @@
# Use a tested trunk version of GCCSDK
-UPSTREAM_GCCSDK_VERSION := release_4_7_4_v2
+UPSTREAM_GCCSDK_VERSION := release_4_7_4_v6
UPSTREAM_GCCSDK_TARBALL := gcc4$(UPSTREAM_GCCSDK_VERSION).tar.gz
UPSTREAM_GCCSDK_URI := svn://svn.riscos.info/gccsdk/tags/$(UPSTREAM_GCCSDK_VERSION)
@@ -26,7 +26,7 @@ UPSTREAM_SQUEEZE_URI := git://git.netsurf-browser.org/squeeze.git
# Infozip
UPSTREAM_INFOZIP_VERSION := 30
UPSTREAM_INFOZIP_TARBALL := zip$(UPSTREAM_INFOZIP_VERSION).tar.gz
-UPSTREAM_INFOZIP_URI := http://downloads.sourceforge.net/project/infozip/Zip%203.x%20%28latest%29/3.0/$(UPSTREAM_INFOZIP_TARBALL)
+UPSTREAM_INFOZIP_URI := https://downloads.sourceforge.net/project/infozip/Zip%203.x%20%28latest%29/3.0/$(UPSTREAM_INFOZIP_TARBALL)
TOP := $(CURDIR)
RECIPES := $(TOP)/recipes
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/binutils-download.p b/arm-unknown-riscos/recipes/patches/gcc4/binutils-download.p
index 54720f5..3f2f110 100644
--- a/arm-unknown-riscos/recipes/patches/gcc4/binutils-download.p
+++ b/arm-unknown-riscos/recipes/patches/gcc4/binutils-download.p
@@ -4,9 +4,9 @@
# Download binutils source:
$(SRCORIGDIR)/binutils-$(BINUTILS_VERSION).tar.bz2:
-mkdir -p $(SRCORIGDIR)
-- cd $(SRCORIGDIR) && wget -c http://ftpmirror.gnu.org/binutils/binutils-$(BINUTILS_VERSION).tar.bz2
+- cd $(SRCORIGDIR) && wget -c https://ftpmirror.gnu.org/binutils/binutils-$(BINUTILS_VERSION).tar.bz2
- touch $@
-+ wget -O $@ -c http://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/binutils-$(BINUTILS_VERSION).tar.bz2
++ wget -O $@ -c https://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/binutils-$(BINUTILS_VERSION).tar.bz2
ifeq "$(GCC_USE_SCM)" "yes"
# Checkout gcc source:
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/cloog-ppl-download.p b/arm-unknown-riscos/recipes/patches/gcc4/cloog-ppl-download.p
index 194ef7f..6f91911 100644
--- a/arm-unknown-riscos/recipes/patches/gcc4/cloog-ppl-download.p
+++ b/arm-unknown-riscos/recipes/patches/gcc4/cloog-ppl-download.p
@@ -6,7 +6,7 @@
-mkdir -p $(SRCORIGDIR)
- cd $(SRCORIGDIR) && wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-ppl-$(CLOOG_VERSION).tar.gz
- touch $@
-+ wget -O $@ -c http://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/cloog-ppl-$(CLOOG_VERSION).tar.gz
++ wget -O $@ -c https://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/cloog-ppl-$(CLOOG_VERSION).tar.gz
# Download newlib source:
$(SRCORIGDIR)/newlib-$(NEWLIB_VERSION).tar.gz:
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/gmp-download.p b/arm-unknown-riscos/recipes/patches/gcc4/gmp-download.p
index 0bfd4ec..4f99d57 100644
--- a/arm-unknown-riscos/recipes/patches/gcc4/gmp-download.p
+++ b/arm-unknown-riscos/recipes/patches/gcc4/gmp-download.p
@@ -4,8 +4,8 @@
# Download mpc source:
$(SRCORIGDIR)/mpc-$(MPC_VERSION).tar.gz:
-mkdir -p $(SRCORIGDIR)
-- cd $(SRCORIGDIR) && wget -c http://www.multiprecision.org/mpc/download/mpc-$(MPC_VERSION).tar.gz
-+ cd $(SRCORIGDIR) && wget -c http://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/mpc-$(MPC_VERSION).tar.gz
+- cd $(SRCORIGDIR) && wget -c https://ftpmirror.gnu.org/mpc/mpc-$(MPC_VERSION).tar.gz
++ cd $(SRCORIGDIR) && wget -c https://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/mpc-$(MPC_VERSION).tar.gz
touch $@
# Download mpfr source:
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/ppl-download.p b/arm-unknown-riscos/recipes/patches/gcc4/ppl-download.p
index 7eb77c3..128e9eb 100644
--- a/arm-unknown-riscos/recipes/patches/gcc4/ppl-download.p
+++ b/arm-unknown-riscos/recipes/patches/gcc4/ppl-download.p
@@ -19,9 +19,9 @@
-$(SRCORIGDIR)/ppl-$(PPL_VERSION).tar.gz:
+$(SRCORIGDIR)/ppl-$(PPL_VERSION).tar.xz:
-mkdir -p $(SRCORIGDIR)
-- cd $(SRCORIGDIR) && wget -c http://www.cs.unipr.it/ppl/download/ftp/releases/$(PPL_VERSION)/ppl-$(PPL_VERSION).tar.gz
+- cd $(SRCORIGDIR) && wget -c https://www.bugseng.com/external/ppl/download/ftp/releases/$(PPL_VERSION)/ppl-$(PPL_VERSION).tar.gz
- touch $@
-+ wget -O $@ -c http://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/ppl-$(PPL_VERSION).tar.xz
++ wget -O $@ -c https://ci.netsurf-browser.org/toolchain/arm-unknown-riscos/ppl-$(PPL_VERSION).tar.xz
# Download CLooG source:
$(SRCORIGDIR)/cloog-ppl-$(CLOOG_VERSION).tar.gz:
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/ppl-version.p b/arm-unknown-riscos/recipes/patches/gcc4/ppl-version.p
deleted file mode 100644
index 7631c68..0000000
--- a/arm-unknown-riscos/recipes/patches/gcc4/ppl-version.p
+++ /dev/null
@@ -1,175 +0,0 @@
-Index: gcc4/Makefile
-===================================================================
---- gcc4/Makefile (revision 7156)
-+++ gcc4/Makefile (working copy)
-@@ -45,7 +45,7 @@
- MPFR_VERSION=3.0.1
- MPC_VERSION=0.8.2
- GCC_USE_PPL_CLOOG=yes
--PPL_VERSION=0.11.2
-+PPL_VERSION=1.2
- CLOOG_VERSION=0.15.11
- GCC_USE_LTO=yes
-
-@@ -182,8 +182,8 @@
- RONATIVE_MPFR_CONFIG_ARGS := --disable-shared --with-gmp=$(PREFIX_RONATIVEGCC_LIBS) --host=$(TARGET) --prefix=$(PREFIX_RONATIVEGCC_LIBS)
-
- # Configure arguments PPL:
--CROSS_PPL_CONFIG_ARGS := --disable-shared --disable-watchdog --with-gnu-ld --with-gmp-prefix=$(PREFIX_CROSSGCC_LIBS) --prefix=$(PREFIX_CROSSGCC_LIBS)
--RONATIVE_PPL_CONFIG_ARGS := --disable-shared --disable-watchdog --with-gnu-ld --with-gmp-prefix=$(PREFIX_RONATIVEGCC_LIBS) --host=$(TARGET) --prefix=$(PREFIX_RONATIVEGCC_LIBS)
-+CROSS_PPL_CONFIG_ARGS := --disable-shared --disable-watchdog --with-gnu-ld --with-gmp=$(PREFIX_CROSSGCC_LIBS) --prefix=$(PREFIX_CROSSGCC_LIBS)
-+RONATIVE_PPL_CONFIG_ARGS := --disable-shared --disable-watchdog --with-gnu-ld --with-gmp=$(PREFIX_RONATIVEGCC_LIBS) --host=$(TARGET) --prefix=$(PREFIX_RONATIVEGCC_LIBS)
-
- # Configure arguments CLooG:
- CROSS_CLOOG_CONFIG_ARGS := --disable-shared --with-gmp=$(PREFIX_CROSSGCC_LIBS) --with-bits=gmp --with-ppl=$(PREFIX_CROSSGCC_LIBS) --with-host-libstdcxx='-lstdc++' --prefix=$(PREFIX_CROSSGCC_LIBS)
-Index: gcc4/recipe/patches/cloog/configure.in.p
-===================================================================
---- gcc4/recipe/patches/cloog/configure.in.p (revision 7156)
-+++ gcc4/recipe/patches/cloog/configure.in.p (working copy)
-@@ -1,5 +1,5 @@
----- configure.in.orig 2013-05-01 16:15:33.235945936 +0200
--+++ configure.in 2013-05-01 16:15:15.484169106 +0200
-+--- configure.in.orig 2017-04-23 11:55:00.956204411 +0100
-++++ configure.in 2017-04-23 11:50:39.385519538 +0100
- @@ -41,7 +41,7 @@ dnl ************************************
- AC_PREREQ(2.13)
- AC_INIT(source/cloog.c)
-@@ -9,7 +9,13 @@
- dnl Every other copy of the package version number gets its value from here.
- AM_INIT_AUTOMAKE(cloog, 0.15)
- AC_CONFIG_HEADER(include/cloog/cloog-config.h)
--@@ -343,7 +343,7 @@ if test "x$with_ppl" != "x" -a "x$with_p
-+@@ -338,12 +338,12 @@ if test "x$with_ppl" != "x" -a "x$with_p
-+
-+ AC_MSG_CHECKING([for version 0.10 (or later revision) of PPL])
-+ AC_TRY_COMPILE([#include "ppl_c.h"],[
-+- #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 10
-++ #if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 10
-+ choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
-
-Index: gcc4/recipe/patches/gcc/configure.ac.p
-===================================================================
---- gcc4/recipe/patches/gcc/configure.ac.p (revision 7156)
-+++ gcc4/recipe/patches/gcc/configure.ac.p (working copy)
-@@ -1,6 +1,6 @@
- Index: configure.ac
- ===================================================================
----- configure.ac (revision 197339)
-+--- configure.ac (revision 247077)
- +++ configure.ac (working copy)
- @@ -152,6 +152,7 @@
- # Note that libiberty is not a target library.
-@@ -34,6 +34,15 @@
-
- if test "$enable_ppl_version_check" != no; then
- saved_CFLAGS="$CFLAGS"
-+@@ -1577,7 +1586,7 @@
-+ CFLAGS="$CFLAGS $pplinc $gmpinc"
-+ AC_MSG_CHECKING([for version 0.11 (revision 0 or later) of PPL])
-+ AC_TRY_COMPILE([#include "ppl_c.h"],[
-+- #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
-++ #if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11
-+ choke me
-+ #endif
-+ ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
- @@ -2895,6 +2904,10 @@
- ;;
- esac
-Index: gcc4/recipe/patches/ppl/src.Congruence_System.defs.hh.p
-===================================================================
---- gcc4/recipe/patches/ppl/src.Congruence_System.defs.hh.p (revision 7156)
-+++ gcc4/recipe/patches/ppl/src.Congruence_System.defs.hh.p (nonexistent)
-@@ -1,19 +0,0 @@
----- src/Congruence_System.defs.hh.orig 2015-03-01 19:57:52.887328139 +0100
--+++ src/Congruence_System.defs.hh 2015-03-01 19:57:12.315328259 +0100
--@@ -33,6 +33,7 @@ site: http://www.cs.unipr.it/ppl/ . */
-- #include "Grid.types.hh"
-- #include "Grid_Certificate.types.hh"
-- #include <iosfwd>
--+#include <cstddef>
--
-- namespace Parma_Polyhedra_Library {
--
--@@ -235,7 +236,7 @@ public:
-- class const_iterator
-- : public std::iterator<std::forward_iterator_tag,
-- Congruence,
--- ptrdiff_t,
--+ std::ptrdiff_t,
-- const Congruence*,
-- const Congruence&> {
-- public:
-Index: gcc4/recipe/patches/ppl/src.Constraint_System.defs.hh.p
-===================================================================
---- gcc4/recipe/patches/ppl/src.Constraint_System.defs.hh.p (revision 7156)
-+++ gcc4/recipe/patches/ppl/src.Constraint_System.defs.hh.p (nonexistent)
-@@ -1,19 +0,0 @@
----- src/Constraint_System.defs.hh.orig 2015-03-01 19:58:03.831328106 +0100
--+++ src/Constraint_System.defs.hh 2015-03-01 19:57:12.315328259 +0100
--@@ -33,6 +33,7 @@ site: http://www.cs.unipr.it/ppl/ . */
-- #include "Congruence_System.types.hh"
-- #include <iterator>
-- #include <iosfwd>
--+#include <cstddef>
--
-- namespace Parma_Polyhedra_Library {
--
--@@ -204,7 +205,7 @@ public:
-- class const_iterator
-- : public std::iterator<std::forward_iterator_tag,
-- Constraint,
--- ptrdiff_t,
--+ std::ptrdiff_t,
-- const Constraint*,
-- const Constraint&> {
-- public:
-Index: gcc4/recipe/patches/ppl/src.Generator_System.defs.hh.p
-===================================================================
---- gcc4/recipe/patches/ppl/src.Generator_System.defs.hh.p (revision 7156)
-+++ gcc4/recipe/patches/ppl/src.Generator_System.defs.hh.p (nonexistent)
-@@ -1,19 +0,0 @@
----- src/Generator_System.defs.hh.orig 2015-03-01 19:58:13.511328077 +0100
--+++ src/Generator_System.defs.hh 2015-03-01 19:57:12.319328259 +0100
--@@ -33,6 +33,7 @@ site: http://www.cs.unipr.it/ppl/ . */
-- #include "Polyhedron.types.hh"
-- #include "Poly_Con_Relation.defs.hh"
-- #include <iosfwd>
--+#include <cstddef>
--
-- namespace Parma_Polyhedra_Library {
--
--@@ -250,7 +251,7 @@ public:
-- class const_iterator
-- : public std::iterator<std::forward_iterator_tag,
-- Generator,
--- ptrdiff_t,
--+ std::ptrdiff_t,
-- const Generator*,
-- const Generator&> {
-- public:
-Index: gcc4/recipe/patches/ppl/src.Grid_Generator_System.defs.hh.p
-===================================================================
---- gcc4/recipe/patches/ppl/src.Grid_Generator_System.defs.hh.p (revision 7156)
-+++ gcc4/recipe/patches/ppl/src.Grid_Generator_System.defs.hh.p (nonexistent)
-@@ -1,19 +0,0 @@
----- src/Grid_Generator_System.defs.hh.orig 2015-03-01 19:57:31.127328203 +0100
--+++ src/Grid_Generator_System.defs.hh 2015-03-01 19:57:12.315328259 +0100
--@@ -30,6 +30,7 @@ site: http://www.cs.unipr.it/ppl/ . */
-- #include "Variables_Set.types.hh"
-- #include "Grid.types.hh"
-- #include <iosfwd>
--+#include <cstddef>
--
-- namespace Parma_Polyhedra_Library {
--
--@@ -267,7 +268,7 @@ public:
-- class const_iterator
-- : public std::iterator<std::forward_iterator_tag,
-- Grid_Generator,
--- ptrdiff_t,
--+ std::ptrdiff_t,
-- const Grid_Generator*,
-- const Grid_Generator&>,
-- private Generator_System::const_iterator {
diff --git a/arm-unknown-riscos/recipes/patches/gcc4/unixlib-ldrex-strex.p b/arm-unknown-riscos/recipes/patches/gcc4/unixlib-ldrex-strex.p
deleted file mode 100644
index 045a0b8..0000000
--- a/arm-unknown-riscos/recipes/patches/gcc4/unixlib-ldrex-strex.p
+++ /dev/null
@@ -1,304 +0,0 @@
-Backport r7043 from upstream: partially replaces use of SWP with LDREX/STREX
-on systems where SWP is no longer available. This fix is incomplete,
-but sufficient for our purposes.
-
-Fri Mar 11 14:51:54 GMT 2016 Lee Noar <leenoar@sky.com>
-
- * sys/_cpucaps.s: New file. Provide functions to probe the
- OS for details of the CPU (currently SWP, LDREX/STREX
- availability).
- * Makefile.am: Add above file.
- * include/unixlib/local.h: Add declarations for user facing
- functions provided above.
- * incl-local/internal/asm_dec.s(__ul_global): Add entry to
- record CPU flags.
- * incl-local/internal/unix.h: Likewise.
- * pthread/_ints.s(__pthread_disable_ints,__pthread_protect_unsafe):
- Use CPU flags to determine whether to use the SWP instruction or
- LRDEX/STREX.
- * sys/_syslib.s(__main): Add call to __probe_cpu_caps.
- (__unixlib_fatal): Use CPU flags to determine whether to use the
- SWP instruction or LRDEX/STREX.
-
-
-Index: gcc4/recipe/files/gcc/libunixlib/pthread/_ints.s
-===================================================================
---- gcc4/recipe/files/gcc/libunixlib/pthread/_ints.s (revision 7042)
-+++ gcc4/recipe/files/gcc/libunixlib/pthread/_ints.s (revision 7043)
-@@ -2,7 +2,7 @@
- @ disable_ints can be called multiple times, provided enable_ints is
- @ subsequently called an equal number of times
- @ Written by Martin Piper and Alex Waugh
--@ Copyright (c) 2002-2008 UnixLib Developers
-+@ Copyright (c) 2002-2016 UnixLib Developers
-
- #include "internal/asm_dec.s"
-
-@@ -20,15 +20,26 @@
- PICEQ "LDR a2, [a2, #0]"
- PICEQ "LDR a2, [a2, #__GOTT_INDEX__]" @ a2 = GOT ptr
-
-- LDR a1, .L0 @=__ul_global
-+ LDR a1, .L0 @ =__ul_global
- PICEQ "LDR a1, [a2, a1]"
-+ LDR a4, [a1, #GBL_CPU_FLAGS]
- ADD a1, a1, #GBL_PTH_WORKSEMAPHORE
-+ TST a4, #__CPUCAP_HAVE_SWP
-+ @ From this point onwards we will not be interrupted by the callback
-+ BEQ 0f
-+
- MOV a3, #1
- SWP a2, a3, [a1]
-- @ From this point onwards we will not be interrupted by the callback
- ADD a2, a2, #1
- STR a2, [a1]
- MOV pc, lr
-+0:
-+ LDREX a2, [a1]
-+ ADD a2, a2, #1
-+ STREX a3, a2, [a1]
-+ TEQ a3, #1
-+ BEQ 0b
-+ MOV pc, lr
- .L0:
- WORD __ul_global
- DECLARE_FUNCTION __pthread_disable_ints
-@@ -78,18 +89,32 @@
- PICEQ "LDR a1, [a1, #0]"
- PICEQ "LDR a1, [a1, #__GOTT_INDEX__]" @ a1 = GOT ptr
-
-- LDR a4, .L2 @=__ul_global
-+ LDR a4, .L2 @ =__ul_global
- PICEQ "LDR a4, [a1, a4]"
-+ LDR a2, [a4, #GBL_CPU_FLAGS]
- ADD a1, a4, #GBL_PTH_WORKSEMAPHORE
-+ TST a2, #__CPUCAP_HAVE_SWP
-+ @ From this point onwards we cannot be interrupted by the callback
-+ BEQ 0f
-+
- MOV a2, #1
- SWP a3, a2, [a1]
-- @ From this point onwards we cannot be interrupted by the callback
- CMP a3, #0
-- STRNE a3, [a1, #0] @ Restore original value
-+ BEQ 1f
-+ STR a3, [a1, #0] @ Restore original value
- @ Return, as if ints are disabled on entry to the
- @ calling function then they should not be reenabled
- @ until the calling function has returned
-+ MOV pc, lr
-+0:
-+ LDREX a3, [a1]
-+ MOV ip, #1
-+ STREX a2, ip, [a1]
-+ TEQ a2, #1
-+ BEQ 0b
-+ TEQ a3, #0
- MOVNE pc, lr
-+1:
-
- #if __UNIXLIB_PARANOID
- LDR a3, [a4, #GBL_PTH_RETURN_ADDRESS]
-Index: gcc4/recipe/files/gcc/libunixlib/include/unixlib/local.h
-===================================================================
---- gcc4/recipe/files/gcc/libunixlib/include/unixlib/local.h (revision 7042)
-+++ gcc4/recipe/files/gcc/libunixlib/include/unixlib/local.h (revision 7043)
-@@ -133,6 +133,16 @@
- socket. Is -1 when socket handle is not valid. */
- extern int __get_ro_socket (int __sockfd);
-
-+/* Return 1 if the SWP instruction is available, otherwise 0. */
-+extern unsigned int __cpucap_have_swp (void);
-+
-+/* Return 1 if the LDREX/STREX instructions are available, otherwise 0. */
-+extern unsigned int __cpucap_have_rex (void);
-+
-+/* Return 1 if the LDREX/STREX instructions that operate on bytes, half-words
-+ and double words are available, otherwise 0. */
-+extern unsigned int __cpucap_have_rexbhd (void);
-+
- __END_DECLS
-
- #endif
- * incl-local/internal/asm_dec.s(XSOM_DeregisterClient): Add
-Index: gcc4/recipe/files/gcc/libunixlib/Makefile.am
-===================================================================
---- gcc4/recipe/files/gcc/libunixlib/Makefile.am (revision 7042)
-+++ gcc4/recipe/files/gcc/libunixlib/Makefile.am (revision 7043)
-@@ -1027,6 +1027,7 @@
- sys/sigsetjmp.c \
- sys/stackalloc.c \
- sys/vfork.c \
-+ sys/_cpucaps.s \
- sys/_getcpuarch.s \
- sys/_jmp.s \
- sys/_mman.s \
-Index: gcc4/recipe/files/gcc/libunixlib/incl-local/internal/asm_dec.s
-===================================================================
---- gcc4/recipe/files/gcc/libunixlib/incl-local/internal/asm_dec.s (revision 7042)
-+++ gcc4/recipe/files/gcc/libunixlib/incl-local/internal/asm_dec.s (revision 7043)
-@@ -269,8 +269,10 @@
- .set GBL_FLS_LBSTM_ON_RD, 108 @ = __ul_global.fls_lbstm_on_rd
- .set GBL_PTH_CALLEVERY_RMA, 112 @ = __ul_global.pthread_callevery_rma
-
-+.set GBL_CPU_FLAGS, 116 @ = __ul_global.cpu_flags
-+
- #if !defined(__SOFTFP__) && defined(__VFP_FP__)
--.set GBL_VFP_REGCOUNT, 116 @ = __ul_global.vfp_regcount
-+.set GBL_VFP_REGCOUNT, 120 @ = __ul_global.vfp_regcount
- #endif
-
- @ Entries in the __ul_memory table. Must be kept in sync with
-@@ -322,3 +324,7 @@
- .set CRT1_LIB_FINI, 32 @ Ptr to function to finalise shared libraries
- @ at program exit - can be NULL.
- #endif
-+
-+#define __CPUCAP_HAVE_SWP 0x1
-+#define __CPUCAP_HAVE_REX 0x2
-+#define __CPUCAP_HAVE_REXBHD 0x4
-Index: gcc4/recipe/files/gcc/libunixlib/incl-local/internal/unix.h
-===================================================================
---- gcc4/recipe/files/gcc/libunixlib/incl-local/internal/unix.h (revision 7042)
-+++ gcc4/recipe/files/gcc/libunixlib/incl-local/internal/unix.h (revision 7043)
-@@ -197,6 +197,8 @@
- the life of the program. This block is passed to the call_every handler in
- r12. */
-
-+ unsigned int cpu_flags; /* Flags indicating the capabilities of the CPU. */
-+
- #if !defined(__SOFTFP__) && defined(__VFP_FP__)
- int vfp_regcount; /* Number of doubleword registers we should request for
- VFP contexts */
-Index: gcc4/recipe/files/gcc/libunixlib/sys/_cpucaps.s
-===================================================================
---- gcc4/recipe/files/gcc/libunixlib/sys/_cpucaps.s (revision 0)
-+++ gcc4/recipe/files/gcc/libunixlib/sys/_cpucaps.s (revision 7043)
-@@ -0,0 +1,91 @@
-+@ Determine the capabilities of the CPU and allow callers to enquire
-+@ what they are.
-+@ Copyright (c) 2016 UnixLib Developers.
-+@ Written by Lee Noar.
-+
-+#include "internal/asm_dec.s"
-+
-+ .text
-+
-+@ Determine what the CPU capabilities are, and record them.
-+@ Called early on during program initialisation in _syslib.s.
-+ .global __probe_cpu_caps
-+ NAME __probe_cpu_caps
-+__probe_cpu_caps:
-+ MOV r0, #0
-+ SWI XOS_PlatformFeatures
-+ MOVVS r0, #0
-+
-+ MOV r2, #0
-+ @ The OS flag is set to 1 to indicate _no_ SWP instruction available (for
-+ @ backwards compatibility). We reverse it here and set our flag to 1 to
-+ @ indicate that SWP _is_ available.
-+ TST r0, #1<<11 @ SWP{B} not available
-+ ORREQ r2, r2, #__CPUCAP_HAVE_SWP
-+ TST r0, #1<<12 @ LDREX/STREX available
-+ ORRNE r2, r2, #__CPUCAP_HAVE_REX
-+ TST r0, #1<<13 @ LDREX/STREX{B/H/D} available
-+ ORRNE r2, r2, #__CPUCAP_HAVE_REXBHD
-+
-+ PICEQ "LDR r0, =__GOTT_BASE__"
-+ PICEQ "LDR r0, [r0, #0]"
-+ PICEQ "LDR r0, [r0, #__GOTT_INDEX__]" @ r0 = GOT ptr
-+ LDR r1, .L0 @ =__ul_global
-+ PICEQ "LDR r1, [r0, r1]"
-+ STR r2, [r1, #GBL_CPU_FLAGS]
-+
-+ MOV pc, lr
-+.L0:
-+ WORD __ul_global
-+ DECLARE_FUNCTION __probe_cpu_caps
-+
-+ .global __cpucap_have_swp
-+ NAME __cpucap_have_swp
-+__cpucap_have_swp:
-+ PICEQ "LDR r0, =__GOTT_BASE__"
-+ PICEQ "LDR r0, [r0, #0]"
-+ PICEQ "LDR r0, [r0, #__GOTT_INDEX__]" @ r0 = GOT ptr
-+ LDR r1, .L0 @ =__ul_global
-+ PICEQ "LDR r1, [r0, r1]"
-+ LDR r0, [r1, #GBL_CPU_FLAGS]
-+ TST r0, #__CPUCAP_HAVE_SWP
-+ MOVEQ r0, #0
-+ MOVNE r0, #1
-+
-+ MOV pc, lr
-+ DECLARE_FUNCTION __cpucap_have_swp
-+
-+@ Return 1 if LDREX/STREX instructions are available on the CPU, otherwise 0.
-+ .global __cpucap_have_rex
-+ NAME __cpucap_have_rex
-+__cpucap_have_rex:
-+ PICEQ "LDR r0, =__GOTT_BASE__"
-+ PICEQ "LDR r0, [r0, #0]"
-+ PICEQ "LDR r0, [r0, #__GOTT_INDEX__]" @ r0 = GOT ptr
-+ LDR r1, .L0 @ =__ul_global
-+ PICEQ "LDR r1, [r0, r1]"
-+ LDR r0, [r1, #GBL_CPU_FLAGS]
-+ TST r0, #__CPUCAP_HAVE_REX
-+ MOVEQ r0, #0
-+ MOVNE r0, #1
-+
-+ MOV pc, lr
-+ DECLARE_FUNCTION __cpucap_have_rex
-+
-+@ Return 1 if LDREX/STREX instructions that work on non-32 bit data sizes
-+@ are available on the CPU, otherwise 0.
-+ .global __cpucap_have_rexbhd
-+ NAME __cpucap_have_rexbhd
-+__cpucap_have_rexbhd:
-+ PICEQ "LDR r0, =__GOTT_BASE__"
-+ PICEQ "LDR r0, [r0, #0]"
-+ PICEQ "LDR r0, [r0, #__GOTT_INDEX__]" @ r0 = GOT ptr
-+ LDR r1, .L0 @ =__ul_global
-+ PICEQ "LDR r1, [r0, r1]"
-+ LDR r0, [r1, #GBL_CPU_FLAGS]
-+ TST r0, #__CPUCAP_HAVE_REXBHD
-+ MOVEQ r0, #0
-+ MOVNE r0, #1
-+
-+ MOV pc, lr
-+ DECLARE_FUNCTION __cpucap_have_rexbhd
-Index: gcc4/recipe/files/gcc/libunixlib/sys/_syslib.s
-===================================================================
---- gcc4/recipe/files/gcc/libunixlib/sys/_syslib.s (revision 7042)
-+++ gcc4/recipe/files/gcc/libunixlib/sys/_syslib.s (revision 7043)
-@@ -255,6 +255,8 @@
- BCC __exit_with_error_num
- unknown_cpu_arch:
-
-+ BL __probe_cpu_caps
-+
- @ Use of DAs explicitly overridden if __dynamic_no_da is declared
- MOV lr, #-1
- STR lr, [ip, #GBL_DYNAMIC_NUM]
-@@ -1286,9 +1288,21 @@
- @ error handling. As last resort to avoid an infinite loop
- @ we go for a straight OS_Exit scenario. Anything better we
- @ can do ?
-+ ADD a3, a4, #GBL_PANIC_MODE
-+ LDR a2, [a4, #GBL_CPU_FLAGS]
-+ TST a2, #__CPUCAP_HAVE_SWP
-+ BEQ 0f
-+
- MOV a2, #1
-- ADD a3, a4, #GBL_PANIC_MODE
- SWP a2, a2, [a3]
-+ B 1f
-+0:
-+ LDREX a2, [a3]
-+ MOV ip, #1
-+ STREX lr, ip, [a3]
-+ TEQ lr, #1
-+ BEQ 0b
-+1:
- TEQ a2, #0
- BEQ __unixlib_fatal_cont1
-