unify patches

This commit is contained in:
Dave Murphy 2026-01-07 12:12:20 +00:00
parent e755556799
commit ae56dba8d0
No known key found for this signature in database
GPG Key ID: F7FD5492264BB9D0
12 changed files with 1474 additions and 30018 deletions

View File

@ -181,7 +181,7 @@ if [ ! -z $CROSSBUILD ]; then
BUILDDIR=$BUILDDIR-$CROSSBUILD
fi
patchdir=$(pwd)/$basedir/patches
patchdir=$(pwd)/patches
scriptdir=$(pwd)/$basedir/scripts
archives="binutils-${BINUTILS_VER}.tar.xz gcc-${GCC_VER}.tar.xz newlib-${NEWLIB_VER}.tar.gz"

View File

@ -1,362 +0,0 @@
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 40b50dc969e..debd0f3d3b2 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1192,7 +1192,14 @@ aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
tmake_file="${tmake_file} aarch64/t-aarch64"
case $target in
aarch64-*-elf*)
+ default_use_cxa_atexit=yes
use_gcc_stdint=wrap
+ tm_file="${tm_file} devkitpro.h"
+ tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
+ extra_options="${extra_options} devkitpro.opt"
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
;;
aarch64-*-fuchsia*)
tm_file="${tm_file} fuchsia.h"
diff --git a/gcc/config/aarch64/aarch64-elf-raw.h b/gcc/config/aarch64/aarch64-elf-raw.h
index 15cf1eb0389..aba0e9bbff9 100644
--- a/gcc/config/aarch64/aarch64-elf-raw.h
+++ b/gcc/config/aarch64/aarch64-elf-raw.h
@@ -22,6 +22,7 @@
#ifndef GCC_AARCH64_ELF_RAW_H
#define GCC_AARCH64_ELF_RAW_H
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group"
#define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
#define ENDFILE_SPEC \
" crtend%O%s crtn%O%s " \
diff --git a/gcc/config/aarch64/aarch64-opts.h b/gcc/config/aarch64/aarch64-opts.h
index a6ca5cf016b..90470fd6c44 100644
--- a/gcc/config/aarch64/aarch64-opts.h
+++ b/gcc/config/aarch64/aarch64-opts.h
@@ -91,7 +91,8 @@ enum aarch64_tp_reg {
AARCH64_TPIDR_EL1 = 1,
AARCH64_TPIDR_EL2 = 2,
AARCH64_TPIDR_EL3 = 3,
- AARCH64_TPIDRRO_EL0 = 4
+ AARCH64_TPIDRRO_EL0 = 4,
+ AARCH64_TP_SOFT = 5
};
/* SVE vector register sizes. */
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 433ec975d7e..d4c3835a15a 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -21378,8 +21378,24 @@ aarch64_load_tp (rtx target)
|| !register_operand (target, Pmode))
target = gen_reg_rtx (Pmode);
- /* Can return in any reg. */
- emit_insn (gen_aarch64_load_tp_hard (target));
+ if (TARGET_HARD_TP)
+ {
+ /* Can return in any reg. */
+ emit_insn (gen_aarch64_load_tp_hard (target));
+ }
+ else
+ {
+ /* Always returned in r0. Immediately copy the result into a pseudo,
+ otherwise other uses of r0 (e.g. setting up function arguments) may
+ clobber the value. */
+
+ rtx tmp;
+
+ emit_insn (gen_aarch64_load_tp_soft ());
+
+ tmp = gen_rtx_REG (DImode, R0_REGNUM);
+ emit_move_insn (target, tmp);
+ }
return target;
}
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index e8bd8c73c12..4fc0d8f4ded 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -1436,6 +1436,10 @@ typedef struct
/* Check TLS Descriptors mechanism is selected. */
#define TARGET_TLS_DESC (aarch64_tls_dialect == TLS_DESCRIPTORS)
+/* Check selected thread pointer access sequence to use. */
+#define TARGET_HARD_TP (aarch64_tpidr_reg != AARCH64_TP_SOFT)
+#define TARGET_SOFT_TP (aarch64_tpidr_reg == AARCH64_TP_SOFT)
+
extern enum aarch64_code_model aarch64_cmodel;
/* When using the tiny addressing model conditional and unconditional branches
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 031e621c98a..0fcf0aa703f 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -7702,11 +7702,22 @@
(define_insn "aarch64_load_tp_hard"
[(set (match_operand:DI 0 "register_operand" "=r")
(unspec:DI [(const_int 0)] UNSPEC_TLS))]
- ""
+ "TARGET_HARD_TP"
"* return aarch64_output_load_tp (operands[0]);"
[(set_attr "type" "mrs")]
)
+(define_insn "aarch64_load_tp_soft"
+ [(set (reg:DI 0) (unspec:DI [(const_int 0)] UNSPEC_TLS))
+ (clobber (reg:DI IP0_REGNUM))
+ (clobber (reg:DI IP1_REGNUM))
+ (clobber (reg:DI LR_REGNUM))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_SOFT_TP"
+ "bl\\t__aarch64_read_tp\\t// aarch64_load_tp_soft"
+ [(set_attr "type" "branch")]
+)
+
;; The TLS ABI specifically requires that the compiler does not schedule
;; instructions in the TLS stubs, in order to enable linker relaxation.
;; Therefore we treat the stubs as an atomic sequence.
diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt
index f32d56d4ffa..7cf8d3ba3d4 100644
--- a/gcc/config/aarch64/aarch64.opt
+++ b/gcc/config/aarch64/aarch64.opt
@@ -137,6 +137,9 @@ Enum(tp_reg) String(tpidr_el3) Value(AARCH64_TPIDR_EL3)
EnumValue
Enum(tp_reg) String(tpidrro_el0) Value(AARCH64_TPIDRRO_EL0)
+EnumValue
+Enum(tp_reg) String(soft) Value(AARCH64_TP_SOFT)
+
mtp=
Target RejectNegative Joined Enum(tp_reg) Var(aarch64_tpidr_reg) Init(AARCH64_TPIDR_EL0) Save
Specify the thread pointer register.
@@ -338,7 +341,7 @@ TargetVariable
long aarch64_stack_protector_guard_offset = 0
moutline-atomics
-Target Var(aarch64_flag_outline_atomics) Init(2) Save
+Target Var(aarch64_flag_outline_atomics) Save
Generate local calls to out-of-line atomic operations.
-param=aarch64-vect-compare-costs=
diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64
index 59571948479..f50c37d8b3c 100644
--- a/gcc/config/aarch64/t-aarch64
+++ b/gcc/config/aarch64/t-aarch64
@@ -198,8 +198,10 @@ aarch64-ldp-fusion.o: $(srcdir)/config/aarch64/aarch64-ldp-fusion.cc \
$(srcdir)/config/aarch64/aarch64-ldp-fusion.cc
comma=,
-MULTILIB_OPTIONS = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG))))
-MULTILIB_DIRNAMES = $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
+MULTILIB_OPTIONS = mcmodel=large fPIC
+MULTILIB_DIRNAMES = large pic
+MULTILIB_REQUIRED = mcmodel=large fPIC
+MULTILIB_MATCHES = fPIC=fpic fPIC=fpie fPIC=fPIE
insn-conditions.md: s-check-sve-md
s-check-sve-md: $(srcdir)/config/aarch64/check-sve-md.awk \
diff --git a/gcc/config/devkitpro.h b/gcc/config/devkitpro.h
new file mode 100644
index 00000000000..a25459e4352
--- /dev/null
+++ b/gcc/config/devkitpro.h
@@ -0,0 +1,32 @@
+/* Definitions for devkitPro toolchains.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC 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 General Public
+ License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__DEVKITA64__"); \
+ builtin_define ("__DEVKITPRO__"); \
+ } while (0)
+
+
diff --git a/gcc/config/devkitpro.opt b/gcc/config/devkitpro.opt
new file mode 100644
index 00000000000..9acbbf9d27c
--- /dev/null
+++ b/gcc/config/devkitpro.opt
@@ -0,0 +1,29 @@
+; Options for devkitPro toolchains.
+
+; Copyright (C) 2011-2018 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC 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 General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/devkitpro.opt.urls b/gcc/config/devkitpro.opt.urls
new file mode 100644
index 00000000000..ab7b466aa71
--- /dev/null
+++ b/gcc/config/devkitpro.opt.urls
@@ -0,0 +1 @@
+; Autogenerated by regenerate-opt-urls.py from gcc/config/devkitpro.opt and generated HTML
diff --git a/gcc/config/i386/host-mingw32.cc b/gcc/config/i386/host-mingw32.cc
index e083f49f3da..1b81e7e88ce 100644
--- a/gcc/config/i386/host-mingw32.cc
+++ b/gcc/config/i386/host-mingw32.cc
@@ -94,6 +94,10 @@ mingw32_gt_pch_get_address (size_t size, int)
If we allocate at bottom we need to reserve the address as early
as possible and at the same point in each invocation. */
+#if __MINGW64__
+ size = UINT64_C(64 * 1024 * 1024 * 1024);
+#endif
+
res = VirtualAlloc (NULL, size,
MEM_RESERVE | MEM_TOP_DOWN,
PAGE_NOACCESS);
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 4fd87f2c4a1..6af06f7b032 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -888,6 +888,11 @@ proper position among the other output files. */
#endif
#endif
+#ifndef LIBGLOSS_SPEC
+# define LIBGLOSS_SPEC "-lsysbase"
+#endif
+
+
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
#ifndef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -1215,6 +1220,7 @@ static const char *link_spec = LINK_SPEC;
static const char *lib_spec = LIB_SPEC;
static const char *link_gomp_spec = "";
static const char *libgcc_spec = LIBGCC_SPEC;
+static const char *libgloss_spec = LIBGLOSS_SPEC;
static const char *endfile_spec = ENDFILE_SPEC;
static const char *startfile_spec = STARTFILE_SPEC;
static const char *linker_name_spec = LINKER_NAME;
@@ -1727,6 +1733,7 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("lib", &lib_spec),
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
+ INIT_STATIC_SPEC ("libgloss", &libgloss_spec),
INIT_STATIC_SPEC ("startfile", &startfile_spec),
INIT_STATIC_SPEC ("cross_compile", &cross_compile),
INIT_STATIC_SPEC ("version", &compiler_version),
diff --git a/libcc1/configure b/libcc1/configure
index ea689a353c8..98f9d9b21b7 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -5119,7 +5119,7 @@ else
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+ $tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index b9767cd1eee..362689c9f0b 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -326,7 +326,7 @@ register_tm_clones (void)
#ifdef OBJECT_FORMAT_ELF
-#if DEFAULT_USE_CXA_ATEXIT
+#if 1 /* DEFAULT_USE_CXA_ATEXIT */
/* Declare the __dso_handle variable. It should have a unique value
in every shared-object; in a main program its value is zero. The
object should in any case be protected. This means the instance
diff --git a/libgcc/gthr.h b/libgcc/gthr.h
index 557417997f4..1269ece007f 100644
--- a/libgcc/gthr.h
+++ b/libgcc/gthr.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The pe-coff weak support isn't fully compatible to ELF's weak.
For static libraries it might would work, but as we need to deal
with shared versions too, we disable it for mingw-targets. */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(__DEVKITA64__)
#undef GTHREAD_USE_WEAK
#define GTHREAD_USE_WEAK 0
#endif
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 537774c2668..76da4f35b96 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1436,6 +1436,7 @@ ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
+ -e 's/_GLIBCXX___DEVKITA64_GLIBCXX___/__DEVKITA64__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< $< > $@
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 7b96b2207f8..817de242772 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -1910,6 +1910,7 @@ ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
+ -e 's/_GLIBCXX___DEVKITA64_GLIBCXX___/__DEVKITA64__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< $< > $@
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 28f5dd79cd7..a79f318a4d6 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -6469,7 +6469,7 @@ else
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+ $tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
break
;;
*)

File diff suppressed because one or more lines are too long

View File

@ -1,593 +0,0 @@
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 40b50dc969e..16b1224f3ec 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1508,6 +1508,11 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
tm_file="$tm_file newlib-stdint.h"
tmake_file="${tmake_file} arm/t-bpabi"
use_gcc_stdint=wrap
+ tm_file="${tm_file} devkitpro.h"
+ extra_options="${extra_options} devkitpro.opt"
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
;;
arm*-*-fuchsia*)
tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
index 1939d55b9fd..62d425cb596 100644
--- a/gcc/config/arm/arm-cpus.in
+++ b/gcc/config/arm/arm-cpus.in
@@ -416,7 +416,7 @@ begin arch armv6k
tune for mpcore
tune flags CO_PROC
base 6K
- isa ARMv6k
+ isa ARMv6k VFPv2 FP_DBL
option fp add VFPv2 FP_DBL
optalias vfpv2 fp
option nofp remove ALL_FP
diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
index fdfdf9c580b..add129f0a62 100644
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -16,120 +16,22 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Build a very basic set of libraries that should cater for most cases.
-
-# Single-precision floating-point is NOT supported; we don't build a
-# suitable library for that. Use the rm-profile config in that case.
-
-# PART 1 - Useful groups of options
-
-dp_fpus := vfp vfpv2 vfpv3 vfpv3-fp16 vfpv3-d16 vfpv3-d16-fp16 \
- neon neon-vfpv3 neon-fp16 vfpv4 neon-vfpv4 vfpv4-d16 \
- fpv5-d16 fp-armv8 neon-fp-armv8 crypto-neon-fp-armv8 \
- vfp3
-
-sp_fpus := vfpv3xd vfpv3xd-fp16 fpv4-sp-d16 fpv5-sp-d16
-
-v7a_fps := vfpv3 vfpv3-fp16 vfpv4 simd neon-fp16 neon-vfpv4
-v7ve_fps := vfpv3-d16 vfpv3 vfpv3-d16-fp16 vfpv3-fp16 vfpv4 neon \
- neon-fp16 simd
-
-# Not all these permutations exist for all architecture variants, but
-# it seems to work ok.
-v8_fps := simd fp16 crypto fp16+crypto dotprod fp16fml
-
-v9_fps := simd fp16 crypto fp16+crypto dotprod fp16fml
-
-# We don't do anything special with these. Pre-v4t probably doesn't work.
-all_early_nofp := armv4 armv4t armv5t
-
-all_early_arch := armv5tej armv6 armv6j armv6k armv6z armv6kz \
- armv6zk armv6t2 iwmmxt iwmmxt2
-
-all_v7_a_r := armv7-a armv7ve armv7-r
-
-all_v8_archs := armv8-a armv8-a+crc armv8.1-a armv8.2-a armv8.3-a armv8.4-a \
- armv8.5-a armv8.6-a
-
-all_v9_archs := armv9-a
-
-# No floating point variants, require thumb1 softfp
-all_nofp_t := armv6-m armv6s-m armv8-m.base
-
-all_nofp_t2 := armv7-m
-
-all_sp_only := armv7e-m armv8-m.main
-
-MULTILIB_OPTIONS =
-MULTILIB_DIRNAMES =
+MULTILIB_OPTIONS = mthumb mbig-endian march=armv6k march=armv6s-m mfloat-abi=hard mfloat-abi=soft
+MULTILIB_DIRNAMES = thumb be armv6k v6-m fpu nofp
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES =
-MULTILIB_REUSE =
-
-# PART 2 - multilib build rules
-
-MULTILIB_OPTIONS += marm/mthumb
-MULTILIB_DIRNAMES += arm thumb
-
-MULTILIB_OPTIONS += mfpu=auto
-MULTILIB_DIRNAMES += autofp
-
-MULTILIB_OPTIONS += march=armv5te+fp/march=armv7+fp
-MULTILIB_DIRNAMES += v5te v7
-
-MULTILIB_OPTIONS += mfloat-abi=hard
-MULTILIB_DIRNAMES += fpu
-
-# Build a total of 4 library variants (base options plus the following):
-MULTILIB_REQUIRED += mthumb
-MULTILIB_REQUIRED += marm/mfpu=auto/march=armv5te+fp/mfloat-abi=hard
-MULTILIB_REQUIRED += mthumb/mfpu=auto/march=armv7+fp/mfloat-abi=hard
-
-# PART 3 - Match rules
-
-# Map all supported FPUs onto mfpu=auto
-MULTILIB_MATCHES += $(foreach FPU, $(dp_fpus), \
- mfpu?auto=mfpu?$(FPU))
-
-MULTILIB_MATCHES += march?armv5te+fp=march?armv5te
-
-MULTILIB_MATCHES += $(foreach ARCH, $(all_early_arch), \
- march?armv5te+fp=march?$(ARCH) \
- march?armv5te+fp=march?$(ARCH)+fp)
-
-MULTILIB_MATCHES += march?armv7+fp=march?armv7
-
-MULTILIB_MATCHES += $(foreach FPARCH, $(v7a_fps), \
- march?armv7+fp=march?armv7-a+$(FPARCH))
-
-MULTILIB_MATCHES += $(foreach FPARCH, $(v7ve_fps), \
- march?armv7+fp=march?armv7ve+$(FPARCH))
-
-MULTILIB_MATCHES += $(foreach ARCH, $(all_v7_a_r), \
- march?armv7+fp=march?$(ARCH) \
- march?armv7+fp=march?$(ARCH)+fp)
-MULTILIB_MATCHES += $(foreach ARCH, $(all_v8_archs), \
- march?armv7+fp=march?$(ARCH) \
- $(foreach FPARCH, $(v8_fps), \
- march?armv7+fp=march?$(ARCH)+$(FPARCH)))
+MULTILIB_REQUIRED = mthumb mbig-endian mthumb/mbig-endian march=armv6k/mfloat-abi=hard mthumb/march=armv6s-m/mfloat-abi=soft
-MULTILIB_MATCHES += $(foreach ARCH, $(all_v9_archs), \
- march?armv7+fp=march?$(ARCH) \
- $(foreach FPARCH, $(v9_fps), \
- march?armv7+fp=march?$(ARCH)+$(FPARCH)))
-MULTILIB_MATCHES += $(foreach ARCH, armv7e-m armv8-m.mainline, \
- march?armv7+fp=march?$(ARCH)+fp.dp)
+MULTILIB_MATCHES += march?armv6k=mtune?mpcore
+MULTILIB_MATCHES += march?armv6k=mcpu?mpcore
-# PART 4 - Reuse rules
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0
+MULTILIB_MATCHES += march?armv6s-m=mtune?cortex-m0
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus
+MULTILIB_MATCHES += march?armv6s-m=mtune?cortex-m0plus
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1
+MULTILIB_MATCHES += march?armv6s-m=mtune?cortex-m1
-MULTILIB_REUSE += mthumb=mthumb/mfpu.auto
-MULTILIB_REUSE += mthumb=mthumb/mfpu.auto/march.armv5te+fp
-MULTILIB_REUSE += mthumb=mthumb/march.armv5te+fp
-MULTILIB_REUSE += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=marm/march.armv5te+fp/mfloat-abi.hard
-MULTILIB_REUSE += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=march.armv5te+fp/mfloat-abi.hard
-MULTILIB_REUSE += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=mfpu.auto/march.armv5te+fp/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=mthumb/march.armv7+fp/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=mfpu.auto/march.armv7+fp/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=march.armv7+fp/mfloat-abi.hard
+MULTILIB_REUSE = mthumb/march.armv6s-m/mfloat-abi.soft=mthumb/march.armv6s-m
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index ab3918283d8..c14a1955cad 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -29,7 +29,7 @@
#endif
/* Now we define the strings used to build the spec file. */
-#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
+#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -93,4 +93,5 @@
udivmoddi4, which will depend on the exception unwind routines,
which will depend on abort, which is defined in libc. */
#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %{!nolibc:%L} --end-group"
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group"
+
diff --git a/gcc/config/devkitpro.h b/gcc/config/devkitpro.h
new file mode 100644
index 00000000000..180a9ea8553
--- /dev/null
+++ b/gcc/config/devkitpro.h
@@ -0,0 +1,27 @@
+/* Definitions for devkitPro toolchains.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of GCC.
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+ GCC 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 General Public
+ License for more details.
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__DEVKITPRO__"); \
+ builtin_define ("__DEVKITARM__"); \
+ } while (0)
+
+
diff --git a/gcc/config/devkitpro.opt b/gcc/config/devkitpro.opt
new file mode 100644
index 00000000000..9acbbf9d27c
--- /dev/null
+++ b/gcc/config/devkitpro.opt
@@ -0,0 +1,29 @@
+; Options for devkitPro toolchains.
+
+; Copyright (C) 2011-2018 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC 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 General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/devkitpro.opt.urls b/gcc/config/devkitpro.opt.urls
new file mode 100644
index 00000000000..ab7b466aa71
--- /dev/null
+++ b/gcc/config/devkitpro.opt.urls
@@ -0,0 +1 @@
+; Autogenerated by regenerate-opt-urls.py from gcc/config/devkitpro.opt and generated HTML
diff --git a/gcc/config/i386/host-mingw32.cc b/gcc/config/i386/host-mingw32.cc
index e083f49f3da..1b81e7e88ce 100644
--- a/gcc/config/i386/host-mingw32.cc
+++ b/gcc/config/i386/host-mingw32.cc
@@ -94,6 +94,10 @@ mingw32_gt_pch_get_address (size_t size, int)
If we allocate at bottom we need to reserve the address as early
as possible and at the same point in each invocation. */
+#if __MINGW64__
+ size = UINT64_C(64 * 1024 * 1024 * 1024);
+#endif
+
res = VirtualAlloc (NULL, size,
MEM_RESERVE | MEM_TOP_DOWN,
PAGE_NOACCESS);
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 4fd87f2c4a1..6af06f7b032 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -888,6 +888,11 @@ proper position among the other output files. */
#endif
#endif
+#ifndef LIBGLOSS_SPEC
+# define LIBGLOSS_SPEC "-lsysbase"
+#endif
+
+
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
#ifndef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -1215,6 +1220,7 @@ static const char *link_spec = LINK_SPEC;
static const char *lib_spec = LIB_SPEC;
static const char *link_gomp_spec = "";
static const char *libgcc_spec = LIBGCC_SPEC;
+static const char *libgloss_spec = LIBGLOSS_SPEC;
static const char *endfile_spec = ENDFILE_SPEC;
static const char *startfile_spec = STARTFILE_SPEC;
static const char *linker_name_spec = LINKER_NAME;
@@ -1727,6 +1733,7 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("lib", &lib_spec),
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
+ INIT_STATIC_SPEC ("libgloss", &libgloss_spec),
INIT_STATIC_SPEC ("startfile", &startfile_spec),
INIT_STATIC_SPEC ("cross_compile", &cross_compile),
INIT_STATIC_SPEC ("version", &compiler_version),
diff --git a/libcc1/configure b/libcc1/configure
index ea689a353c8..98f9d9b21b7 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -5119,7 +5119,7 @@ else
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+ $tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
diff --git a/libgcc/config/arm/t-bpabi b/libgcc/config/arm/t-bpabi
index dddddc7c444..c2502597953 100644
--- a/libgcc/config/arm/t-bpabi
+++ b/libgcc/config/arm/t-bpabi
@@ -17,4 +17,4 @@ SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver
# On ARM, specifying -fnon-call-exceptions will needlessly pull in
# the unwinder in simple programs which use 64-bit division. Omitting
# the option is safe.
-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index b9767cd1eee..362689c9f0b 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -326,7 +326,7 @@ register_tm_clones (void)
#ifdef OBJECT_FORMAT_ELF
-#if DEFAULT_USE_CXA_ATEXIT
+#if 1 /* DEFAULT_USE_CXA_ATEXIT */
/* Declare the __dso_handle variable. It should have a unique value
in every shared-object; in a main program its value is zero. The
object should in any case be protected. This means the instance
diff --git a/libgcc/gthr.h b/libgcc/gthr.h
index 557417997f4..cb223aa43fc 100644
--- a/libgcc/gthr.h
+++ b/libgcc/gthr.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The pe-coff weak support isn't fully compatible to ELF's weak.
For static libraries it might would work, but as we need to deal
with shared versions too, we disable it for mingw-targets. */
-#ifdef __MINGW32__
+#if defined( __MINGW32__) || defined(__DEVKITARM__)
#undef GTHREAD_USE_WEAK
#define GTHREAD_USE_WEAK 0
#endif
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 819a1d82876..d81e6057c5b 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -893,6 +893,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -1027,6 +1028,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1279,6 +1281,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1416,7 +1427,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1569,6 +1580,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -5080,7 +5092,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5126,7 +5138,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5150,7 +5162,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5195,7 +5207,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5219,7 +5231,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -12280,7 +12292,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12283 "configure"
+#line 12295 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12386,7 +12398,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12389 "configure"
+#line 12401 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16182,7 +16194,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 16185 "configure"
+#line 16197 "configure"
int main()
{
typedef bool atomic_type;
@@ -16217,7 +16229,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 16220 "configure"
+#line 16232 "configure"
int main()
{
typedef short atomic_type;
@@ -16252,7 +16264,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 16255 "configure"
+#line 16267 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -16288,7 +16300,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 16291 "configure"
+#line 16303 "configure"
int main()
{
typedef long long atomic_type;
@@ -16445,7 +16457,7 @@ $as_echo "mutex" >&6; }
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 16448 "configure"
+#line 16460 "configure"
int main()
{
_Decimal32 d1;
@@ -16487,7 +16499,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 16490 "configure"
+#line 16502 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -28602,6 +28614,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
$as_echo "#define HAVE_MEMALIGN 1" >>confdefs.h
+ $as_echo "#define HAVE_ALIGNED_ALLOC 1" >>confdefs.h
+
case "${target}" in
*-rtems*)
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index a6c01b29e94..a8fb1200c8b 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -386,6 +386,7 @@ dnl # rather than hardcoding that information.
fi
AC_DEFINE(HAVE_MEMALIGN)
+ AC_DEFINE(HAVE_ALIGNED_ALLOC)
case "${target}" in
*-rtems*)
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 537774c2668..b15e28d2371 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1436,6 +1436,7 @@ ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
+ -e 's/_GLIBCXX___DEVKITARM_GLIBCXX___/__DEVKITARM__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< $< > $@
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 7b96b2207f8..80f0effec92 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -336,6 +336,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
python_mod_dir = @python_mod_dir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -1910,6 +1911,7 @@ ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
+ -e 's/_GLIBCXX___DEVKITARM_GLIBCXX___/__DEVKITARM__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< $< > $@
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 28f5dd79cd7..a79f318a4d6 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -6469,7 +6469,7 @@ else
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+ $tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
break
;;
*)

View File

@ -1,593 +0,0 @@
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 087aaa7be37..63b52b3571b 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1508,6 +1508,11 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
tm_file="$tm_file newlib-stdint.h"
tmake_file="${tmake_file} arm/t-bpabi"
use_gcc_stdint=wrap
+ tm_file="${tm_file} devkitpro.h"
+ extra_options="${extra_options} devkitpro.opt"
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
;;
arm*-*-fuchsia*)
tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
index 1939d55b9fd..62d425cb596 100644
--- a/gcc/config/arm/arm-cpus.in
+++ b/gcc/config/arm/arm-cpus.in
@@ -416,7 +416,7 @@ begin arch armv6k
tune for mpcore
tune flags CO_PROC
base 6K
- isa ARMv6k
+ isa ARMv6k VFPv2 FP_DBL
option fp add VFPv2 FP_DBL
optalias vfpv2 fp
option nofp remove ALL_FP
diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
index fdfdf9c580b..add129f0a62 100644
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -16,120 +16,22 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Build a very basic set of libraries that should cater for most cases.
-
-# Single-precision floating-point is NOT supported; we don't build a
-# suitable library for that. Use the rm-profile config in that case.
-
-# PART 1 - Useful groups of options
-
-dp_fpus := vfp vfpv2 vfpv3 vfpv3-fp16 vfpv3-d16 vfpv3-d16-fp16 \
- neon neon-vfpv3 neon-fp16 vfpv4 neon-vfpv4 vfpv4-d16 \
- fpv5-d16 fp-armv8 neon-fp-armv8 crypto-neon-fp-armv8 \
- vfp3
-
-sp_fpus := vfpv3xd vfpv3xd-fp16 fpv4-sp-d16 fpv5-sp-d16
-
-v7a_fps := vfpv3 vfpv3-fp16 vfpv4 simd neon-fp16 neon-vfpv4
-v7ve_fps := vfpv3-d16 vfpv3 vfpv3-d16-fp16 vfpv3-fp16 vfpv4 neon \
- neon-fp16 simd
-
-# Not all these permutations exist for all architecture variants, but
-# it seems to work ok.
-v8_fps := simd fp16 crypto fp16+crypto dotprod fp16fml
-
-v9_fps := simd fp16 crypto fp16+crypto dotprod fp16fml
-
-# We don't do anything special with these. Pre-v4t probably doesn't work.
-all_early_nofp := armv4 armv4t armv5t
-
-all_early_arch := armv5tej armv6 armv6j armv6k armv6z armv6kz \
- armv6zk armv6t2 iwmmxt iwmmxt2
-
-all_v7_a_r := armv7-a armv7ve armv7-r
-
-all_v8_archs := armv8-a armv8-a+crc armv8.1-a armv8.2-a armv8.3-a armv8.4-a \
- armv8.5-a armv8.6-a
-
-all_v9_archs := armv9-a
-
-# No floating point variants, require thumb1 softfp
-all_nofp_t := armv6-m armv6s-m armv8-m.base
-
-all_nofp_t2 := armv7-m
-
-all_sp_only := armv7e-m armv8-m.main
-
-MULTILIB_OPTIONS =
-MULTILIB_DIRNAMES =
+MULTILIB_OPTIONS = mthumb mbig-endian march=armv6k march=armv6s-m mfloat-abi=hard mfloat-abi=soft
+MULTILIB_DIRNAMES = thumb be armv6k v6-m fpu nofp
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES =
-MULTILIB_REUSE =
-
-# PART 2 - multilib build rules
-
-MULTILIB_OPTIONS += marm/mthumb
-MULTILIB_DIRNAMES += arm thumb
-
-MULTILIB_OPTIONS += mfpu=auto
-MULTILIB_DIRNAMES += autofp
-
-MULTILIB_OPTIONS += march=armv5te+fp/march=armv7+fp
-MULTILIB_DIRNAMES += v5te v7
-
-MULTILIB_OPTIONS += mfloat-abi=hard
-MULTILIB_DIRNAMES += fpu
-
-# Build a total of 4 library variants (base options plus the following):
-MULTILIB_REQUIRED += mthumb
-MULTILIB_REQUIRED += marm/mfpu=auto/march=armv5te+fp/mfloat-abi=hard
-MULTILIB_REQUIRED += mthumb/mfpu=auto/march=armv7+fp/mfloat-abi=hard
-
-# PART 3 - Match rules
-
-# Map all supported FPUs onto mfpu=auto
-MULTILIB_MATCHES += $(foreach FPU, $(dp_fpus), \
- mfpu?auto=mfpu?$(FPU))
-
-MULTILIB_MATCHES += march?armv5te+fp=march?armv5te
-
-MULTILIB_MATCHES += $(foreach ARCH, $(all_early_arch), \
- march?armv5te+fp=march?$(ARCH) \
- march?armv5te+fp=march?$(ARCH)+fp)
-
-MULTILIB_MATCHES += march?armv7+fp=march?armv7
-
-MULTILIB_MATCHES += $(foreach FPARCH, $(v7a_fps), \
- march?armv7+fp=march?armv7-a+$(FPARCH))
-
-MULTILIB_MATCHES += $(foreach FPARCH, $(v7ve_fps), \
- march?armv7+fp=march?armv7ve+$(FPARCH))
-
-MULTILIB_MATCHES += $(foreach ARCH, $(all_v7_a_r), \
- march?armv7+fp=march?$(ARCH) \
- march?armv7+fp=march?$(ARCH)+fp)
-MULTILIB_MATCHES += $(foreach ARCH, $(all_v8_archs), \
- march?armv7+fp=march?$(ARCH) \
- $(foreach FPARCH, $(v8_fps), \
- march?armv7+fp=march?$(ARCH)+$(FPARCH)))
+MULTILIB_REQUIRED = mthumb mbig-endian mthumb/mbig-endian march=armv6k/mfloat-abi=hard mthumb/march=armv6s-m/mfloat-abi=soft
-MULTILIB_MATCHES += $(foreach ARCH, $(all_v9_archs), \
- march?armv7+fp=march?$(ARCH) \
- $(foreach FPARCH, $(v9_fps), \
- march?armv7+fp=march?$(ARCH)+$(FPARCH)))
-MULTILIB_MATCHES += $(foreach ARCH, armv7e-m armv8-m.mainline, \
- march?armv7+fp=march?$(ARCH)+fp.dp)
+MULTILIB_MATCHES += march?armv6k=mtune?mpcore
+MULTILIB_MATCHES += march?armv6k=mcpu?mpcore
-# PART 4 - Reuse rules
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0
+MULTILIB_MATCHES += march?armv6s-m=mtune?cortex-m0
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus
+MULTILIB_MATCHES += march?armv6s-m=mtune?cortex-m0plus
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1
+MULTILIB_MATCHES += march?armv6s-m=mtune?cortex-m1
-MULTILIB_REUSE += mthumb=mthumb/mfpu.auto
-MULTILIB_REUSE += mthumb=mthumb/mfpu.auto/march.armv5te+fp
-MULTILIB_REUSE += mthumb=mthumb/march.armv5te+fp
-MULTILIB_REUSE += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=marm/march.armv5te+fp/mfloat-abi.hard
-MULTILIB_REUSE += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=march.armv5te+fp/mfloat-abi.hard
-MULTILIB_REUSE += marm/mfpu.auto/march.armv5te+fp/mfloat-abi.hard=mfpu.auto/march.armv5te+fp/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=mthumb/march.armv7+fp/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=mfpu.auto/march.armv7+fp/mfloat-abi.hard
-MULTILIB_REUSE += mthumb/mfpu.auto/march.armv7+fp/mfloat-abi.hard=march.armv7+fp/mfloat-abi.hard
+MULTILIB_REUSE = mthumb/march.armv6s-m/mfloat-abi.soft=mthumb/march.armv6s-m
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index ab3918283d8..c14a1955cad 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -29,7 +29,7 @@
#endif
/* Now we define the strings used to build the spec file. */
-#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
+#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -93,4 +93,5 @@
udivmoddi4, which will depend on the exception unwind routines,
which will depend on abort, which is defined in libc. */
#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %{!nolibc:%L} --end-group"
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group"
+
diff --git a/gcc/config/devkitpro.h b/gcc/config/devkitpro.h
new file mode 100644
index 00000000000..180a9ea8553
--- /dev/null
+++ b/gcc/config/devkitpro.h
@@ -0,0 +1,27 @@
+/* Definitions for devkitPro toolchains.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of GCC.
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+ GCC 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 General Public
+ License for more details.
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__DEVKITPRO__"); \
+ builtin_define ("__DEVKITARM__"); \
+ } while (0)
+
+
diff --git a/gcc/config/devkitpro.opt b/gcc/config/devkitpro.opt
new file mode 100644
index 00000000000..9acbbf9d27c
--- /dev/null
+++ b/gcc/config/devkitpro.opt
@@ -0,0 +1,29 @@
+; Options for devkitPro toolchains.
+
+; Copyright (C) 2011-2018 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC 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 General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/devkitpro.opt.urls b/gcc/config/devkitpro.opt.urls
new file mode 100644
index 00000000000..ab7b466aa71
--- /dev/null
+++ b/gcc/config/devkitpro.opt.urls
@@ -0,0 +1 @@
+; Autogenerated by regenerate-opt-urls.py from gcc/config/devkitpro.opt and generated HTML
diff --git a/gcc/config/i386/host-mingw32.cc b/gcc/config/i386/host-mingw32.cc
index e083f49f3da..1b81e7e88ce 100644
--- a/gcc/config/i386/host-mingw32.cc
+++ b/gcc/config/i386/host-mingw32.cc
@@ -94,6 +94,10 @@ mingw32_gt_pch_get_address (size_t size, int)
If we allocate at bottom we need to reserve the address as early
as possible and at the same point in each invocation. */
+#if __MINGW64__
+ size = UINT64_C(64 * 1024 * 1024 * 1024);
+#endif
+
res = VirtualAlloc (NULL, size,
MEM_RESERVE | MEM_TOP_DOWN,
PAGE_NOACCESS);
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 4fd87f2c4a1..6af06f7b032 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -888,6 +888,11 @@ proper position among the other output files. */
#endif
#endif
+#ifndef LIBGLOSS_SPEC
+# define LIBGLOSS_SPEC "-lsysbase"
+#endif
+
+
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
#ifndef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -1215,6 +1220,7 @@ static const char *link_spec = LINK_SPEC;
static const char *lib_spec = LIB_SPEC;
static const char *link_gomp_spec = "";
static const char *libgcc_spec = LIBGCC_SPEC;
+static const char *libgloss_spec = LIBGLOSS_SPEC;
static const char *endfile_spec = ENDFILE_SPEC;
static const char *startfile_spec = STARTFILE_SPEC;
static const char *linker_name_spec = LINKER_NAME;
@@ -1727,6 +1733,7 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("lib", &lib_spec),
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
+ INIT_STATIC_SPEC ("libgloss", &libgloss_spec),
INIT_STATIC_SPEC ("startfile", &startfile_spec),
INIT_STATIC_SPEC ("cross_compile", &cross_compile),
INIT_STATIC_SPEC ("version", &compiler_version),
diff --git a/libcc1/configure b/libcc1/configure
index ea689a353c8..98f9d9b21b7 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -5119,7 +5119,7 @@ else
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+ $tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
diff --git a/libgcc/config/arm/t-bpabi b/libgcc/config/arm/t-bpabi
index dddddc7c444..c2502597953 100644
--- a/libgcc/config/arm/t-bpabi
+++ b/libgcc/config/arm/t-bpabi
@@ -17,4 +17,4 @@ SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver
# On ARM, specifying -fnon-call-exceptions will needlessly pull in
# the unwinder in simple programs which use 64-bit division. Omitting
# the option is safe.
-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index b9767cd1eee..362689c9f0b 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -326,7 +326,7 @@ register_tm_clones (void)
#ifdef OBJECT_FORMAT_ELF
-#if DEFAULT_USE_CXA_ATEXIT
+#if 1 /* DEFAULT_USE_CXA_ATEXIT */
/* Declare the __dso_handle variable. It should have a unique value
in every shared-object; in a main program its value is zero. The
object should in any case be protected. This means the instance
diff --git a/libgcc/gthr.h b/libgcc/gthr.h
index 557417997f4..cb223aa43fc 100644
--- a/libgcc/gthr.h
+++ b/libgcc/gthr.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The pe-coff weak support isn't fully compatible to ELF's weak.
For static libraries it might would work, but as we need to deal
with shared versions too, we disable it for mingw-targets. */
-#ifdef __MINGW32__
+#if defined( __MINGW32__) || defined(__DEVKITARM__)
#undef GTHREAD_USE_WEAK
#define GTHREAD_USE_WEAK 0
#endif
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 819a1d82876..d81e6057c5b 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -893,6 +893,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -1027,6 +1028,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1279,6 +1281,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1416,7 +1427,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1569,6 +1580,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -5080,7 +5092,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5126,7 +5138,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5150,7 +5162,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5195,7 +5207,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5219,7 +5231,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -12280,7 +12292,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12283 "configure"
+#line 12295 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12386,7 +12398,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12389 "configure"
+#line 12401 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16182,7 +16194,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 16185 "configure"
+#line 16197 "configure"
int main()
{
typedef bool atomic_type;
@@ -16217,7 +16229,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 16220 "configure"
+#line 16232 "configure"
int main()
{
typedef short atomic_type;
@@ -16252,7 +16264,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 16255 "configure"
+#line 16267 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -16288,7 +16300,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 16291 "configure"
+#line 16303 "configure"
int main()
{
typedef long long atomic_type;
@@ -16445,7 +16457,7 @@ $as_echo "mutex" >&6; }
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 16448 "configure"
+#line 16460 "configure"
int main()
{
_Decimal32 d1;
@@ -16487,7 +16499,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 16490 "configure"
+#line 16502 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -28602,6 +28614,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
$as_echo "#define HAVE_MEMALIGN 1" >>confdefs.h
+ $as_echo "#define HAVE_ALIGNED_ALLOC 1" >>confdefs.h
+
case "${target}" in
*-rtems*)
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index a6c01b29e94..a8fb1200c8b 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -386,6 +386,7 @@ dnl # rather than hardcoding that information.
fi
AC_DEFINE(HAVE_MEMALIGN)
+ AC_DEFINE(HAVE_ALIGNED_ALLOC)
case "${target}" in
*-rtems*)
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 537774c2668..b15e28d2371 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1436,6 +1436,7 @@ ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
+ -e 's/_GLIBCXX___DEVKITARM_GLIBCXX___/__DEVKITARM__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< $< > $@
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 7b96b2207f8..80f0effec92 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -336,6 +336,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
python_mod_dir = @python_mod_dir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -1910,6 +1911,7 @@ ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
+ -e 's/_GLIBCXX___DEVKITARM_GLIBCXX___/__DEVKITARM__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< $< > $@
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 28f5dd79cd7..a79f318a4d6 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -6469,7 +6469,7 @@ else
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+ $tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
break
;;
*)

View File

@ -1,26 +0,0 @@
diff --git a/ld/emulparams/elf32ppccommon.sh b/ld/emulparams/elf32ppccommon.sh
index da892988f5d..6b8efb9bbdb 100644
--- a/ld/emulparams/elf32ppccommon.sh
+++ b/ld/emulparams/elf32ppccommon.sh
@@ -23,7 +23,7 @@ else
unset SBSS_START_SYMBOLS
unset SBSS_END_SYMBOLS
fi
-OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end = .${CREATE_SHLIB+)};"
+OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end = .${CREATE_SHLIB+)};${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
OTHER_RELRO_SECTIONS="
.fixup ${RELOCATING-0} : { *(.fixup) }
.got1 ${RELOCATING-0} : { *(.got1) }
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index e55bfe846cd..f160e290bce 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -4988,7 +4988,7 @@ const unsigned int num_powerpc_operands = ARRAY_SIZE (powerpc_operands);
#define MFDEC2 (PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_BOOKE \
| PPC_OPCODE_TITAN)
#define BOOKE PPC_OPCODE_BOOKE
-#define NO371 PPC_OPCODE_BOOKE | PPC_OPCODE_PPCPS | PPC_OPCODE_EFS
+#define NO371 PPC_OPCODE_BOOKE | PPC_OPCODE_EFS
#define PPCE300 PPC_OPCODE_E300
#define PPCSPE PPC_OPCODE_SPE
#define PPCSPE2 PPC_OPCODE_SPE2

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -35,59 +35,25 @@ then
fi
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install mn10200 binutils
#---------------------------------------------------------------------------------
# Use modern config.sub for aarch64 host
cp binutils-$BINUTILS_VER/config.sub binutils-$MN_BINUTILS_VER/config.sub
mkdir -p mn10200/binutils
cd mn10200/binutils
if [ ! -f configured-binutils ]
then
../../binutils-$MN_BINUTILS_VER/configure \
--prefix=$prefix --target=mn10200 --disable-nls --disable-debug \
--disable-multilib \
--disable-werror $CROSS_PARAMS \
|| { echo "Error configuing mn10200 binutils"; exit 1; }
touch configured-binutils
fi
if [ ! -f built-binutils ]
then
$MAKE || { echo "Error building mn10200 binutils"; exit 1; }
touch built-binutils
fi
if [ ! -f installed-binutils ]
then
$MAKE install || { echo "Error installing mn10200 binutils"; exit 1; }
touch installed-binutils
fi
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install just the c compiler
#---------------------------------------------------------------------------------
mkdir -p $target/gcc
cd $target/gcc
export gcc_cv_libc_provides_ssp=yes
if [ ! -f configured-gcc ]
then
CPPFLAGS="-DSTDINT_LONG32=0 ${CPPFLAGS}" \
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
CXXFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
LDFLAGS_FOR_TARGET="" \
../../gcc-$GCC_VER/configure \
--target=$target \
--prefix=$prefix \
--enable-languages=c,c++,objc,lto \
--enable-lto \
--with-cpu=750 \
--disable-nls --disable-shared --enable-threads=dkp --disable-multilib \
--disable-nls --disable-shared --enable-threads=posix --disable-multilib \
--disable-win32-registry \
--disable-libstdcxx-pch \
--disable-libstdcxx-verbose \
@ -97,15 +63,12 @@ then
--disable-__cxa_atexit \
--disable-libssp \
--enable-cxx-flags='-ffunction-sections -fdata-sections' \
--target=$target \
--with-newlib \
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix \
--with-bugurl="https://github.com/devkitpro/buildscripts/issues" --with-pkgversion="devkitPPC release 48" \
$CROSS_PARAMS \
$CROSS_GCC_PARAMS \
$EXTRA_GCC_PARAMS \
CFLAGS_FOR_TARGET="-O2 -ffunction-sections -fdata-sections" \
|| { echo "Error configuring gcc stage 1"; exit 1; }
touch configured-gcc
fi

View File

@ -309,6 +309,19 @@ index 0565b7a066c..64821b1fc31 100644
ARCH="aarch64:ilp32"
MACHINE=
diff --git a/ld/emulparams/elf32ppccommon.sh b/ld/emulparams/elf32ppccommon.sh
index da892988f5d..6b8efb9bbdb 100644
--- a/ld/emulparams/elf32ppccommon.sh
+++ b/ld/emulparams/elf32ppccommon.sh
@@ -23,7 +23,7 @@ else
unset SBSS_START_SYMBOLS
unset SBSS_END_SYMBOLS
fi
-OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end = .${CREATE_SHLIB+)};"
+OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end = .${CREATE_SHLIB+)};${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
OTHER_RELRO_SECTIONS="
.fixup ${RELOCATING-0} : { *(.fixup) }
.got1 ${RELOCATING-0} : { *(.got1) }
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index 91d58d8fe5a..e1ac4a6b139 100644
--- a/ld/emultempl/aarch64elf.em
@ -511,3 +524,16 @@ index c8d61478c60..a5bb71b1dc5 100644
/* Used by emulparams/elf32mcore.sh, emultempl/beos.em, emultempl/pe.em
and emultempl/pep.em. */
OPTION_BASE_FILE,
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 712cd31d19e..5d6dbb3b48d 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -5107,7 +5107,7 @@ const unsigned int num_powerpc_operands = ARRAY_SIZE (powerpc_operands);
#define MFDEC2 (PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_BOOKE \
| PPC_OPCODE_TITAN)
#define BOOKE PPC_OPCODE_BOOKE
-#define NO371 PPC_OPCODE_BOOKE | PPC_OPCODE_PPCPS | PPC_OPCODE_EFS
+#define NO371 PPC_OPCODE_BOOKE | PPC_OPCODE_EFS
#define PPCE300 PPC_OPCODE_E300
#define PPCSPE PPC_OPCODE_SPE
#define PPCSPE2 PPC_OPCODE_SPE2

1203
patches/gcc-15.2.0.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8395,10 +8395,10 @@ index 000000000..a696c9ab9
+}
diff --git a/libgloss/libsysbase/pthread.c b/libgloss/libsysbase/pthread.c
new file mode 100755
index 000000000..ff84cd355
index 000000000..1d9ba09c1
--- /dev/null
+++ b/libgloss/libsysbase/pthread.c
@@ -0,0 +1,1083 @@
@@ -0,0 +1,1097 @@
+#include <pthread.h>
+#include <semaphore.h>
+#include <errno.h>
@ -8507,6 +8507,19 @@ index 000000000..ff84cd355
+{
+ if (!__mutex)
+ return EINVAL;
+
+ switch (__mutex->type) {
+ case PTHREAD_MUTEX_NORMAL:
+ case PTHREAD_MUTEX_ERRORCHECK: // todo: error check
+ case PTHREAD_MUTEX_DEFAULT:
+ __lock_close(__mutex->normal);
+ break;
+ case PTHREAD_MUTEX_RECURSIVE:
+ __lock_close_recursive(__mutex->recursive);
+ break;
+ default:
+ return EINVAL;
+ }
+ return 0;
+}
+
@ -8655,6 +8668,7 @@ index 000000000..ff84cd355
+{
+ if (!__cond)
+ return EINVAL;
+ __cond_close(__cond->cond);
+ return 0;
+}
+
@ -10108,10 +10122,10 @@ index 000000000..d5959084e
+
diff --git a/libgloss/libsysbase/syscall_support.c b/libgloss/libsysbase/syscall_support.c
new file mode 100644
index 000000000..cbabf8b9a
index 000000000..c2a518619
--- /dev/null
+++ b/libgloss/libsysbase/syscall_support.c
@@ -0,0 +1,144 @@
@@ -0,0 +1,170 @@
+#include <sys/iosupport.h>
+#include <errno.h>
+
@ -10240,6 +10254,32 @@ index 000000000..cbabf8b9a
+
+}
+
+#ifdef __DEVKITPPC__
+
+
+void __libc_lock_close(_LOCK_T *lock ) {
+
+ if ( __has_syscall(lock_close) ){
+ __syscall_lock_close(lock);
+ }
+}
+
+void __libc_lock_close_recursive(_LOCK_RECURSIVE_T *lock ) {
+
+ if ( __has_syscall(lock_close_recursive) ){
+ __syscall_lock_close_recursive(lock);
+ }
+}
+
+
+void __libc_cond_close(_COND_T *cond) {
+
+ if ( __has_syscall(cond_close) ){
+ __syscall_cond_close(cond);
+ }
+}
+
+#endif
+
+#ifdef CUSTOM_MALLOC_LOCK
+
@ -12309,7 +12349,7 @@ index f25db3b0a..e0b9083d9 100644
for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
if [ -f $$i ]; then \
diff --git a/newlib/configure.host b/newlib/configure.host
index ff2e51275..af4d9f085 100644
index ff2e51275..abda55425 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -639,13 +639,25 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID
@ -12338,14 +12378,15 @@ index ff2e51275..af4d9f085 100644
arm*-*-pe)
syscall_dir=syscalls
newlib_cflags="${newlib_cflags} -DHAVE_SYSCONF_PAGESIZE"
@@ -818,7 +830,13 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID
@@ -818,7 +830,14 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID
default_newlib_io_long_long="yes"
newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
;;
- powerpc*-*-eabi* | \
+ powerpc*-*-eabi*)
+ default_newlib_io_c99_formats="yes"
+ default_newlib_io_c99_formats="yes"
+ default_newlib_io_long_long="yes"
+ default_newlib_io_pos_args="yes"
+ newlib_cflags="${newlib_cflags} -DHAVE_ASSERT_FUNC -DABORT_PROVIDED -DCUSTOM_MALLOC_LOCK -D__DYNAMIC_REENT__ -DGETREENT_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -D__DEFAULT_UTF8__"
+ newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections"
+ syscall_dir=syscalls
@ -12814,10 +12855,10 @@ index 325acdf5f..7ea75cc7b 100644
#ifdef __rtems__
diff --git a/newlib/libc/include/sys/iosupport.h b/newlib/libc/include/sys/iosupport.h
new file mode 100644
index 000000000..b81214720
index 000000000..4e04fdb35
--- /dev/null
+++ b/newlib/libc/include/sys/iosupport.h
@@ -0,0 +1,142 @@
@@ -0,0 +1,143 @@
+//---------------------------------------------------------------------------------
+#ifndef __iosupp_h__
+#define __iosupp_h__
@ -12922,6 +12963,7 @@ index 000000000..b81214720
+int __SYSCALL(cond_signal)(_COND_T *cond);
+int __SYSCALL(cond_broadcast)(_COND_T *cond);
+int __SYSCALL(cond_wait)(_COND_T *cond, _LOCK_T *lock, uint64_t timeout_ns);
+void __SYSCALL(cond_close)(_COND_T *cond);
+int __SYSCALL(cond_wait_recursive)(_COND_T *cond, _LOCK_RECURSIVE_T *lock, uint64_t timeout_ns);
+int __SYSCALL(thread_create)(struct __pthread_t **thread, void* (*func)(void*), void *arg, void *stack_addr, size_t stack_size);
+void*__SYSCALL(thread_join)(struct __pthread_t *thread);
@ -13328,10 +13370,10 @@ index 000000000..2aaca6080
+#endif // _dirent_h_
diff --git a/newlib/libc/machine/aarch64/sys/lock.h b/newlib/libc/machine/aarch64/sys/lock.h
new file mode 100644
index 000000000..d1c4aba2a
index 000000000..41803dd9d
--- /dev/null
+++ b/newlib/libc/machine/aarch64/sys/lock.h
@@ -0,0 +1,116 @@
@@ -0,0 +1,119 @@
+#ifndef __SYS_LOCK_H__
+#define __SYS_LOCK_H__
+
@ -13342,7 +13384,6 @@ index 000000000..d1c4aba2a
+
+struct __lock_t {
+ _LOCK_T lock;
+ uint32_t thread_tag;
+ uint32_t counter;
+};
+
@ -13351,7 +13392,7 @@ index 000000000..d1c4aba2a
+typedef uint32_t _COND_T;
+
+#define __LOCK_INITIALIZER ((_LOCK_T)0)
+#define __LOCK_INITIALIZER_RECURSIVE ((_LOCK_RECURSIVE_T){__LOCK_INITIALIZER,0,0})
+#define __LOCK_INITIALIZER_RECURSIVE ((_LOCK_RECURSIVE_T){__LOCK_INITIALIZER,0})
+#define __COND_INITIALIZER ((_COND_T)0)
+
+#ifdef __cplusplus
@ -13383,6 +13424,7 @@ index 000000000..d1c4aba2a
+static inline int __libc_cond_init(_COND_T *cond) {
+ *cond = __COND_INITIALIZER;
+}
+static inline void __libc_cond_close(_COND_T *cond ) {}
+
+extern int __libc_cond_signal(_COND_T *cond);
+extern int __libc_cond_broadcast(_COND_T *cond);
@ -13435,6 +13477,9 @@ index 000000000..d1c4aba2a
+#define __cond_init(NAME) \
+ __libc_cond_init(&(NAME))
+
+#define __cond_close(NAME) \
+ __libc_cond_close(&(NAME))
+
+#define __cond_signal(NAME) \
+ __libc_cond_signal(&(NAME))
+
@ -13632,24 +13677,49 @@ index 000000000..b3780c263
+#endif // _dirent_h_
diff --git a/newlib/libc/machine/powerpc/sys/lock.h b/newlib/libc/machine/powerpc/sys/lock.h
new file mode 100644
index 000000000..7f051e0c9
index 000000000..f187a976a
--- /dev/null
+++ b/newlib/libc/machine/powerpc/sys/lock.h
@@ -0,0 +1,58 @@
@@ -0,0 +1,121 @@
+#ifndef __SYS_LOCK_H__
+#define __SYS_LOCK_H__
+
+typedef int _LOCK_T;
+typedef int _LOCK_RECURSIVE_T;
+#include <_ansi.h>
+#include <stdint.h>
+
+#define __LOCK_INIT(CLASS,NAME) CLASS _LOCK_T NAME = 0
+#define __LOCK_INIT_RECURSIVE(CLASS,NAME) CLASS _LOCK_RECURSIVE_T NAME = 0
+typedef uint32_t _LOCK_T;
+
+struct __lock_t {
+ _LOCK_T lock;
+ uint32_t counter;
+};
+
+typedef struct __lock_t _LOCK_RECURSIVE_T;
+
+typedef uint32_t _COND_T;
+
+#define __LOCK_INITIALIZER ((_LOCK_T)0)
+#define __LOCK_INITIALIZER_RECURSIVE ((_LOCK_RECURSIVE_T){__LOCK_INITIALIZER,0})
+#define __COND_INITIALIZER ((_COND_T)0)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline void __libc_lock_init(_LOCK_T *lock) {
+ *lock = __LOCK_INITIALIZER;
+}
+
+static inline void __libc_lock_init_recursive(_LOCK_RECURSIVE_T *lock) {
+ *lock = __LOCK_INITIALIZER_RECURSIVE;
+}
+
+extern void __libc_lock_close(_LOCK_T *lock );
+extern void __libc_lock_close_recursive(_LOCK_RECURSIVE_T *lock );
+
+extern int __libc_lock(_LOCK_T *lock);
+extern int __libc_lock_recursive(_LOCK_RECURSIVE_T *lock);
+
+extern void __libc_lock_init(_LOCK_T *lock);
+extern void __libc_lock_init_recursive(_LOCK_RECURSIVE_T *lock);
+extern void __libc_lock_close(_LOCK_T *lock);
+extern void __libc_lock_close_recursive(_LOCK_RECURSIVE_T *lock);
+extern void __libc_lock_acquire(_LOCK_T *lock);
+extern void __libc_lock_acquire_recursive(_LOCK_RECURSIVE_T *lock);
+extern void __libc_lock_release(_LOCK_T *lock);
@ -13659,6 +13729,30 @@ index 000000000..7f051e0c9
+extern int __libc_lock_try_acquire(_LOCK_T *lock);
+extern int __libc_lock_try_acquire_recursive(_LOCK_RECURSIVE_T *lock);
+
+/* Returns errno */
+static inline int __libc_cond_init(_COND_T *cond) {
+ *cond = __COND_INITIALIZER;
+}
+
+extern void __libc_cond_close(_COND_T *cond);
+extern int __libc_cond_signal(_COND_T *cond);
+extern int __libc_cond_broadcast(_COND_T *cond);
+extern int __libc_cond_wait(_COND_T *cond, _LOCK_T *lock, uint64_t timeout_ns);
+extern int __libc_cond_wait_recursive(_COND_T *cond, _LOCK_RECURSIVE_T *lock, uint64_t timeout_ns);
+
+#ifdef __cplusplus
+}
+#endif
+
+#define __LOCK_INIT(CLASS,NAME) \
+CLASS _LOCK_T NAME = __LOCK_INITIALIZER;
+
+#define __LOCK_INIT_RECURSIVE(CLASS,NAME) \
+CLASS _LOCK_RECURSIVE_T NAME = __LOCK_INITIALIZER_RECURSIVE;
+
+#define __COND_INIT(CLASS,NAME) \
+CLASS _COND_T NAME = __COND_INITIALIZER;
+
+#define __lock_init(NAME) \
+ __libc_lock_init(&(NAME))
+
@ -13669,31 +13763,45 @@ index 000000000..7f051e0c9
+ __libc_lock_close(&(NAME))
+
+#define __lock_close_recursive(NAME) \
+ __libc_lock_close(&(NAME))
+ __libc_lock_close_recursive(&(NAME))
+
+#define __lock_acquire(NAME) \
+ if(!(NAME)) __libc_lock_init(&(NAME)); \
+ __libc_lock_acquire(&(NAME))
+
+#define __lock_acquire_recursive(NAME) \
+ if(!(NAME)) __libc_lock_init_recursive(&(NAME)); \
+ __libc_lock_acquire(&(NAME))
+ __libc_lock_acquire_recursive(&(NAME))
+
+#define __lock_try_acquire(NAME) \
+ if(!(NAME)) __libc_lock_init(&(NAME)); \
+ __libc_lock_try_acquire(&(NAME))
+
+#define __lock_try_acquire_recursive(NAME) \
+ if(!(NAME)) __libc_lock_init_recursive(&(NAME)); \
+ __libc_lock_try_acquire(&(NAME))
+ __libc_lock_try_acquire_recursive(&(NAME))
+
+#define __lock_release(NAME) \
+ __libc_lock_release(&(NAME))
+
+#define __lock_release_recursive(NAME) \
+ __libc_lock_release(&(NAME))
+ __libc_lock_release_recursive(&(NAME))
+
+#endif /* __SYS_LOCK_H__ */
+#define __cond_init(NAME) \
+ __libc_cond_init(&(NAME))
+
+#define __cond_close(NAME) \
+ __libc_cond_close(&(NAME))
+
+#define __cond_signal(NAME) \
+ __libc_cond_signal(&(NAME))
+
+#define __cond_broadcast(NAME) \
+ __libc_cond_broadcast(&(NAME))
+
+#define __cond_wait(NAME, LOCK, TIMEOUT) \
+ __libc_cond_wait(&(NAME), &(LOCK), (TIMEOUT))
+
+#define __cond_wait_recursive(NAME, LOCK, TIMEOUT) \
+ __libc_cond_wait_recursive(&(NAME), &(LOCK), (TIMEOUT))
+
+#endif // __SYS_LOCK_H__
diff --git a/newlib/libc/machine/powerpc/sys/stdio.h b/newlib/libc/machine/powerpc/sys/stdio.h
new file mode 100644
index 000000000..04ebd1ee0
@ -13899,7 +14007,7 @@ index d8dfdbd82..a85b5a99b 100644
return 0;
}
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index feb1fab56..7a59eb21f 100644
index feb1fab56..99ec9c458 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -108,6 +108,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
@ -13911,7 +14019,28 @@ index feb1fab56..7a59eb21f 100644
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/
static char *rcsid = "$Id$";
@@ -1188,7 +1190,7 @@ reswitch: switch (ch) {
@@ -548,12 +550,19 @@ _VFPRINTF_R (struct _reent *data,
#endif
/* Macros to support positional arguments */
+
+#if _ARCH_PPC
+#define __VALIST_PTR(arg) ((va_list *)(arg))
+#else
+#define __VALIST_PTR(arg) (&(arg))
+#endif
+
#ifndef _NO_POS_ARGS
# define GET_ARG(n, ap, type) \
(is_pos_arg \
? (n < numargs \
? args[n].val_##type \
- : get_arg (data, n, fmt_anchor, &ap, &numargs, args, \
+ : get_arg (data, n, fmt_anchor, __VALIST_PTR(ap), &numargs, args, \
arg_type, &saved_fmt)->val_##type) \
: (arg_index++ < numargs \
? args[n].val_##type \
@@ -1188,7 +1197,7 @@ reswitch: switch (ch) {
string:
#endif
sign = '\0';
@ -13920,7 +14049,7 @@ index feb1fab56..7a59eb21f 100644
/* Behavior is undefined if the user passed a
NULL string when precision is not 0.
However, if we are not optimizing for size,
@@ -1198,7 +1200,7 @@ string:
@@ -1198,7 +1207,7 @@ string:
size = ((unsigned) prec > 6U) ? 6 : prec;
}
else
@ -13930,7 +14059,7 @@ index feb1fab56..7a59eb21f 100644
if (ch == 'S' || (flags & LONGINT)) {
mbstate_t ps;
diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c
index 71e2c3e22..bd2d635ed 100644
index 71e2c3e22..960c41608 100644
--- a/newlib/libc/stdio/vfscanf.c
+++ b/newlib/libc/stdio/vfscanf.c
@@ -74,6 +74,8 @@ These are GNU extensions.
@ -13942,8 +14071,28 @@ index 71e2c3e22..bd2d635ed 100644
#include <_ansi.h>
#include <reent.h>
#include <newlib.h>
@@ -572,12 +574,18 @@ __SVFSCANF_R (struct _reent *rptr,
{10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
/* Macro to support positional arguments */
+#if _ARCH_PPC
+#define __VALIST_PTR(arg) ((va_list *)(arg))
+#else
+#define __VALIST_PTR(arg) (&(arg))
+#endif
+
#ifndef _NO_POS_ARGS
# define GET_ARG(n, ap, type) \
((type) (is_pos_arg \
? (n < numargs \
? args[n] \
- : get_arg (n, &ap, &numargs, args)) \
+ : get_arg (n, __VALIST_PTR(ap), &numargs, args)) \
: (arg_index++ < numargs \
? args[n] \
: (numargs < MAX_POS_ARGS \
diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c
index 5a5c36829..3eaca0ce6 100644
index 5a5c36829..3ecba7bd4 100644
--- a/newlib/libc/stdio/vfwprintf.c
+++ b/newlib/libc/stdio/vfwprintf.c
@@ -92,6 +92,9 @@ SEEALSO
@ -13956,8 +14105,28 @@ index 5a5c36829..3eaca0ce6 100644
#include <newlib.h>
#ifdef INTEGER_ONLY
@@ -538,11 +541,18 @@ _VFWPRINTF_R (struct _reent *data,
/* Macros to support positional arguments */
#ifndef _NO_POS_ARGS
+
+#if _ARCH_PPC
+#define __VALIST_PTR(arg) ((va_list *)(arg))
+#else
+#define __VALIST_PTR(arg) (&(arg))
+#endif
+
# define GET_ARG(n, ap, type) \
(is_pos_arg \
? (n < numargs \
? args[n].val_##type \
- : get_arg (data, n, fmt_anchor, &ap, &numargs, args, \
+ : get_arg (data, n, fmt_anchor, __VALIST_PTR(ap), &numargs, args, \
arg_type, &saved_fmt)->val_##type) \
: (arg_index++ < numargs \
? args[n].val_##type \
diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c
index d2f91dde2..de80cc0c0 100644
index d2f91dde2..7c44f29fb 100644
--- a/newlib/libc/stdio/vfwscanf.c
+++ b/newlib/libc/stdio/vfwscanf.c
@@ -74,6 +74,9 @@ PORTABILITY
@ -13970,6 +14139,26 @@ index d2f91dde2..de80cc0c0 100644
#include <_ansi.h>
#include <reent.h>
#include <newlib.h>
@@ -479,11 +482,18 @@ __SVFWSCANF_R (struct _reent *rptr,
/* Macro to support positional arguments */
#ifndef _NO_POS_ARGS
+
+#if _ARCH_PPC
+#define __VALIST_PTR(arg) ((va_list *)(arg))
+#else
+#define __VALIST_PTR(arg) (&(arg))
+#endif
+
# define GET_ARG(n, ap, type) \
((type) (is_pos_arg \
? (n < numargs \
? args[n] \
- : get_arg (n, &ap, &numargs, args)) \
+ : get_arg (n, __VALIST_PTR(ap), &numargs, args)) \
: (arg_index++ < numargs \
? args[n] \
: (numargs < MAX_POS_ARGS \
diff --git a/newlib/libc/stdlib/Makefile.inc b/newlib/libc/stdlib/Makefile.inc
index 9812add76..8410f2633 100644
--- a/newlib/libc/stdlib/Makefile.inc
@ -13983,14 +14172,14 @@ index 9812add76..8410f2633 100644
%D%/wcstod.c \
%D%/wcstoimax.c \
diff --git a/newlib/libc/stdlib/__call_atexit.c b/newlib/libc/stdlib/__call_atexit.c
index 710440389..985e720bf 100644
index 710440389..65b565f91 100644
--- a/newlib/libc/stdlib/__call_atexit.c
+++ b/newlib/libc/stdlib/__call_atexit.c
@@ -21,6 +21,7 @@ struct _atexit *__atexit = _NULL;
#ifdef _WANT_REGISTER_FINI
+#if 0
+#ifndef __DEVKITPPC__
/* If "__libc_fini" is defined, finalizers (either
"__libc_fini_array", or "_fini", as appropriate) will be run after
all user-specified atexit handlers. For example, you can define
@ -14006,7 +14195,7 @@ index 710440389..985e720bf 100644
static void
register_fini(void)
{
+#if 0
+#ifndef __DEVKITPPC__
if (&__libc_fini) {
#ifdef _HAVE_INITFINI_ARRAY
extern void __libc_fini_array (void);
@ -14022,22 +14211,24 @@ index 710440389..985e720bf 100644
#endif /* _WANT_REGISTER_FINI */
diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c
index 9b7bd518b..f0e33bbc1 100644
index 9b7bd518b..e3b28e8ed 100644
--- a/newlib/libc/stdlib/exit.c
+++ b/newlib/libc/stdlib/exit.c
@@ -45,6 +45,16 @@ Supporting OS subroutines required: <<_exit>>.
@@ -45,6 +45,18 @@ Supporting OS subroutines required: <<_exit>>.
#include <reent.h>
#include "atexit.h"
+// exit calls this handler; avoid a hard dependency on findfp by providing a weak global
+void (*__stdio_exit_handler)(void) __attribute__((weak));
+
+#ifndef __DEVKITPPC__
+// exit calls this function; avoid a hard dependency on atexit by providing a simple weak implementation
+__attribute__((weak)) void __call_exitprocs(int rc, void* dso)
+{
+ extern void __libc_fini_array(void);
+ __libc_fini_array();
+}
+#endif
+
/*
* Exit, flushing stdio buffers if necessary.
@ -14396,10 +14587,10 @@ index 000000000..2aaca6080
+#endif // _dirent_h_
diff --git a/newlib/libc/sys/arm/sys/lock.h b/newlib/libc/sys/arm/sys/lock.h
new file mode 100644
index 000000000..bd74ccc42
index 000000000..fd98c32d7
--- /dev/null
+++ b/newlib/libc/sys/arm/sys/lock.h
@@ -0,0 +1,118 @@
@@ -0,0 +1,122 @@
+#ifndef __SYS_LOCK_H__
+#define __SYS_LOCK_H__
+
@ -14451,6 +14642,7 @@ index 000000000..bd74ccc42
+static inline int __libc_cond_init(_COND_T *cond) {
+ *cond = __COND_INITIALIZER;
+}
+static inline void __libc_cond_close(_COND_T *cond ) {}
+
+extern int __libc_cond_signal(_COND_T *cond);
+extern int __libc_cond_broadcast(_COND_T *cond);
@ -14504,6 +14696,9 @@ index 000000000..bd74ccc42
+#define __cond_init(NAME) \
+ __libc_cond_init(&(NAME))
+
+#define __cond_close(NAME) \
+ __libc_cond_close(&(NAME))
+
+#define __cond_signal(NAME) \
+ __libc_cond_signal(&(NAME))
+