diff --git a/dka64/patches/newlib-2.5.0.patch b/dka64/patches/newlib-2.5.0.patch index a5824cf..68ff794 100644 --- a/dka64/patches/newlib-2.5.0.patch +++ b/dka64/patches/newlib-2.5.0.patch @@ -1,5 +1,5 @@ diff --git a/libgloss/configure b/libgloss/configure -index 90a0522..99fe5ad 100755 +index 90a05222a..99fe5ad1e 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -2589,6 +2589,8 @@ if test "${config_libnosys}" = "true"; then @@ -12,7 +12,7 @@ index 90a0522..99fe5ad 100755 ac_config_commands="$ac_config_commands depfiles" diff --git a/libgloss/configure.in b/libgloss/configure.in -index d1b3b34..800c4a9 100644 +index d1b3b3469..800c4a9c9 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 d1b3b34..800c4a9 100644 AS=${AS-as} diff --git a/libgloss/libsysbase/Makefile.in b/libgloss/libsysbase/Makefile.in new file mode 100644 -index 0000000..7fd7357 +index 000000000..7fd7357de --- /dev/null +++ b/libgloss/libsysbase/Makefile.in @@ -0,0 +1,148 @@ @@ -187,7 +187,7 @@ index 0000000..7fd7357 + $(SHELL) config.status --recheck diff --git a/libgloss/libsysbase/_exit.c b/libgloss/libsysbase/_exit.c new file mode 100644 -index 0000000..502d6fb +index 000000000..502d6fb5f --- /dev/null +++ b/libgloss/libsysbase/_exit.c @@ -0,0 +1,19 @@ @@ -212,7 +212,7 @@ index 0000000..502d6fb +} diff --git a/libgloss/libsysbase/abort.c b/libgloss/libsysbase/abort.c new file mode 100644 -index 0000000..9272e22 +index 000000000..9272e22c9 --- /dev/null +++ b/libgloss/libsysbase/abort.c @@ -0,0 +1,8 @@ @@ -226,7 +226,7 @@ index 0000000..9272e22 + diff --git a/libgloss/libsysbase/acconfig.h b/libgloss/libsysbase/acconfig.h new file mode 100644 -index 0000000..200ea78 +index 000000000..200ea7873 --- /dev/null +++ b/libgloss/libsysbase/acconfig.h @@ -0,0 +1,29 @@ @@ -261,7 +261,7 @@ index 0000000..200ea78 +#undef __SYMBOL_PREFIX diff --git a/libgloss/libsysbase/aclocal.m4 b/libgloss/libsysbase/aclocal.m4 new file mode 100644 -index 0000000..b6cdfae +index 000000000..b6cdfaeb8 --- /dev/null +++ b/libgloss/libsysbase/aclocal.m4 @@ -0,0 +1,344 @@ @@ -611,7 +611,7 @@ index 0000000..b6cdfae +m4_include([../acinclude.m4]) diff --git a/libgloss/libsysbase/build_argv.c b/libgloss/libsysbase/build_argv.c new file mode 100644 -index 0000000..79d2006 +index 000000000..3ca95d5b6 --- /dev/null +++ b/libgloss/libsysbase/build_argv.c @@ -0,0 +1,31 @@ @@ -633,13 +633,13 @@ index 0000000..79d2006 + char** argv = (char**)(((int)data + len + sizeof(char **)) & ~(sizeof(char **)-1)); + char* end = data + len - 1; + int argCount = 0; -+ ++ + do { + argv[argCount++] = data; // Add next arg to argv list + while (*(data) && data < end) data++; // Move to next NULL delimiter + data++; // Move to one after the NULL delimiter + } while (data < end); -+ ++ + *end = '\0'; // Force NULL terminator for last arg + + argstruct->argv = argv; @@ -648,7 +648,7 @@ index 0000000..79d2006 +} diff --git a/libgloss/libsysbase/chdir.c b/libgloss/libsysbase/chdir.c new file mode 100644 -index 0000000..2a0fa03 +index 000000000..90d2dc5b7 --- /dev/null +++ b/libgloss/libsysbase/chdir.c @@ -0,0 +1,201 @@ @@ -703,7 +703,7 @@ index 0000000..2a0fa03 + } + + /* Grab the next directory name from extra */ -+ extraEnd = strchr (extra, DIRECTORY_SEPARATOR_CHAR); ++ extraEnd = strchr (extra, DIRECTORY_SEPARATOR_CHAR); + if (extraEnd == NULL) { + extraEnd = strrchr (extra, '\0'); + } else { @@ -715,12 +715,12 @@ index 0000000..2a0fa03 + break; + } + -+ if ((strncmp (extra, DIRECTORY_THIS, sizeof(DIRECTORY_THIS) - 1) == 0) ++ if ((strncmp (extra, DIRECTORY_THIS, sizeof(DIRECTORY_THIS) - 1) == 0) + && ((extra[sizeof(DIRECTORY_THIS)-1] == DIRECTORY_SEPARATOR_CHAR) + ||(extra[sizeof(DIRECTORY_THIS)-1] == '\0'))) + { + /* Don't copy anything */ -+ } else if ((strncmp (extra, DIRECTORY_PARENT, sizeof(DIRECTORY_PARENT) - 1) == 0) ++ } else if ((strncmp (extra, DIRECTORY_PARENT, sizeof(DIRECTORY_PARENT) - 1) == 0) + && ((extra[sizeof(DIRECTORY_PARENT)-1] == DIRECTORY_SEPARATOR_CHAR) + ||(extra[sizeof(DIRECTORY_PARENT)-1] == '\0'))) + { @@ -855,7 +855,7 @@ index 0000000..2a0fa03 +} diff --git a/libgloss/libsysbase/chmod.c b/libgloss/libsysbase/chmod.c new file mode 100644 -index 0000000..ce79a2c +index 000000000..3668b5801 --- /dev/null +++ b/libgloss/libsysbase/chmod.c @@ -0,0 +1,30 @@ @@ -873,7 +873,7 @@ index 0000000..ce79a2c + + /* Get device from path name */ + dev = FindDevice(path); -+ ++ + if (dev < 0) { + r->_errno = ENODEV; + ret = -1; @@ -891,7 +891,7 @@ index 0000000..ce79a2c + diff --git a/libgloss/libsysbase/close.c b/libgloss/libsysbase/close.c new file mode 100644 -index 0000000..d3563fb +index 000000000..a251e5b8f --- /dev/null +++ b/libgloss/libsysbase/close.c @@ -0,0 +1,49 @@ @@ -927,7 +927,7 @@ index 0000000..d3563fb + dev = handle->device; + handle->refcount--; + if (handle->refcount == 0 ) { -+ ++ + if(devoptab_list[dev]->close_r) { + ptr->deviceData = devoptab_list[dev]->deviceData; + ret = devoptab_list[dev]->close_r(ptr,handle->fileStruct); @@ -946,7 +946,7 @@ index 0000000..d3563fb +} diff --git a/libgloss/libsysbase/config.h.in b/libgloss/libsysbase/config.h.in new file mode 100644 -index 0000000..48ce950 +index 000000000..48ce950b4 --- /dev/null +++ b/libgloss/libsysbase/config.h.in @@ -0,0 +1,25 @@ @@ -976,8 +976,8 @@ index 0000000..48ce950 +/* symbol prefix */ +#undef __SYMBOL_PREFIX diff --git a/libgloss/libsysbase/configure b/libgloss/libsysbase/configure -new file mode 100755 -index 0000000..c4b5a79 +new file mode 100644 +index 000000000..c4b5a79b6 --- /dev/null +++ b/libgloss/libsysbase/configure @@ -0,0 +1,4158 @@ @@ -5141,7 +5141,7 @@ index 0000000..c4b5a79 + diff --git a/libgloss/libsysbase/configure.in b/libgloss/libsysbase/configure.in new file mode 100644 -index 0000000..4c31956 +index 000000000..bf276a413 --- /dev/null +++ b/libgloss/libsysbase/configure.in @@ -0,0 +1,199 @@ @@ -5204,9 +5204,9 @@ index 0000000..4c31956 + d10v*) + ;; + h8300*-*-*) -+ ;; ++ ;; + h8500-*-*) -+ ;; ++ ;; + i[3456]86-*-sco*) + ;; + lm32-*-*) @@ -5226,7 +5226,7 @@ index 0000000..4c31956 + v850*-*-*) + ;; + w65-*-*) -+ ;; ++ ;; + xstormy16-*-*) + ;; + z8k-*-*) @@ -5346,7 +5346,7 @@ index 0000000..4c31956 + diff --git a/libgloss/libsysbase/dirent.c b/libgloss/libsysbase/dirent.c new file mode 100644 -index 0000000..0ad2902 +index 000000000..0ad29029c --- /dev/null +++ b/libgloss/libsysbase/dirent.c @@ -0,0 +1,255 @@ @@ -5607,7 +5607,7 @@ index 0000000..0ad2902 +} diff --git a/libgloss/libsysbase/environ.c b/libgloss/libsysbase/environ.c new file mode 100644 -index 0000000..1c485b2 +index 000000000..1c485b26f --- /dev/null +++ b/libgloss/libsysbase/environ.c @@ -0,0 +1,6 @@ @@ -5619,7 +5619,7 @@ index 0000000..1c485b2 +char **environ = __env; diff --git a/libgloss/libsysbase/execve.c b/libgloss/libsysbase/execve.c new file mode 100644 -index 0000000..598b0c5 +index 000000000..598b0c5f9 --- /dev/null +++ b/libgloss/libsysbase/execve.c @@ -0,0 +1,32 @@ @@ -5657,7 +5657,7 @@ index 0000000..598b0c5 + diff --git a/libgloss/libsysbase/fchmod.c b/libgloss/libsysbase/fchmod.c new file mode 100644 -index 0000000..5c5831c +index 000000000..5c5831cdf --- /dev/null +++ b/libgloss/libsysbase/fchmod.c @@ -0,0 +1,31 @@ @@ -5694,7 +5694,7 @@ index 0000000..5c5831c +} diff --git a/libgloss/libsysbase/flock.c b/libgloss/libsysbase/flock.c new file mode 100644 -index 0000000..c6b8c92 +index 000000000..c6b8c92ad --- /dev/null +++ b/libgloss/libsysbase/flock.c @@ -0,0 +1,21 @@ @@ -5721,7 +5721,7 @@ index 0000000..c6b8c92 +} diff --git a/libgloss/libsysbase/fork.c b/libgloss/libsysbase/fork.c new file mode 100644 -index 0000000..712b13e +index 000000000..3aa75a3a1 --- /dev/null +++ b/libgloss/libsysbase/fork.c @@ -0,0 +1,25 @@ @@ -5740,7 +5740,7 @@ index 0000000..712b13e + struct _reent * r) { +//--------------------------------------------------------------------------------- +#else -+//--------------------------------------------------------------------------------- ++//--------------------------------------------------------------------------------- +int +_DEFUN (_fork, (), + _NOARGS) { @@ -5752,7 +5752,7 @@ index 0000000..712b13e +} diff --git a/libgloss/libsysbase/fstat.c b/libgloss/libsysbase/fstat.c new file mode 100644 -index 0000000..564fc32 +index 000000000..564fc328c --- /dev/null +++ b/libgloss/libsysbase/fstat.c @@ -0,0 +1,44 @@ @@ -5802,7 +5802,7 @@ index 0000000..564fc32 +} diff --git a/libgloss/libsysbase/fsync.c b/libgloss/libsysbase/fsync.c new file mode 100644 -index 0000000..4ea232b +index 000000000..4ea232bef --- /dev/null +++ b/libgloss/libsysbase/fsync.c @@ -0,0 +1,35 @@ @@ -5843,7 +5843,7 @@ index 0000000..4ea232b +} diff --git a/libgloss/libsysbase/ftruncate.c b/libgloss/libsysbase/ftruncate.c new file mode 100644 -index 0000000..bc1744c +index 000000000..bc1744c7e --- /dev/null +++ b/libgloss/libsysbase/ftruncate.c @@ -0,0 +1,36 @@ @@ -5885,7 +5885,7 @@ index 0000000..bc1744c +} diff --git a/libgloss/libsysbase/getpid.c b/libgloss/libsysbase/getpid.c new file mode 100644 -index 0000000..77d872b +index 000000000..77d872b36 --- /dev/null +++ b/libgloss/libsysbase/getpid.c @@ -0,0 +1,21 @@ @@ -5912,7 +5912,7 @@ index 0000000..77d872b + diff --git a/libgloss/libsysbase/getreent.c b/libgloss/libsysbase/getreent.c new file mode 100644 -index 0000000..1f7b905 +index 000000000..1f7b9051e --- /dev/null +++ b/libgloss/libsysbase/getreent.c @@ -0,0 +1,22 @@ @@ -5940,7 +5940,7 @@ index 0000000..1f7b905 + diff --git a/libgloss/libsysbase/gettod.c b/libgloss/libsysbase/gettod.c new file mode 100644 -index 0000000..d2982bc +index 000000000..d2982bc86 --- /dev/null +++ b/libgloss/libsysbase/gettod.c @@ -0,0 +1,35 @@ @@ -5981,7 +5981,7 @@ index 0000000..d2982bc + diff --git a/libgloss/libsysbase/handle_manager.c b/libgloss/libsysbase/handle_manager.c new file mode 100644 -index 0000000..f3fcc88 +index 000000000..f3fcc88f7 --- /dev/null +++ b/libgloss/libsysbase/handle_manager.c @@ -0,0 +1,173 @@ @@ -6160,7 +6160,7 @@ index 0000000..f3fcc88 +} diff --git a/libgloss/libsysbase/iosupport.c b/libgloss/libsysbase/iosupport.c new file mode 100644 -index 0000000..4f13127 +index 000000000..4f131275e --- /dev/null +++ b/libgloss/libsysbase/iosupport.c @@ -0,0 +1,138 @@ @@ -6304,7 +6304,7 @@ index 0000000..4f13127 + diff --git a/libgloss/libsysbase/isatty.c b/libgloss/libsysbase/isatty.c new file mode 100644 -index 0000000..c873e10 +index 000000000..c873e101d --- /dev/null +++ b/libgloss/libsysbase/isatty.c @@ -0,0 +1,20 @@ @@ -6330,7 +6330,7 @@ index 0000000..c873e10 +} diff --git a/libgloss/libsysbase/kill.c b/libgloss/libsysbase/kill.c new file mode 100644 -index 0000000..d56e340 +index 000000000..d56e3405d --- /dev/null +++ b/libgloss/libsysbase/kill.c @@ -0,0 +1,23 @@ @@ -6359,7 +6359,7 @@ index 0000000..d56e340 +} diff --git a/libgloss/libsysbase/link.c b/libgloss/libsysbase/link.c new file mode 100644 -index 0000000..b05c8fd +index 000000000..b05c8fdb1 --- /dev/null +++ b/libgloss/libsysbase/link.c @@ -0,0 +1,38 @@ @@ -6403,7 +6403,7 @@ index 0000000..b05c8fd + diff --git a/libgloss/libsysbase/lseek.c b/libgloss/libsysbase/lseek.c new file mode 100644 -index 0000000..6eeee90 +index 000000000..6eeee90de --- /dev/null +++ b/libgloss/libsysbase/lseek.c @@ -0,0 +1,52 @@ @@ -6461,7 +6461,7 @@ index 0000000..6eeee90 +} diff --git a/libgloss/libsysbase/malloc_vars.c b/libgloss/libsysbase/malloc_vars.c new file mode 100644 -index 0000000..4565909 +index 000000000..456590956 --- /dev/null +++ b/libgloss/libsysbase/malloc_vars.c @@ -0,0 +1,2 @@ @@ -6469,7 +6469,7 @@ index 0000000..4565909 +char *fake_heap_start = (char*)0; diff --git a/libgloss/libsysbase/mkdir.c b/libgloss/libsysbase/mkdir.c new file mode 100644 -index 0000000..4175cf8 +index 000000000..b4fcbd3d7 --- /dev/null +++ b/libgloss/libsysbase/mkdir.c @@ -0,0 +1,19 @@ @@ -6489,12 +6489,12 @@ index 0000000..4175cf8 + } else { + r->_errno = ENOSYS; + } -+ ++ + return ret; +} diff --git a/libgloss/libsysbase/open.c b/libgloss/libsysbase/open.c new file mode 100644 -index 0000000..a38e05c +index 000000000..a38e05c94 --- /dev/null +++ b/libgloss/libsysbase/open.c @@ -0,0 +1,60 @@ @@ -6560,7 +6560,7 @@ index 0000000..a38e05c +} diff --git a/libgloss/libsysbase/read.c b/libgloss/libsysbase/read.c new file mode 100644 -index 0000000..7f3f7f2 +index 000000000..7f3f7f2d4 --- /dev/null +++ b/libgloss/libsysbase/read.c @@ -0,0 +1,46 @@ @@ -6612,7 +6612,7 @@ index 0000000..7f3f7f2 + diff --git a/libgloss/libsysbase/rename.c b/libgloss/libsysbase/rename.c new file mode 100644 -index 0000000..7520d1d +index 000000000..f8a0aa987 --- /dev/null +++ b/libgloss/libsysbase/rename.c @@ -0,0 +1,41 @@ @@ -6654,12 +6654,12 @@ index 0000000..7520d1d + } else { + r->_errno = EXDEV; + } -+ ++ + return ret; +} diff --git a/libgloss/libsysbase/rmdir.c b/libgloss/libsysbase/rmdir.c new file mode 100644 -index 0000000..2692a29 +index 000000000..2692a2997 --- /dev/null +++ b/libgloss/libsysbase/rmdir.c @@ -0,0 +1,25 @@ @@ -6690,7 +6690,7 @@ index 0000000..2692a29 +} diff --git a/libgloss/libsysbase/sbrk.c b/libgloss/libsysbase/sbrk.c new file mode 100644 -index 0000000..5dd550c +index 000000000..5dd550c5c --- /dev/null +++ b/libgloss/libsysbase/sbrk.c @@ -0,0 +1,60 @@ @@ -6756,7 +6756,7 @@ index 0000000..5dd550c +} diff --git a/libgloss/libsysbase/stat.c b/libgloss/libsysbase/stat.c new file mode 100644 -index 0000000..e474c47 +index 000000000..e474c47fb --- /dev/null +++ b/libgloss/libsysbase/stat.c @@ -0,0 +1,44 @@ @@ -6806,7 +6806,7 @@ index 0000000..e474c47 + diff --git a/libgloss/libsysbase/statvfs.c b/libgloss/libsysbase/statvfs.c new file mode 100644 -index 0000000..b3dec22 +index 000000000..84e221340 --- /dev/null +++ b/libgloss/libsysbase/statvfs.c @@ -0,0 +1,24 @@ @@ -6831,12 +6831,12 @@ index 0000000..b3dec22 + } else { + r->_errno = ENOSYS; + } -+ ++ + return ret; +} diff --git a/libgloss/libsysbase/syscall_support.c b/libgloss/libsysbase/syscall_support.c new file mode 100644 -index 0000000..044f12d +index 000000000..044f12d16 --- /dev/null +++ b/libgloss/libsysbase/syscall_support.c @@ -0,0 +1,99 @@ @@ -6941,7 +6941,7 @@ index 0000000..044f12d + diff --git a/libgloss/libsysbase/times.c b/libgloss/libsysbase/times.c new file mode 100644 -index 0000000..67db6c7 +index 000000000..45e9781ca --- /dev/null +++ b/libgloss/libsysbase/times.c @@ -0,0 +1,21 @@ @@ -6958,7 +6958,7 @@ index 0000000..67db6c7 + struct tms *ptms) { +#else +clock_t _DEFUN (_times, (buf), -+ struct tms *buf) { ++ struct tms *buf) { + + struct _reent *r = _REENT; +#endif @@ -6968,7 +6968,7 @@ index 0000000..67db6c7 + diff --git a/libgloss/libsysbase/truncate.c b/libgloss/libsysbase/truncate.c new file mode 100644 -index 0000000..4ff1d27 +index 000000000..4ff1d27c8 --- /dev/null +++ b/libgloss/libsysbase/truncate.c @@ -0,0 +1,58 @@ @@ -7032,7 +7032,7 @@ index 0000000..4ff1d27 +} diff --git a/libgloss/libsysbase/unlink.c b/libgloss/libsysbase/unlink.c new file mode 100644 -index 0000000..9a61639 +index 000000000..9a61639af --- /dev/null +++ b/libgloss/libsysbase/unlink.c @@ -0,0 +1,37 @@ @@ -7075,7 +7075,7 @@ index 0000000..9a61639 + diff --git a/libgloss/libsysbase/wait.c b/libgloss/libsysbase/wait.c new file mode 100644 -index 0000000..322c847 +index 000000000..f64bf1326 --- /dev/null +++ b/libgloss/libsysbase/wait.c @@ -0,0 +1,29 @@ @@ -7088,29 +7088,29 @@ index 0000000..322c847 +#include <_syslist.h> +#include + -+//--------------------------------------------------------------------------------- ++//--------------------------------------------------------------------------------- +#ifdef REENTRANT_SYSCALLS_PROVIDED -+//--------------------------------------------------------------------------------- ++//--------------------------------------------------------------------------------- +int +_DEFUN (_wait_r, (r, status), + struct _reent *r _AND + int *status) { + +#else -+//--------------------------------------------------------------------------------- ++//--------------------------------------------------------------------------------- +int +_DEFUN (_wait, (status), + int *status) { + struct _reent *r = _REENT; +#endif -+//--------------------------------------------------------------------------------- ++//--------------------------------------------------------------------------------- + r->_errno = ENOSYS; + return -1; +} + diff --git a/libgloss/libsysbase/warning.h b/libgloss/libsysbase/warning.h new file mode 100644 -index 0000000..2c29982 +index 000000000..2c2998250 --- /dev/null +++ b/libgloss/libsysbase/warning.h @@ -0,0 +1,43 @@ @@ -7159,7 +7159,7 @@ index 0000000..2c29982 +#endif /* __WARNING_H__ */ diff --git a/libgloss/libsysbase/write.c b/libgloss/libsysbase/write.c new file mode 100644 -index 0000000..39aa78b +index 000000000..39aa78b5e --- /dev/null +++ b/libgloss/libsysbase/write.c @@ -0,0 +1,45 @@ @@ -7209,7 +7209,7 @@ index 0000000..39aa78b + return ret; +} diff --git a/newlib/configure.host b/newlib/configure.host -index d471200..cfcef9d 100644 +index d47120089..cfcef9d4c 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -627,6 +627,14 @@ case "${host}" in @@ -7228,7 +7228,7 @@ index d471200..cfcef9d 100644 syscall_dir=syscalls ;; diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h -index 097b0f6..062965e 100644 +index 097b0f665..062965e5f 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -227,7 +227,7 @@ int _EXFUN(fgetpos, (FILE *, _fpos_t *)); @@ -7250,7 +7250,7 @@ index 097b0f6..062965e 100644 long _EXFUN(_ftell_r, (struct _reent *, FILE *)); _off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h -index 555239f..0dc6949 100644 +index 555239f8b..0dc69499e 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -4,6 +4,9 @@ @@ -7264,7 +7264,7 @@ index 555239f..0dc6949 100644 #define MALLOC_ALIGNMENT 16 #endif diff --git a/newlib/libc/include/sys/dirent.h b/newlib/libc/include/sys/dirent.h -index a3fb5c0..1ead46b 100644 +index a3fb5c02c..1ead46ba0 100644 --- a/newlib/libc/include/sys/dirent.h +++ b/newlib/libc/include/sys/dirent.h @@ -1,13 +1,52 @@ @@ -7325,7 +7325,7 @@ index a3fb5c0..1ead46b 100644 +#endif // _dirent_h_ diff --git a/newlib/libc/include/sys/iosupport.h b/newlib/libc/include/sys/iosupport.h new file mode 100644 -index 0000000..10a6a71 +index 000000000..10a6a716d --- /dev/null +++ b/newlib/libc/include/sys/iosupport.h @@ -0,0 +1,105 @@ @@ -7435,7 +7435,7 @@ index 0000000..10a6a71 +#endif // __iosupp_h__ +//--------------------------------------------------------------------------------- diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h -index e1ed8b4..9d8be35 100644 +index e1ed8b421..9d8be350d 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -416,6 +416,8 @@ struct _reent @@ -7457,7 +7457,7 @@ index e1ed8b4..9d8be35 100644 #define _REENT_INIT(var) \ diff --git a/newlib/libc/include/sys/statvfs.h b/newlib/libc/include/sys/statvfs.h new file mode 100644 -index 0000000..380329d +index 000000000..380329d34 --- /dev/null +++ b/newlib/libc/include/sys/statvfs.h @@ -0,0 +1,35 @@ @@ -7498,7 +7498,7 @@ index 0000000..380329d +#endif // _SYS_STATVFS_H \ No newline at end of file diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h -index 84219ca..af9d12c 100644 +index 84219ca2e..af9d12c9e 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -252,12 +252,10 @@ _READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nb @@ -7515,7 +7515,7 @@ index 84219ca..af9d12c 100644 #if defined(__CYGWIN__) || defined(__rtems__) int _EXFUN(getdtablesize, (void)); diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c -index 8572821..52b6469 100644 +index 857282105..e6baf3507 100644 --- a/newlib/libc/locale/locale.c +++ b/newlib/libc/locale/locale.c @@ -107,7 +107,7 @@ beginning with <<"LC_">>. @@ -7552,14 +7552,44 @@ index 8572821..52b6469 100644 #ifndef DEFAULT_LOCALE -#define DEFAULT_LOCALE "C" +#ifdef __DEFAULT_UTF8__ -+#define DEFAULT_LOCALE "C" -+#else +#define DEFAULT_LOCALE "C.UTF-8" ++#else ++#define DEFAULT_LOCALE "C" +#endif #endif #ifdef _MB_CAPABLE -@@ -255,10 +262,11 @@ const struct __locale_t __C_locale = +@@ -222,8 +229,13 @@ char __default_locale[ENCODING_LEN + 1] = DEFAULT_LOCALE; + const struct __locale_t __C_locale = + { + { "C", "C", "C", "C", "C", "C", "C", }, ++#if defined ( __DEFAULT_UTF8__ ) ++ __utf8_wctomb, ++ __utf8_mbtowc, ++#else + __ascii_wctomb, + __ascii_mbtowc, ++#endif + 0, + DEFAULT_CTYPE_PTR, + { +@@ -234,9 +246,15 @@ const struct __locale_t __C_locale = + CHAR_MAX, CHAR_MAX + }, + #ifndef __HAVE_LOCALE_INFO__ ++#ifdef __DEFAULT_UTF8__ ++ "\6", ++ "UTF-8", ++ "UTF-8", ++#else + "\1", + "ASCII", + "ASCII", ++#endif + #else /* __HAVE_LOCALE_INFO__ */ + { + { NULL, NULL }, /* LC_ALL */ +@@ -255,10 +273,11 @@ const struct __locale_t __C_locale = }; #endif /* _MB_CAPABLE */ @@ -7572,7 +7602,23 @@ index 8572821..52b6469 100644 __utf8_wctomb, __utf8_mbtowc, #else -@@ -312,7 +320,7 @@ _DEFUN(_setlocale_r, (p, category, locale), +@@ -275,9 +294,15 @@ struct __locale_t __global_locale = + CHAR_MAX, CHAR_MAX + }, + #ifndef __HAVE_LOCALE_INFO__ ++#ifdef __DEFAULT_UTF8__ ++ "\6", ++ "UTF-8", ++ "UTF-8", ++#else + "\1", + "ASCII", + "ASCII", ++#endif + #else /* __HAVE_LOCALE_INFO__ */ + { + { NULL, NULL }, /* LC_ALL */ +@@ -312,7 +337,7 @@ _DEFUN(_setlocale_r, (p, category, locale), { #ifndef _MB_CAPABLE if (locale) @@ -7581,7 +7627,7 @@ index 8572821..52b6469 100644 if (strcmp (locale, "POSIX") && strcmp (locale, "C") && strcmp (locale, "")) return NULL; -@@ -995,6 +1003,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale) +@@ -995,6 +1020,7 @@ __locale_ctype_ptr_l (struct __locale_t *locale) const char * __locale_ctype_ptr (void) @@ -7589,9 +7635,83 @@ index 8572821..52b6469 100644 { return __get_current_locale ()->ctype_ptr; } +diff --git a/newlib/libc/machine/arm/Makefile.am b/newlib/libc/machine/arm/Makefile.am +index 62ed158f3..7f34177d0 100644 +--- a/newlib/libc/machine/arm/Makefile.am ++++ b/newlib/libc/machine/arm/Makefile.am +@@ -11,7 +11,9 @@ noinst_LIBRARIES = lib.a + lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c \ + aeabi_memcpy.c aeabi_memcpy-armv7a.S \ + aeabi_memmove.c aeabi_memmove-soft.S \ +- aeabi_memset.c aeabi_memset-soft.S aeabi_memclr.c ++ aeabi_memset.c aeabi_memset-soft.S aeabi_memclr.c \ ++ sync_synchronize.c ++ + lib_a_SOURCES += memchr-stub.c + lib_a_SOURCES += memchr.S + lib_a_SOURCES += memcpy-stub.c +diff --git a/newlib/libc/machine/arm/Makefile.in b/newlib/libc/machine/arm/Makefile.in +index 49082088f..694cbb092 100644 +--- a/newlib/libc/machine/arm/Makefile.in ++++ b/newlib/libc/machine/arm/Makefile.in +@@ -76,10 +76,10 @@ am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-access.$(OBJEXT) \ + lib_a-aeabi_memmove.$(OBJEXT) \ + lib_a-aeabi_memmove-soft.$(OBJEXT) \ + lib_a-aeabi_memset.$(OBJEXT) lib_a-aeabi_memset-soft.$(OBJEXT) \ +- lib_a-aeabi_memclr.$(OBJEXT) lib_a-memchr-stub.$(OBJEXT) \ +- lib_a-memchr.$(OBJEXT) lib_a-memcpy-stub.$(OBJEXT) \ +- lib_a-memcpy.$(OBJEXT) lib_a-strlen-stub.$(OBJEXT) \ +- lib_a-strlen.$(OBJEXT) ++ lib_a-aeabi_memclr.$(OBJEXT) lib_a-sync_synchronize.$(OBJEXT) \ ++ lib_a-memchr-stub.$(OBJEXT) lib_a-memchr.$(OBJEXT) \ ++ lib_a-memcpy-stub.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \ ++ lib_a-strlen-stub.$(OBJEXT) lib_a-strlen.$(OBJEXT) + lib_a_OBJECTS = $(am_lib_a_OBJECTS) + DEFAULT_INCLUDES = -I.@am__isrc@ + depcomp = +@@ -209,8 +209,8 @@ noinst_LIBRARIES = lib.a + lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c aeabi_memcpy.c \ + aeabi_memcpy-armv7a.S aeabi_memmove.c aeabi_memmove-soft.S \ + aeabi_memset.c aeabi_memset-soft.S aeabi_memclr.c \ +- memchr-stub.c memchr.S memcpy-stub.c memcpy.S strlen-stub.c \ +- strlen.S ++ sync_synchronize.c memchr-stub.c memchr.S memcpy-stub.c \ ++ memcpy.S strlen-stub.c strlen.S + lib_a_CCASFLAGS = $(AM_CCASFLAGS) + lib_a_CFLAGS = $(AM_CFLAGS) + ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. +@@ -374,6 +374,12 @@ lib_a-aeabi_memclr.o: aeabi_memclr.c + lib_a-aeabi_memclr.obj: aeabi_memclr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-aeabi_memclr.obj `if test -f 'aeabi_memclr.c'; then $(CYGPATH_W) 'aeabi_memclr.c'; else $(CYGPATH_W) '$(srcdir)/aeabi_memclr.c'; fi` + ++lib_a-sync_synchronize.o: sync_synchronize.c ++ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sync_synchronize.o `test -f 'sync_synchronize.c' || echo '$(srcdir)/'`sync_synchronize.c ++ ++lib_a-sync_synchronize.obj: sync_synchronize.c ++ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sync_synchronize.obj `if test -f 'sync_synchronize.c'; then $(CYGPATH_W) 'sync_synchronize.c'; else $(CYGPATH_W) '$(srcdir)/sync_synchronize.c'; fi` ++ + lib_a-memchr-stub.o: memchr-stub.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memchr-stub.o `test -f 'memchr-stub.c' || echo '$(srcdir)/'`memchr-stub.c + +diff --git a/newlib/libc/machine/arm/sync_synchronize.c b/newlib/libc/machine/arm/sync_synchronize.c +new file mode 100644 +index 000000000..3acc9e094 +--- /dev/null ++++ b/newlib/libc/machine/arm/sync_synchronize.c +@@ -0,0 +1,10 @@ ++#if __ARM_ARCH < 6 ++#include ++void __attribute__((weak)) ++__sync_synchronize (void) ++{ ++ __warn_references (__sync_synchronize, ++ "legacy compatible __sync_synchronize used. Not suitable for multi-threaded applications"); ++ return; ++} ++#endif diff --git a/newlib/libc/machine/arm/sys/stdio.h b/newlib/libc/machine/arm/sys/stdio.h new file mode 100644 -index 0000000..4eb278e +index 000000000..4eb278e2f --- /dev/null +++ b/newlib/libc/machine/arm/sys/stdio.h @@ -0,0 +1,27 @@ @@ -7623,7 +7743,7 @@ index 0000000..4eb278e + +#endif /* _NEWLIB_STDIO_H */ diff --git a/newlib/libc/reent/getreent.c b/newlib/libc/reent/getreent.c -index 60ae6fb..781f2c3 100644 +index 60ae6fbb7..781f2c353 100644 --- a/newlib/libc/reent/getreent.c +++ b/newlib/libc/reent/getreent.c @@ -1,3 +1,4 @@ @@ -7638,7 +7758,7 @@ index 60ae6fb..781f2c3 100644 + +#endif diff --git a/newlib/libc/reent/gettimeofdayr.c b/newlib/libc/reent/gettimeofdayr.c -index f5a49f7..9551e5c 100644 +index f5a49f73c..9551e5cd5 100644 --- a/newlib/libc/reent/gettimeofdayr.c +++ b/newlib/libc/reent/gettimeofdayr.c @@ -59,7 +59,7 @@ DESCRIPTION @@ -7658,7 +7778,7 @@ index f5a49f7..9551e5c 100644 +*/ #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c -index c683947..e7d2cee 100644 +index c6839476d..e7d2cee77 100644 --- a/newlib/libc/stdio/fread.c +++ b/newlib/libc/stdio/fread.c @@ -168,7 +168,7 @@ _DEFUN(crlf_r, (ptr, fp, buf, count, eof), @@ -7705,7 +7825,7 @@ index c683947..e7d2cee 100644 /* no more input: return partial result */ #ifdef __SCLE diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c -index b8fc36a..5c31316 100644 +index b8fc36a04..5c3131698 100644 --- a/newlib/libc/stdio/fseek.c +++ b/newlib/libc/stdio/fseek.c @@ -108,7 +108,7 @@ int @@ -7726,8 +7846,62 @@ index b8fc36a..5c31316 100644 int whence) { return _fseek_r (_REENT, fp, offset, whence); +diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c +index ed92bb2f9..cd1f8d283 100644 +--- a/newlib/libc/stdio/vfprintf.c ++++ b/newlib/libc/stdio/vfprintf.c +@@ -112,6 +112,8 @@ Supporting OS subroutines required: <>, <>, <>, + <>, <>, <>, <>. + */ + ++#pragma GCC optimize ("Os") ++ + #if defined(LIBC_SCCS) && !defined(lint) + /*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/ + static char *rcsid = "$Id$"; +diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c +index 544d8db7f..7ca4b5af9 100644 +--- a/newlib/libc/stdio/vfscanf.c ++++ b/newlib/libc/stdio/vfscanf.c +@@ -108,6 +108,8 @@ These are GNU extensions. + Supporting OS subroutines required: + */ + ++#pragma GCC optimize ("Os") ++ + #include <_ansi.h> + #include + #include +diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c +index f0179a014..09fae4691 100644 +--- a/newlib/libc/stdio/vfwprintf.c ++++ b/newlib/libc/stdio/vfwprintf.c +@@ -92,6 +92,9 @@ SEEALSO + * + * This code is large and complicated... + */ ++ ++#pragma GCC optimize ("Os") ++ + #include + + #ifdef INTEGER_ONLY +diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c +index 5b35601be..e3211c001 100644 +--- a/newlib/libc/stdio/vfwscanf.c ++++ b/newlib/libc/stdio/vfwscanf.c +@@ -108,6 +108,9 @@ PORTABILITY + C99, POSIX-1.2008 + */ + ++ ++#pragma GCC optimize ("Os") ++ + #include <_ansi.h> + #include + #include diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c -index 116b4d8..57941e3 100644 +index 116b4d82f..57941e3b0 100644 --- a/newlib/libc/stdlib/mbtowc_r.c +++ b/newlib/libc/stdlib/mbtowc_r.c @@ -7,6 +7,7 @@ @@ -7740,7 +7914,7 @@ index 116b4d8..57941e3 100644 struct _reent *r _AND diff --git a/newlib/libc/sys/arm/include/machine/_types.h b/newlib/libc/sys/arm/include/machine/_types.h new file mode 100644 -index 0000000..40092f9 +index 000000000..40092f99f --- /dev/null +++ b/newlib/libc/sys/arm/include/machine/_types.h @@ -0,0 +1,19 @@ @@ -7765,7 +7939,7 @@ index 0000000..40092f9 + diff --git a/newlib/libc/sys/arm/sys/lock.h b/newlib/libc/sys/arm/sys/lock.h new file mode 100644 -index 0000000..567fed5 +index 000000000..567fed56b --- /dev/null +++ b/newlib/libc/sys/arm/sys/lock.h @@ -0,0 +1,66 @@ @@ -7836,7 +8010,7 @@ index 0000000..567fed5 + +#endif // __SYS_LOCK_H__ diff --git a/newlib/libc/sys/arm/sys/param.h b/newlib/libc/sys/arm/sys/param.h -index 5b9464c..e8969b9 100644 +index 5b9464cca..e8969b954 100644 --- a/newlib/libc/sys/arm/sys/param.h +++ b/newlib/libc/sys/arm/sys/param.h @@ -19,6 +19,8 @@