Skip to content

Commit

Permalink
newlib: update and fix malloc region issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ourairquality committed Mar 17, 2018
1 parent 145fef1 commit 3ac5c87
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libc/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Newlib from git://sourceware.org/git/newlib-cygwin.git with xtensa & locking patches see https://github.com/ourairquality/newlib and built from commit 8eaccaa1e840de60501a1e5b79045cd7c1683789
Newlib from git://sourceware.org/git/newlib-cygwin.git with xtensa & locking patches see https://github.com/ourairquality/newlib and built from commit caca074d485916de2f85d6cb585d773f0413fba7

The build commands were:

Expand Down
4 changes: 2 additions & 2 deletions libc/xtensa-lx106-elf/include/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int pthread_attr_getschedparam (const pthread_attr_t *__attr,
int pthread_getschedparam (pthread_t __pthread, int *__policy,
struct sched_param *__param);
int pthread_setschedparam (pthread_t __pthread, int __policy,
struct sched_param *__param);
const struct sched_param *__param);

/* Set Scheduling Priority of a Thread */
int pthread_setschedprio (pthread_t thread, int prio);
Expand Down Expand Up @@ -190,7 +190,7 @@ int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *__attr,

int pthread_mutex_setprioceiling (pthread_mutex_t *__mutex,
int __prioceiling, int *__old_ceiling);
int pthread_mutex_getprioceiling (pthread_mutex_t *__mutex,
int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex,
int *__prioceiling);

#endif /* _POSIX_THREAD_PRIO_PROTECT */
Expand Down
7 changes: 3 additions & 4 deletions libc/xtensa-lx106-elf/include/stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t _compar);
int rand (void);
void * realloc (void *__r, size_t __size) _NOTHROW;
#if __BSD_VISIBLE
void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2)
__alloc_size(3);
void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size((2,3));
void * reallocf (void *__r, size_t __size);
#endif
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
Expand Down Expand Up @@ -329,8 +328,8 @@ extern long double strtold (const char *__restrict, char **__restrict);
* If we're in a mode greater than C99, expose C11 functions.
*/
#if __ISO_C_VISIBLE >= 2011
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
__alloc_size(2);
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align((1))
__alloc_size((2));
int at_quick_exit(void (*)(void));
_Noreturn void
quick_exit(int);
Expand Down
3 changes: 3 additions & 0 deletions libc/xtensa-lx106-elf/include/sys/_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ typedef _CLOCK_T_ __clock_t;
#endif
typedef _TIME_T_ __time_t;

#ifndef __machine_clockid_t_defined
#define _CLOCKID_T_ unsigned long
#endif

typedef _CLOCKID_T_ __clockid_t;

#define _TIMER_T_ unsigned long
Expand Down
4 changes: 2 additions & 2 deletions libc/xtensa-lx106-elf/include/sys/cdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@
#define __section(x) __attribute__((__section__(x)))
#endif
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
#define __alloc_size(x) __attribute__((__alloc_size__(x)))
#define __alloc_size(x) __attribute__((__alloc_size__ x))
#else
#define __alloc_size(x)
#endif
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
#define __alloc_align(x) __attribute__((__alloc_align__ x))
#else
#define __alloc_align(x)
#endif
Expand Down
8 changes: 4 additions & 4 deletions libc/xtensa-lx106-elf/include/sys/reent.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ extern void __sinit (struct _reent *);
__sinit (ptr); \
} \
while (0)
#else
#else /* _REENT_SMALL && !_REENT_GLOBAL_STDIO_STREAMS */
# define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */
#endif
#endif /* _REENT_SMALL && !_REENT_GLOBAL_STDIO_STREAMS */

struct __sFILE {
unsigned char *_p; /* current position in (some) buffer */
Expand Down Expand Up @@ -455,7 +455,7 @@ extern __FILE __sf[3];
(var)->_stderr = &__sf[2]; \
}

#else
#else /* _REENT_GLOBAL_STDIO_STREAMS */

extern const struct __sFILE_fake __sf_fake_stdin;
extern const struct __sFILE_fake __sf_fake_stdout;
Expand Down Expand Up @@ -494,7 +494,7 @@ extern const struct __sFILE_fake __sf_fake_stderr;
(var)->_stderr = (__FILE *)&__sf_fake_stderr; \
}

#endif
#endif /* _REENT_GLOBAL_STDIO_STREAMS */

/* Only add assert() calls if we are specified to debug. */
#ifdef _REENT_CHECK_DEBUG
Expand Down
Binary file modified libc/xtensa-lx106-elf/lib/libc.a
Binary file not shown.
Binary file modified libc/xtensa-lx106-elf/lib/libg.a
Binary file not shown.
Binary file modified libc/xtensa-lx106-elf/lib/libm.a
Binary file not shown.

0 comments on commit 3ac5c87

Please sign in to comment.