Skip to content

Commit afe40c9

Browse files
committed
or1k: Fix compilation for __OR1K_MULTICORE__ builds
When building newlib for multicore environments we specify __OR1K_MULTICORE__ which switches the build to allocate one struct _or1k_reent per CPU dynamiocally. This was using a strange definition of (*_or1k_reent)[], and causing the following compiler error: ./gnu-toolchain/newlib/libgloss/or1k/impure.c: In function ‘_or1k_reent_init’: ./gnu-toolchain/newlib/libgloss/or1k/impure.c:121:21: error: assignment to ‘struct .. 121 | _or1k_reent = (struct _or1k_reent*) _sbrk_r(0, memsize); | Fix this compiler error by changing the or1k_reent definition to a pointer to structs. Signed-off-by: Stafford Horne <[email protected]>
1 parent 5e5e51f commit afe40c9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libgloss/or1k/impure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ _or1k_libc_getreent(void) {
108108
}
109109

110110
#ifdef __OR1K_MULTICORE__
111-
struct _or1k_reent (*_or1k_reent)[];
111+
struct _or1k_reent *_or1k_reent;
112112
#else
113113
struct _or1k_reent _or1k_reent;
114114
#endif

libgloss/or1k/or1k-internals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ struct _or1k_reent {
5555

5656

5757
#ifdef __OR1K_MULTICORE__
58-
extern struct _or1k_reent (*_or1k_reent)[];
59-
#define OR1K_REENT (*_or1k_reent)[or1k_coreid()]
58+
extern struct _or1k_reent *_or1k_reent;
59+
#define OR1K_REENT _or1k_reent[or1k_coreid()]
6060
#else
6161
extern struct _or1k_reent _or1k_reent;
6262
#define OR1K_REENT _or1k_reent

0 commit comments

Comments
 (0)