Skip to content

Commit 3ac5c87

Browse files
committed
newlib: update and fix malloc region issue
1 parent 145fef1 commit 3ac5c87

File tree

9 files changed

+15
-13
lines changed

9 files changed

+15
-13
lines changed

libc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Newlib from git://sourceware.org/git/newlib-cygwin.git with xtensa & locking patches see https://github.com/ourairquality/newlib and built from commit 8eaccaa1e840de60501a1e5b79045cd7c1683789
1+
Newlib from git://sourceware.org/git/newlib-cygwin.git with xtensa & locking patches see https://github.com/ourairquality/newlib and built from commit caca074d485916de2f85d6cb585d773f0413fba7
22

33
The build commands were:
44

libc/xtensa-lx106-elf/include/pthread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ int pthread_attr_getschedparam (const pthread_attr_t *__attr,
156156
int pthread_getschedparam (pthread_t __pthread, int *__policy,
157157
struct sched_param *__param);
158158
int pthread_setschedparam (pthread_t __pthread, int __policy,
159-
struct sched_param *__param);
159+
const struct sched_param *__param);
160160

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

191191
int pthread_mutex_setprioceiling (pthread_mutex_t *__mutex,
192192
int __prioceiling, int *__old_ceiling);
193-
int pthread_mutex_getprioceiling (pthread_mutex_t *__mutex,
193+
int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex,
194194
int *__prioceiling);
195195

196196
#endif /* _POSIX_THREAD_PRIO_PROTECT */

libc/xtensa-lx106-elf/include/stdlib.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t _compar);
144144
int rand (void);
145145
void * realloc (void *__r, size_t __size) _NOTHROW;
146146
#if __BSD_VISIBLE
147-
void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2)
148-
__alloc_size(3);
147+
void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size((2,3));
149148
void * reallocf (void *__r, size_t __size);
150149
#endif
151150
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
@@ -329,8 +328,8 @@ extern long double strtold (const char *__restrict, char **__restrict);
329328
* If we're in a mode greater than C99, expose C11 functions.
330329
*/
331330
#if __ISO_C_VISIBLE >= 2011
332-
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
333-
__alloc_size(2);
331+
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align((1))
332+
__alloc_size((2));
334333
int at_quick_exit(void (*)(void));
335334
_Noreturn void
336335
quick_exit(int);

libc/xtensa-lx106-elf/include/sys/_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ typedef _CLOCK_T_ __clock_t;
193193
#endif
194194
typedef _TIME_T_ __time_t;
195195

196+
#ifndef __machine_clockid_t_defined
196197
#define _CLOCKID_T_ unsigned long
198+
#endif
199+
197200
typedef _CLOCKID_T_ __clockid_t;
198201

199202
#define _TIMER_T_ unsigned long

libc/xtensa-lx106-elf/include/sys/cdefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@
258258
#define __section(x) __attribute__((__section__(x)))
259259
#endif
260260
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
261-
#define __alloc_size(x) __attribute__((__alloc_size__(x)))
261+
#define __alloc_size(x) __attribute__((__alloc_size__ x))
262262
#else
263263
#define __alloc_size(x)
264264
#endif
265265
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
266-
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
266+
#define __alloc_align(x) __attribute__((__alloc_align__ x))
267267
#else
268268
#define __alloc_align(x)
269269
#endif

libc/xtensa-lx106-elf/include/sys/reent.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ extern void __sinit (struct _reent *);
174174
__sinit (ptr); \
175175
} \
176176
while (0)
177-
#else
177+
#else /* _REENT_SMALL && !_REENT_GLOBAL_STDIO_STREAMS */
178178
# define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */
179-
#endif
179+
#endif /* _REENT_SMALL && !_REENT_GLOBAL_STDIO_STREAMS */
180180

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

458-
#else
458+
#else /* _REENT_GLOBAL_STDIO_STREAMS */
459459

460460
extern const struct __sFILE_fake __sf_fake_stdin;
461461
extern const struct __sFILE_fake __sf_fake_stdout;
@@ -494,7 +494,7 @@ extern const struct __sFILE_fake __sf_fake_stderr;
494494
(var)->_stderr = (__FILE *)&__sf_fake_stderr; \
495495
}
496496

497-
#endif
497+
#endif /* _REENT_GLOBAL_STDIO_STREAMS */
498498

499499
/* Only add assert() calls if we are specified to debug. */
500500
#ifdef _REENT_CHECK_DEBUG

libc/xtensa-lx106-elf/lib/libc.a

88.2 KB
Binary file not shown.

libc/xtensa-lx106-elf/lib/libg.a

88.2 KB
Binary file not shown.

libc/xtensa-lx106-elf/lib/libm.a

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)