Compare commits

...

22 Commits

Author SHA1 Message Date
Dave Murphy
251c7cbbf1 devkitPPC: use supplied zlib 2021-05-25 09:27:00 +01:00
Dave Murphy
2b7e5215fc fix shebang 2021-05-25 09:16:19 +01:00
Dave Murphy
540dbb84c6 devkitPPC: remove stale patches 2021-05-25 09:16:19 +01:00
Dave Murphy
90fb45065c devkitPPC: disable unwanted features 2021-05-25 09:16:19 +01:00
Dave Murphy
771225f45a devkitPPC: move mn10200 binutils to 2.24 2021-05-25 09:16:19 +01:00
Dave Murphy
fdb7c8a6d2 devkitPPC: update gcc to 11.1.0 2021-05-25 09:16:19 +01:00
Dave Murphy
5649ec2a1f devkitPPC: update newlib patch 2021-05-25 09:16:19 +01:00
Dave Murphy
6e92980fd1 devkitPPC: allow external gcc config params 2021-05-25 09:16:19 +01:00
Dave Murphy
3673dced6d devkitPPC: reduce printf bloat 2021-05-25 09:16:19 +01:00
Dave Murphy
6999db3f10 devkitPPC: next release is 39 2021-05-25 09:16:19 +01:00
Dave Murphy
ae793d657a devkitPPC: update binutils to 2.36.1 2021-05-25 09:16:19 +01:00
Dave Murphy
c375da789d devkitPPC: update newlib to 4.1.0 2021-05-25 09:16:19 +01:00
Dave Murphy
b8c7c915bc allow prevention of binary stripping 2021-05-09 13:50:54 +01:00
Dave Murphy
c108162819 use ansi stdio on mingw host too 2021-05-09 13:38:10 +01:00
Dave Murphy
e952463476 use the supplied zlib 2021-05-08 21:28:54 +01:00
Dave Murphy
1444dc91df allow external variables to influence build 2021-05-08 21:10:04 +01:00
Dave Murphy
4219405837 devkitARM: update gcc patch 2021-04-30 13:08:32 +01:00
Dave Murphy
aacd4f8bf6 devkitARM: allow external gcc config params 2021-04-30 13:08:32 +01:00
Dave Murphy
e4cb9e3b2f devkitARM: update binutils to 2.36.1 2021-04-30 13:08:32 +01:00
Dave Murphy
85ec801a13 devkitARM: update newlib to 4.1.0 2021-04-30 13:08:32 +01:00
Dave Murphy
0eb81ba063 devkitARM: next release is 56 2021-04-30 13:08:32 +01:00
Dave Murphy
5740d1d57d devkitARM: update gcc to 11.1.0 2021-04-30 13:08:32 +01:00
12 changed files with 307 additions and 279 deletions

View File

@@ -1,8 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash
#---------------------------------------------------------------------------------
# devkitARM release 55
# devkitPPC release 38
# devkitPPC release 39
# devkitA64 release 17
#---------------------------------------------------------------------------------
@@ -59,13 +58,6 @@ if [ ! -z "$CROSSBUILD" ] ; then
fi
fi
#---------------------------------------------------------------------------------
# Sane defaults for building toolchain
#---------------------------------------------------------------------------------
export CFLAGS="-O2 -pipe"
export CXXFLAGS="$CFLAGS"
unset LDFLAGS
#---------------------------------------------------------------------------------
# Look for automated configuration file to bypass prompts
#---------------------------------------------------------------------------------
@@ -162,7 +154,7 @@ case $PLATFORM in
fi
;;
MINGW32* )
cppflags="-D__USE_MINGW_ACCESS"
cppflags="-D__USE_MINGW_ACCESS -D__USE_MINGW_ANSI_STDIO=1"
;;
esac
@@ -238,8 +230,10 @@ fi
cd $BUILDSCRIPTDIR
echo "stripping installed binaries"
. ./strip_bins.sh
if [ "$BUILD_DKPRO_NO_STRIP_BINARIES" != "1" ]; then
echo "stripping installed binaries"
. ./strip_bins.sh
fi
#---------------------------------------------------------------------------------
# Clean up temporary files and source directories

View File

@@ -62,10 +62,9 @@ then
--with-newlib=yes \
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix \
--enable-lto $plugin_ld\
--with-system-zlib \
--disable-tm-clone-registry \
--disable-__cxa_atexit \
--enable-lto \
--disable-tm-clone-registry \
--disable-__cxa_atexit \
--with-bugurl="https://github.com/devkitPro/buildscripts/issues" --with-pkgversion="devkitA64 release 17" \
$CROSS_PARAMS \
$CROSS_GCC_PARAMS \

View File

@@ -1,8 +1,70 @@
diff --git a/gcc/config.host b/gcc/config.host
index 0a02c33cc80..38f7adc655e 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -251,6 +251,10 @@ case ${host} in
host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o"
host_lto_plugin_soname=liblto_plugin.dll
;;
+ aarch64-*-darwin*)
+ out_host_hook_obj="${out_host_hook_obj} host-aarch64-darwin.o"
+ host_xmake_file="${host_xmake_file} aarch64/x-darwin"
+ ;;
i[34567]86-*-darwin* | x86_64-*-darwin*)
out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o"
host_xmake_file="${host_xmake_file} i386/x-darwin"
diff --git a/gcc/config/aarch64/host-aarch64-darwin.c b/gcc/config/aarch64/host-aarch64-darwin.c
new file mode 100644
index 00000000000..92c38b0b9db
--- /dev/null
+++ b/gcc/config/aarch64/host-aarch64-darwin.c
@@ -0,0 +1,32 @@
+/* i386-darwin host-specific hook definitions.
+ Copyright (C) 2003-2021 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/>. */
+
+#define IN_TARGET_CODE 1
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "hosthooks.h"
+#include "hosthooks-def.h"
+#include "config/host-darwin.h"
+
+/* Darwin doesn't do anything special for aarch64 hosts; this file exists just
+ to include config/host-darwin.h. */
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
diff --git a/gcc/config/aarch64/x-darwin b/gcc/config/aarch64/x-darwin
new file mode 100644
index 00000000000..6d788d5e89c
--- /dev/null
+++ b/gcc/config/aarch64/x-darwin
@@ -0,0 +1,3 @@
+host-aarch64-darwin.o : $(srcdir)/config/aarch64/host-aarch64-darwin.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
index 728be500b80..74c1abad635 100644
index 0becb4385b6..30bd4a24cd6 100644
--- a/gcc/config/arm/arm-cpus.in
+++ b/gcc/config/arm/arm-cpus.in
@@ -392,7 +392,7 @@ begin arch armv6k
@@ -400,7 +400,7 @@ begin arch armv6k
tune for mpcore
tune flags CO_PROC
base 6K
@@ -12,7 +74,7 @@ index 728be500b80..74c1abad635 100644
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 3d92bd23322..35cefcde676 100644
index d68def30867..d31f1e31ee6 100644
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -16,111 +16,14 @@
@@ -133,7 +195,7 @@ index 3d92bd23322..35cefcde676 100644
-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
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index 9ad2947505f..1790caa8e88 100644
index cca6f0ece54..8b78c28c7bb 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -29,7 +29,7 @@
@@ -153,52 +215,26 @@ index 9ad2947505f..1790caa8e88 100644
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group"
+
diff --git a/gcc/config/i386/host-mingw32.c b/gcc/config/i386/host-mingw32.c
index 250fef59b55..36b2239aa5d 100644
index 360a280b23a..2c03947999a 100644
--- a/gcc/config/i386/host-mingw32.c
+++ b/gcc/config/i386/host-mingw32.c
@@ -44,9 +44,6 @@ static size_t mingw32_gt_pch_alloc_granularity (void);
@@ -45,7 +45,11 @@ static size_t mingw32_gt_pch_alloc_granularity (void);
static inline void w32_error(const char*, const char*, int, const char*);
-/* FIXME: Is this big enough? */
-static const size_t pch_VA_max_size = 128 * 1024 * 1024;
-
/* FIXME: Is this big enough? */
+#if __MINGW64__
+static const size_t pch_VA_max_size = UINT64_C(64 * 1024 * 1024 * 1024);
+#else
static const size_t pch_VA_max_size = 128 * 1024 * 1024;
+#endif
/* Granularity for reserving address space. */
static size_t va_granularity = 0x10000;
@@ -88,9 +85,6 @@ static void *
mingw32_gt_pch_get_address (size_t size, int)
{
void* res;
- size = (size + va_granularity - 1) & ~(va_granularity - 1);
- if (size > pch_VA_max_size)
- return NULL;
/* FIXME: We let system determine base by setting first arg to NULL.
Allocating at top of available address space avoids unnecessary
@@ -100,7 +94,7 @@ 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. */
- res = VirtualAlloc (NULL, pch_VA_max_size,
+ res = VirtualAlloc (NULL, size,
MEM_RESERVE | MEM_TOP_DOWN,
PAGE_NOACCESS);
if (!res)
@@ -150,7 +144,7 @@ mingw32_gt_pch_use_address (void *addr, size_t size, int fd,
/* Offset must be also be a multiple of allocation granularity for
this to work. We can't change the offset. */
- if ((offset & (va_granularity - 1)) != 0 || size > pch_VA_max_size)
+ if ((offset & (va_granularity - 1)) != 0)
return -1;
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 9f790db0daf..97f52d0b893 100644
index 7837553958b..69d7a798e2e 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -793,6 +793,11 @@ proper position among the other output files. */
@@ -853,6 +853,11 @@ proper position among the other output files. */
#endif
#endif
@@ -210,7 +246,7 @@ index 9f790db0daf..97f52d0b893 100644
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
#ifndef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -1085,6 +1090,7 @@ static const char *link_spec = LINK_SPEC;
@@ -1197,6 +1202,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;
@@ -218,7 +254,7 @@ index 9f790db0daf..97f52d0b893 100644
static const char *endfile_spec = ENDFILE_SPEC;
static const char *startfile_spec = STARTFILE_SPEC;
static const char *linker_name_spec = LINKER_NAME;
@@ -1582,6 +1588,7 @@ static struct spec_list static_specs[] =
@@ -1702,6 +1708,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),
@@ -237,7 +273,7 @@ index dddddc7c444..c2502597953 100644
-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index 3f769a1c660..e005d8304b7 100644
index 675930db043..bdfd6f6b0bb 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -325,7 +325,7 @@ register_tm_clones (void)
@@ -249,3 +285,43 @@ index 3f769a1c660..e005d8304b7 100644
/* 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/libstdc++-v3/include/c_compatibility/fenv.h b/libstdc++-v3/include/c_compatibility/fenv.h
index 0413e3b7c25..ff5f8bbe1a1 100644
--- a/libstdc++-v3/include/c_compatibility/fenv.h
+++ b/libstdc++-v3/include/c_compatibility/fenv.h
@@ -26,6 +26,10 @@
* This is a Standard C++ Library header.
*/
+#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+# include_next <fenv.h>
+#else
+
#ifndef _GLIBCXX_FENV_H
#define _GLIBCXX_FENV_H 1
@@ -79,3 +83,5 @@ namespace std
#endif // C++11
#endif // _GLIBCXX_FENV_H
+
+#endif // __cplusplus
diff --git a/libstdc++-v3/include/c_global/cfenv b/libstdc++-v3/include/c_global/cfenv
index 0b0ec35a837..d24cb1a3c81 100644
--- a/libstdc++-v3/include/c_global/cfenv
+++ b/libstdc++-v3/include/c_global/cfenv
@@ -37,9 +37,11 @@
#include <bits/c++config.h>
-#if _GLIBCXX_HAVE_FENV_H
-# include <fenv.h>
-#endif
+// Need to ensure this finds the C library's <fenv.h> not a libstdc++
+// wrapper that might already be installed later in the include search path.
+#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+#include_next <fenv.h>
+#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#ifdef _GLIBCXX_USE_C99_FENV_TR1

View File

@@ -1,8 +1,8 @@
diff --git a/libgloss/configure b/libgloss/configure
index 0d2918cee..bccfb07b4 100755
index 816b9c4b8..b79edb6c8 100755
--- a/libgloss/configure
+++ b/libgloss/configure
@@ -2604,6 +2604,8 @@ if test "${config_libnosys}" = "true"; then
@@ -2609,6 +2609,8 @@ if test "${config_libnosys}" = "true"; then
fi
@@ -12,7 +12,7 @@ index 0d2918cee..bccfb07b4 100755
ac_config_commands="$ac_config_commands depfiles"
diff --git a/libgloss/configure.in b/libgloss/configure.in
index f38d5298e..509c31071 100644
index 4111724e1..0e44d885e 100644
--- a/libgloss/configure.in
+++ b/libgloss/configure.in
@@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
@@ -23,7 +23,7 @@ index f38d5298e..509c31071 100644
if test "${enable_shared}" = "yes" ; then
echo "Shared libraries not supported for cross compiling, ignored"
@@ -193,6 +194,7 @@ dnl fi
@@ -196,6 +197,7 @@ dnl fi
if test "${config_libnosys}" = "true"; then
AC_CONFIG_SUBDIRS([libnosys])
fi
@@ -7408,10 +7408,10 @@ index 000000000..61de918bc
+ return ret;
+}
diff --git a/newlib/configure.host b/newlib/configure.host
index a84c0c80a..29fb7ed24 100644
index 1ddbb6c76..ed9999bea 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -687,6 +687,14 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID
@@ -694,6 +694,14 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID
syscall_dir=syscalls
default_newlib_io_long_long="yes"
;;
@@ -7426,8 +7426,34 @@ index a84c0c80a..29fb7ed24 100644
arm*-*-pe)
syscall_dir=syscalls
;;
diff --git a/newlib/libc/ctype/jp2uc.c b/newlib/libc/ctype/jp2uc.c
index 5e30f09be..1ea357f92 100644
--- a/newlib/libc/ctype/jp2uc.c
+++ b/newlib/libc/ctype/jp2uc.c
@@ -35,7 +35,7 @@
#ifdef _MB_CAPABLE
/* Under Cygwin, the incoming wide character is already given in UTF due
to the requirements of the underlying OS. */
-#ifndef __CYGWIN__
+#if !defined(__CYGWIN__) && !defined(__DEVKITA64__)
#include <_ansi.h>
#include <string.h>
diff --git a/newlib/libc/ctype/local.h b/newlib/libc/ctype/local.h
index 5c293c83d..75ccf89f5 100644
--- a/newlib/libc/ctype/local.h
+++ b/newlib/libc/ctype/local.h
@@ -32,7 +32,7 @@
* for towupper and towlower, the result must be back-transformed
into the respective locale encoding; currently NOT IMPLEMENTED
*/
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) || defined(__DEVKITA64__)
/* Under Cygwin, wchar_t (or its extension wint_t) is Unicode */
#define _jp2uc(c) (c)
#define _jp2uc_l(c, l) (c)
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
index 164d95bca..083e48758 100644
index ab18806e3..db77ebb2a 100644
--- a/newlib/libc/include/stdio.h
+++ b/newlib/libc/include/stdio.h
@@ -233,7 +233,7 @@ int fsetpos (FILE *, const _fpos_t *);
@@ -7440,7 +7466,7 @@ index 164d95bca..083e48758 100644
void clearerr (FILE *);
int feof (FILE *);
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index d746b15fc..80169d9b7 100644
index 4bc8d29bf..35c05e6af 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -4,6 +4,9 @@
@@ -7770,7 +7796,7 @@ index 5e937f103..635a7a6b8 100644
};
#endif
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c
index 4c343e462..c04493460 100644
index 968642745..2ab1f9570 100644
--- a/newlib/libc/locale/locale.c
+++ b/newlib/libc/locale/locale.c
@@ -92,7 +92,7 @@ beginning with <<"LC_">>.
@@ -7882,7 +7908,7 @@ index 4c343e462..c04493460 100644
if (strcmp (locale, "POSIX") && strcmp (locale, "C")
&& strcmp (locale, ""))
return NULL;
@@ -990,6 +1015,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale)
@@ -991,6 +1016,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale)
const char *
__locale_ctype_ptr (void)
@@ -8031,7 +8057,7 @@ index 9b982a993..8c0aaac8c 100644
+*/
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c
index b358d2b4a..a3e597fd2 100644
index df8321461..9263e5829 100644
--- a/newlib/libc/stdio/fread.c
+++ b/newlib/libc/stdio/fread.c
@@ -135,7 +135,7 @@ crlf_r (struct _reent * ptr,
@@ -8060,7 +8086,7 @@ index b358d2b4a..a3e597fd2 100644
resid -= fp->_r;
p += fp->_r;
fp->_r = 0;
@@ -225,7 +224,31 @@ _fread_r (struct _reent * ptr,
@@ -225,7 +224,30 @@ _fread_r (struct _reent * ptr,
/* fp->_r = 0 ... done in __srefill */
p += r;
resid -= r;
@@ -8075,7 +8101,7 @@ index b358d2b4a..a3e597fd2 100644
+ int old_size = fp->_bf._size;
+ /* allow __refill to use user's buffer */
+ fp->_bf._base = (unsigned char *) p;
+ fp->_bf._size = resid;
+ fp->_bf._size = resid - old_size;
+ fp->_p = (unsigned char *) p;
+ rc = __srefill_r (ptr, fp);
+ /* restore fp buffering back to original state */
@@ -8084,20 +8110,19 @@ index b358d2b4a..a3e597fd2 100644
+ fp->_p = old_base;
+ resid -= fp->_r;
+ p += fp->_r;
+ fp->_r = 0;
+
+ } else {
+ rc = __srefill_r (ptr, fp);
+ //fp->_r = 0;
+ }
+ rc = __srefill_r (ptr, fp);
+
+ if (rc)
{
/* no more input: return partial result */
#ifdef __SCLE
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index c4bf2dbe3..d756df37d 100644
index 1aaf05aa4..b67182a79 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -112,6 +112,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
@@ -108,6 +108,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/
@@ -8106,7 +8131,7 @@ index c4bf2dbe3..d756df37d 100644
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/
static char *rcsid = "$Id$";
@@ -1438,7 +1440,7 @@ reswitch: switch (ch) {
@@ -1434,7 +1436,7 @@ reswitch: switch (ch) {
string:
#endif
sign = '\0';
@@ -8115,7 +8140,7 @@ index c4bf2dbe3..d756df37d 100644
/* Behavior is undefined if the user passed a
NULL string when precision is not 0.
However, if we are not optimizing for size,
@@ -1448,7 +1450,7 @@ string:
@@ -1444,7 +1446,7 @@ string:
size = ((unsigned) prec > 6U) ? 6 : prec;
}
else
@@ -8125,7 +8150,7 @@ index c4bf2dbe3..d756df37d 100644
if (ch == 'S' || (flags & LONGINT)) {
mbstate_t ps;
diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c
index 9c38eebf4..fbc8d877d 100644
index 994cee7fc..5d1d0a1cd 100644
--- a/newlib/libc/stdio/vfscanf.c
+++ b/newlib/libc/stdio/vfscanf.c
@@ -74,6 +74,8 @@ These are GNU extensions.
@@ -8152,7 +8177,7 @@ index 980b31e3b..722be905e 100644
#ifdef INTEGER_ONLY
diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c
index ffb6cc85b..db33d4f29 100644
index f00d41a09..7e290ee8d 100644
--- a/newlib/libc/stdio/vfwscanf.c
+++ b/newlib/libc/stdio/vfwscanf.c
@@ -74,6 +74,9 @@ PORTABILITY
@@ -8166,37 +8191,18 @@ index ffb6cc85b..db33d4f29 100644
#include <reent.h>
#include <newlib.h>
diff --git a/newlib/libc/stdlib/aligned_alloc.c b/newlib/libc/stdlib/aligned_alloc.c
index 88413ce86..24029a6f7 100644
index feb22c24b..3dae0c9a9 100644
--- a/newlib/libc/stdlib/aligned_alloc.c
+++ b/newlib/libc/stdlib/aligned_alloc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2015 embedded brains GmbH
+ * Copyright (c) 2018 Dave Murphy
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,14 +25,15 @@
*/
@@ -28,6 +28,8 @@
#include <reent.h>
#include <stdlib.h>
+#include <malloc.h>
+#include <errno.h>
void *
aligned_alloc(size_t alignment, size_t size)
{
- void *p;
- int error;
+ if ((alignment !=0) && !(alignment & (alignment - 1 )) && !(size & (alignment - 1)))
+ return memalign(alignment,size);
- error = posix_memalign(&p, alignment, size);
-
- return (error == 0 ? p : NULL);
+ errno = EINVAL;
+ return (void*)NULL;
}
aligned_alloc (size_t align, size_t size)
diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c
index 920a7ea3c..ba5ee7652 100644
--- a/newlib/libc/stdlib/mbtowc_r.c

View File

@@ -66,9 +66,10 @@ then
--with-system-zlib \
--disable-tm-clone-registry \
--disable-__cxa_atexit \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitARM release 55" \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitARM release 56" \
$CROSS_PARAMS \
$CROSS_GCC_PARAMS \
$EXTRA_GCC_PARAMS \
|| { echo "Error configuring gcc"; exit 1; }
touch configured-gcc
fi

View File

@@ -1,12 +0,0 @@
diff -NBaur binutils-2.34/opcodes/ppc-opc.c binutils-2.34-ppc/opcodes/ppc-opc.c
--- binutils-2.34/opcodes/ppc-opc.c 2020-01-18 13:55:49.000000000 +0000
+++ binutils-2.34-ppc/opcodes/ppc-opc.c 2020-05-22 10:47:37.900308413 +0000
@@ -3747,7 +3747,7 @@
#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

View File

@@ -1,7 +1,7 @@
diff -NBaur binutils-2.31.1/opcodes/ppc-opc.c binutils-2.31.1-ppc/opcodes/ppc-opc.c
--- binutils-2.31.1/opcodes/ppc-opc.c 2018-06-24 19:38:58.000000000 +0100
+++ binutils-2.31.1-ppc/opcodes/ppc-opc.c 2018-11-01 10:59:42.814553627 +0000
@@ -3501,7 +3501,7 @@
diff -NBaur binutils-2.36.1/opcodes/ppc-opc.c binutils-2.36.1-ppc/opcodes/ppc-opc.c
--- binutils-2.36.1/opcodes/ppc-opc.c 2021-01-09 10:47:34.000000000 +0000
+++ binutils-2.36.1-ppc/opcodes/ppc-opc.c 2021-02-14 19:41:09.350749949 +0000
@@ -4225,7 +4225,7 @@
#define MFDEC2 (PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_BOOKE \
| PPC_OPCODE_TITAN)
#define BOOKE PPC_OPCODE_BOOKE

View File

@@ -11,49 +11,23 @@ index 4b937306ad0..bfd0375bd60 100644
lynx) thread_header=config/gthr-lynx.h ;;
mipssde) thread_header=config/mips/gthr-mipssde.h ;;
diff --git a/gcc/config/i386/host-mingw32.c b/gcc/config/i386/host-mingw32.c
index 250fef59b55..36b2239aa5d 100644
index 360a280b23a..2c03947999a 100644
--- a/gcc/config/i386/host-mingw32.c
+++ b/gcc/config/i386/host-mingw32.c
@@ -44,9 +44,6 @@ static size_t mingw32_gt_pch_alloc_granularity (void);
@@ -45,7 +45,11 @@ static size_t mingw32_gt_pch_alloc_granularity (void);
static inline void w32_error(const char*, const char*, int, const char*);
-/* FIXME: Is this big enough? */
-static const size_t pch_VA_max_size = 128 * 1024 * 1024;
-
/* FIXME: Is this big enough? */
+#if __MINGW64__
+static const size_t pch_VA_max_size = UINT64_C(64 * 1024 * 1024 * 1024);
+#else
static const size_t pch_VA_max_size = 128 * 1024 * 1024;
+#endif
/* Granularity for reserving address space. */
static size_t va_granularity = 0x10000;
@@ -88,9 +85,6 @@ static void *
mingw32_gt_pch_get_address (size_t size, int)
{
void* res;
- size = (size + va_granularity - 1) & ~(va_granularity - 1);
- if (size > pch_VA_max_size)
- return NULL;
/* FIXME: We let system determine base by setting first arg to NULL.
Allocating at top of available address space avoids unnecessary
@@ -100,7 +94,7 @@ 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. */
- res = VirtualAlloc (NULL, pch_VA_max_size,
+ res = VirtualAlloc (NULL, size,
MEM_RESERVE | MEM_TOP_DOWN,
PAGE_NOACCESS);
if (!res)
@@ -150,7 +144,7 @@ mingw32_gt_pch_use_address (void *addr, size_t size, int fd,
/* Offset must be also be a multiple of allocation granularity for
this to work. We can't change the offset. */
- if ((offset & (va_granularity - 1)) != 0 || size > pch_VA_max_size)
+ if ((offset & (va_granularity - 1)) != 0)
return -1;
diff --git a/gcc/config/newlib-stdint.h b/gcc/config/newlib-stdint.h
index 2e086f16de9..1c27c6467bc 100644
index 65d1fa2cd1f..51991aab75c 100644
--- a/gcc/config/newlib-stdint.h
+++ b/gcc/config/newlib-stdint.h
@@ -25,7 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -66,7 +40,7 @@ index 2e086f16de9..1c27c6467bc 100644
#define SIG_ATOMIC_TYPE "int"
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 132ca20fd7d..119ee5bbc8c 100644
index 164d359b724..4785fcf6e73 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -196,6 +196,7 @@ ASM_OPT_ANY
@@ -87,7 +61,7 @@ index 132ca20fd7d..119ee5bbc8c 100644
#ifndef CC1_CPU_SPEC
#ifdef HAVE_LOCAL_CPU_DETECT
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 9ade72114e9..cede792d3a7 100644
index 510abe169c5..988e82007b0 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -590,7 +590,11 @@ GNU_USER_TARGET_CC1_SPEC
@@ -245,7 +219,7 @@ index 9ade72114e9..cede792d3a7 100644
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff --git a/gcc/config/rs6000/sysv4.opt b/gcc/config/rs6000/sysv4.opt
index b49ba261f3c..4eda763dfca 100644
index 7ab55c49940..763709e907e 100644
--- a/gcc/config/rs6000/sysv4.opt
+++ b/gcc/config/rs6000/sysv4.opt
@@ -124,6 +124,26 @@ mads
@@ -276,10 +250,10 @@ index b49ba261f3c..4eda763dfca 100644
Target RejectNegative
Link with libyk.a, libc.a and crt0.o.
diff --git a/gcc/configure b/gcc/configure
index eb6061c1631..4c6e993ca3a 100755
index e8ecb3b0297..10ebe252c12 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -12208,7 +12208,7 @@ case ${enable_threads} in
@@ -12593,7 +12593,7 @@ case ${enable_threads} in
# default
target_thread_file='single'
;;
@@ -289,10 +263,10 @@ index eb6061c1631..4c6e993ca3a 100755
target_thread_file=${enable_threads}
;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 715fcba0482..779743b69ee 100644
index 96a6f62b0d3..c5dd3465634 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1800,7 +1800,7 @@ case ${enable_threads} in
@@ -1925,7 +1925,7 @@ case ${enable_threads} in
# default
target_thread_file='single'
;;
@@ -302,7 +276,7 @@ index 715fcba0482..779743b69ee 100644
target_thread_file=${enable_threads}
;;
diff --git a/libgcc/config/rs6000/crtrestvr.S b/libgcc/config/rs6000/crtrestvr.S
index 260fe4d1af6..664808cd19c 100644
index b372409dd42..708ba039963 100644
--- a/libgcc/config/rs6000/crtrestvr.S
+++ b/libgcc/config/rs6000/crtrestvr.S
@@ -24,7 +24,7 @@
@@ -320,7 +294,7 @@ index 260fe4d1af6..664808cd19c 100644
#endif
+#endif
diff --git a/libgcc/config/rs6000/crtsavevr.S b/libgcc/config/rs6000/crtsavevr.S
index 7e1d5c5df98..2c62480d165 100644
index 48a4d65eed4..6835ea69279 100644
--- a/libgcc/config/rs6000/crtsavevr.S
+++ b/libgcc/config/rs6000/crtsavevr.S
@@ -24,7 +24,7 @@
@@ -866,10 +840,10 @@ index fb812d3801f..7f6669d530f 100644
# This can't end up in shared libgcc
diff --git a/libgcc/configure b/libgcc/configure
index 26bf75789e0..1f663d2cfb0 100755
index dd3afb2c957..abc5466abdc 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -5640,6 +5640,7 @@ tm_file="${tm_file_}"
@@ -5642,6 +5642,7 @@ tm_file="${tm_file_}"
case $target_thread_file in
aix) thread_header=config/rs6000/gthr-aix.h ;;
dce) thread_header=config/pa/gthr-dce.h ;;
@@ -878,7 +852,7 @@ index 26bf75789e0..1f663d2cfb0 100755
lynx) thread_header=config/gthr-lynx.h ;;
mipssde) thread_header=config/mips/gthr-mipssde.h ;;
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index 3f769a1c660..e005d8304b7 100644
index 675930db043..bdfd6f6b0bb 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -325,7 +325,7 @@ register_tm_clones (void)
@@ -891,10 +865,10 @@ index 3f769a1c660..e005d8304b7 100644
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/libstdc++-v3/configure b/libstdc++-v3/configure
index 9f9c5a2419a..c9bb6c548be 100755
index 326a279c54f..d2cb9d18294 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -15637,6 +15637,7 @@ $as_echo "$target_thread_file" >&6; }
@@ -15698,6 +15698,7 @@ $as_echo "$target_thread_file" >&6; }
case $target_thread_file in
aix) thread_header=config/rs6000/gthr-aix.h ;;
dce) thread_header=config/pa/gthr-dce.h ;;
@@ -902,3 +876,43 @@ index 9f9c5a2419a..c9bb6c548be 100755
gcn) thread_header=config/gcn/gthr-gcn.h ;;
lynx) thread_header=config/gthr-lynx.h ;;
mipssde) thread_header=config/mips/gthr-mipssde.h ;;
diff --git a/libstdc++-v3/include/c_compatibility/fenv.h b/libstdc++-v3/include/c_compatibility/fenv.h
index 0413e3b7c25..ff5f8bbe1a1 100644
--- a/libstdc++-v3/include/c_compatibility/fenv.h
+++ b/libstdc++-v3/include/c_compatibility/fenv.h
@@ -26,6 +26,10 @@
* This is a Standard C++ Library header.
*/
+#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+# include_next <fenv.h>
+#else
+
#ifndef _GLIBCXX_FENV_H
#define _GLIBCXX_FENV_H 1
@@ -79,3 +83,5 @@ namespace std
#endif // C++11
#endif // _GLIBCXX_FENV_H
+
+#endif // __cplusplus
diff --git a/libstdc++-v3/include/c_global/cfenv b/libstdc++-v3/include/c_global/cfenv
index 0b0ec35a837..d24cb1a3c81 100644
--- a/libstdc++-v3/include/c_global/cfenv
+++ b/libstdc++-v3/include/c_global/cfenv
@@ -37,9 +37,11 @@
#include <bits/c++config.h>
-#if _GLIBCXX_HAVE_FENV_H
-# include <fenv.h>
-#endif
+// Need to ensure this finds the C library's <fenv.h> not a libstdc++
+// wrapper that might already be installed later in the include search path.
+#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+#include_next <fenv.h>
+#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#ifdef _GLIBCXX_USE_C99_FENV_TR1

View File

@@ -1,60 +0,0 @@
diff -NBaur gdb-8.2.1/gdb/dtrace-probe.c gdb-8.2.1-apple/gdb/dtrace-probe.c
--- gdb-8.2.1/gdb/dtrace-probe.c 2018-12-23 05:51:54.000000000 +0000
+++ gdb-8.2.1-apple/gdb/dtrace-probe.c 2019-02-19 17:30:16.449175937 +0000
@@ -100,7 +100,7 @@
/* DTrace static_probe_ops. */
-const dtrace_static_probe_ops dtrace_static_probe_ops;
+const dtrace_static_probe_ops dtrace_static_probe_ops = {};
/* The following structure represents a dtrace probe. */
diff -NBaur gdb-8.2.1/gdb/probe.c gdb-8.2.1-apple/gdb/probe.c
--- gdb-8.2.1/gdb/probe.c 2018-12-23 05:51:54.000000000 +0000
+++ gdb-8.2.1-apple/gdb/probe.c 2019-02-19 17:31:05.266578008 +0000
@@ -60,7 +60,7 @@
/* Static operations associated with a generic probe. */
-const any_static_probe_ops any_static_probe_ops;
+const any_static_probe_ops any_static_probe_ops = {};
/* A helper for parse_probes that decodes a probe specification in
SEARCH_PSPACE. It appends matching SALs to RESULT. */
diff -NBaur gdb-8.2.1/gdb/record-btrace.c gdb-8.2.1-apple/gdb/record-btrace.c
--- gdb-8.2.1/gdb/record-btrace.c 2018-12-23 05:51:54.000000000 +0000
+++ gdb-8.2.1-apple/gdb/record-btrace.c 2019-02-19 17:31:33.301731324 +0000
@@ -144,7 +144,7 @@
/* Token associated with a new-thread observer enabling branch tracing
for the new thread. */
-static const gdb::observers::token record_btrace_thread_observer_token;
+static const gdb::observers::token record_btrace_thread_observer_token = {};
/* Memory access types used in set/show record btrace replay-memory-access. */
static const char replay_memory_access_read_only[] = "read-only";
diff -NBaur gdb-8.2.1/gdb/stap-probe.c gdb-8.2.1-apple/gdb/stap-probe.c
--- gdb-8.2.1/gdb/stap-probe.c 2018-12-23 05:51:54.000000000 +0000
+++ gdb-8.2.1-apple/gdb/stap-probe.c 2019-02-19 17:29:35.744567941 +0000
@@ -119,7 +119,7 @@
/* SystemTap static_probe_ops. */
-const stap_static_probe_ops stap_static_probe_ops;
+const stap_static_probe_ops stap_static_probe_ops = {};
class stap_probe : public probe
{
diff -NBaur gdb-8.2.1/gdb/tui/tui-hooks.c gdb-8.2.1-apple/gdb/tui/tui-hooks.c
--- gdb-8.2.1/gdb/tui/tui-hooks.c 2018-12-23 05:51:54.000000000 +0000
+++ gdb-8.2.1-apple/gdb/tui/tui-hooks.c 2019-02-19 17:28:53.178460364 +0000
@@ -205,7 +205,7 @@
/* Token associated with observers registered while TUI hooks are
installed. */
-static const gdb::observers::token tui_observers_token;
+static const gdb::observers::token tui_observers_token = {};
/* Attach or detach a single observer, according to ATTACH. */

View File

@@ -1,8 +1,8 @@
diff --git a/libgloss/configure b/libgloss/configure
index 0d2918cee..bccfb07b4 100755
index 816b9c4b8..b79edb6c8 100755
--- a/libgloss/configure
+++ b/libgloss/configure
@@ -2604,6 +2604,8 @@ if test "${config_libnosys}" = "true"; then
@@ -2609,6 +2609,8 @@ if test "${config_libnosys}" = "true"; then
fi
@@ -12,7 +12,7 @@ index 0d2918cee..bccfb07b4 100755
ac_config_commands="$ac_config_commands depfiles"
diff --git a/libgloss/configure.in b/libgloss/configure.in
index f38d5298e..db6b33ab8 100644
index 4111724e1..dfd632c20 100644
--- a/libgloss/configure.in
+++ b/libgloss/configure.in
@@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
@@ -33,7 +33,7 @@ index f38d5298e..db6b33ab8 100644
case "${target}" in
aarch64*-*-*)
AC_CONFIG_SUBDIRS(aarch64)
@@ -194,6 +198,10 @@ if test "${config_libnosys}" = "true"; then
@@ -197,6 +201,10 @@ if test "${config_libnosys}" = "true"; then
AC_CONFIG_SUBDIRS([libnosys])
fi
@@ -7372,15 +7372,16 @@ index 000000000..bd25d775d
+ exit ( main(__system_argv->argc,__system_argv->argv) );
+}
diff --git a/newlib/configure.host b/newlib/configure.host
index a84c0c80a..0921e00be 100644
index 1ddbb6c76..ef4cbe6c3 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -853,7 +853,12 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID
@@ -864,7 +864,13 @@ 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_long_long="yes"
+ newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -D__DEFAULT_UTF8__"
+ newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections"
@@ -7389,6 +7390,32 @@ index a84c0c80a..0921e00be 100644
powerpc*-*-elf* | \
powerpc*-*-linux* | \
powerpc*-*-rtem* | \
diff --git a/newlib/libc/ctype/jp2uc.c b/newlib/libc/ctype/jp2uc.c
index 5e30f09be..1ea357f92 100644
--- a/newlib/libc/ctype/jp2uc.c
+++ b/newlib/libc/ctype/jp2uc.c
@@ -35,7 +35,7 @@
#ifdef _MB_CAPABLE
/* Under Cygwin, the incoming wide character is already given in UTF due
to the requirements of the underlying OS. */
-#ifndef __CYGWIN__
+#if !defined(__CYGWIN__) && !defined(__DEVKITA64__)
#include <_ansi.h>
#include <string.h>
diff --git a/newlib/libc/ctype/local.h b/newlib/libc/ctype/local.h
index 5c293c83d..75ccf89f5 100644
--- a/newlib/libc/ctype/local.h
+++ b/newlib/libc/ctype/local.h
@@ -32,7 +32,7 @@
* for towupper and towlower, the result must be back-transformed
into the respective locale encoding; currently NOT IMPLEMENTED
*/
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) || defined(__DEVKITA64__)
/* Under Cygwin, wchar_t (or its extension wint_t) is Unicode */
#define _jp2uc(c) (c)
#define _jp2uc_l(c, l) (c)
diff --git a/newlib/libc/include/sys/dirent.h b/newlib/libc/include/sys/dirent.h
index a3fb5c02c..adb8e1083 100644
--- a/newlib/libc/include/sys/dirent.h
@@ -7668,10 +7695,10 @@ index 000000000..380329d34
+#endif // _SYS_STATVFS_H
\ No newline at end of file
diff --git a/newlib/libc/include/sys/syslimits.h b/newlib/libc/include/sys/syslimits.h
index ba9dbd667..93ed11a42 100644
index c872d2018..9ccdbc51a 100644
--- a/newlib/libc/include/sys/syslimits.h
+++ b/newlib/libc/include/sys/syslimits.h
@@ -44,12 +44,12 @@
@@ -40,12 +40,12 @@
#define LINK_MAX 32767 /* max file link count */
#define MAX_CANON 255 /* max bytes in term canon input line */
#define MAX_INPUT 255 /* max bytes in terminal input */
@@ -7713,7 +7740,7 @@ index 5e937f103..635a7a6b8 100644
};
#endif
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c
index 4c343e462..835b3a712 100644
index 968642745..82f68c809 100644
--- a/newlib/libc/locale/locale.c
+++ b/newlib/libc/locale/locale.c
@@ -166,15 +166,18 @@ No supporting OS subroutines are required.
@@ -7807,7 +7834,7 @@ index 4c343e462..835b3a712 100644
#else /* __HAVE_LOCALE_INFO__ */
{
{ NULL, NULL }, /* LC_ALL */
@@ -990,6 +1015,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale)
@@ -991,6 +1016,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale)
const char *
__locale_ctype_ptr (void)
@@ -8082,7 +8109,7 @@ index aa22a0e3a..93e672b6a 100644
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-scanf.o `test -f 'scanf.c' || echo '$(srcdir)/'`scanf.c
diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c
index 022992b8d..bdf4c7bb0 100644
index 1ac551fed..d293b7b0e 100644
--- a/newlib/libc/stdio/fopen.c
+++ b/newlib/libc/stdio/fopen.c
@@ -139,6 +139,9 @@ _fopen_r (struct _reent *ptr,
@@ -8096,7 +8123,7 @@ index 022992b8d..bdf4c7bb0 100644
fp->_flags = flags;
fp->_cookie = (void *) fp;
diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c
index b358d2b4a..78bb0df30 100644
index df8321461..eee4181cd 100644
--- a/newlib/libc/stdio/fread.c
+++ b/newlib/libc/stdio/fread.c
@@ -187,7 +187,6 @@ _fread_r (struct _reent * ptr,
@@ -8148,37 +8175,18 @@ index b358d2b4a..78bb0df30 100644
/* no more input: return partial result */
#ifdef __SCLE
diff --git a/newlib/libc/stdlib/aligned_alloc.c b/newlib/libc/stdlib/aligned_alloc.c
index 88413ce86..24029a6f7 100644
index feb22c24b..3dae0c9a9 100644
--- a/newlib/libc/stdlib/aligned_alloc.c
+++ b/newlib/libc/stdlib/aligned_alloc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2015 embedded brains GmbH
+ * Copyright (c) 2018 Dave Murphy
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,14 +25,15 @@
*/
@@ -28,6 +28,8 @@
#include <reent.h>
#include <stdlib.h>
+#include <malloc.h>
+#include <errno.h>
void *
aligned_alloc(size_t alignment, size_t size)
{
- void *p;
- int error;
+ if ((alignment !=0) && !(alignment & (alignment - 1 )) && !(size & (alignment - 1)))
+ return memalign(alignment,size);
- error = posix_memalign(&p, alignment, size);
-
- return (error == 0 ? p : NULL);
+ errno = EINVAL;
+ return (void*)NULL;
}
aligned_alloc (size_t align, size_t size)
diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c
index 920a7ea3c..ba5ee7652 100644
--- a/newlib/libc/stdlib/mbtowc_r.c

View File

@@ -94,15 +94,17 @@ then
--disable-libstdcxx-verbose \
--enable-libstdcxx-time=yes \
--enable-libstdcxx-filesystem-ts \
--disable-tm-clone-registry \
--disable-__cxa_atexit \
--enable-cxx-flags='-ffunction-sections -fdata-sections' \
--target=$target \
--with-newlib \
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix\
--with-system-zlib\
--with-bugurl="https://github.com/devkitpro/buildscripts/issues" --with-pkgversion="devkitPPC release 38" \
--prefix=$prefix \
--with-bugurl="https://github.com/devkitpro/buildscripts/issues" --with-pkgversion="devkitPPC release 39" \
$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

View File

@@ -30,19 +30,19 @@ done
case "$VERSION" in
"1" )
GCC_VER=10.2.0
BINUTILS_VER=2.34
NEWLIB_VER=3.3.0
GCC_VER=11.1.0
BINUTILS_VER=2.36.1
NEWLIB_VER=4.1.0
basedir='dkarm-eabi'
package=devkitARM
target=arm-none-eabi
toolchain=DEVKITARM
;;
"2" )
GCC_VER=10.2.0
BINUTILS_VER=2.34
MN_BINUTILS_VER=2.17
NEWLIB_VER=3.3.0
GCC_VER=11.1.0
BINUTILS_VER=2.36.1
MN_BINUTILS_VER=2.24
NEWLIB_VER=4.1.0
basedir='dkppc'
package=devkitPPC
target=powerpc-eabi