Skip to content

Commit ccea35d

Browse files
author
Hubert Badocha
committed
misc: adapt to gcc 14.2
JIRA: RTOS-927
1 parent 9f0a5e5 commit ccea35d

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

_startc.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,31 @@ void _startc(int argc, char **argv, char **env)
3333
size_t i, size;
3434

3535
/* Load .fastram.text, .data and .rodata sections */
36-
if (__ramtext_start != __ramtext_load) {
36+
if (&__ramtext_start[0] != &__ramtext_load[0]) {
3737
/* hal_memcpy may reside in fastram. */
38-
for (i = 0; i <= __ramtext_end - __ramtext_start; i++) {
38+
for (i = 0; i <= (__ramtext_end - __ramtext_start); i++) {
3939
__ramtext_start[i] = __ramtext_load[i];
4040
}
4141
}
4242

43-
if (__data_start != __data_load)
43+
if (&__data_start[0] != &__data_load[0]) {
4444
hal_memcpy(__data_start, __data_load, __data_end - __data_start);
45-
46-
if (__rodata_start != __rodata_load)
45+
}
46+
if (&__rodata_start[0] != &__rodata_load[0]) {
4747
hal_memcpy(__rodata_start, __rodata_load, __rodata_end - __rodata_start);
48-
48+
}
4949
/* Clear the .bss section */
5050
hal_memset(__bss_start, 0, __bss_end - __bss_start);
5151

5252
size = __init_array_end - __init_array_start;
53-
for (i = 0; i < size; i++)
53+
for (i = 0; i < size; i++) {
5454
(*__init_array_start[i])();
55+
}
5556

5657
main();
5758

5859
size = __fini_array_end - __fini_array_start;
59-
for (i = size; i > 0; i--)
60+
for (i = size; i > 0; i--) {
6061
(*__fini_array_start[i - 1])();
62+
}
6163
}

hal/ia32/acpi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ static rsdp_t *_hal_acpiLookForRsdp(hal_syspage_t *hs, void *start, void *end)
135135
static rsdp_t *_hal_acpiFindRsdp(hal_syspage_t *hs)
136136
{
137137
/* Search EBDA */
138+
139+
/* FIXME: pragmas are needed as a result of a bug in GCC -Warray-bounds */
140+
#pragma GCC diagnostic push
141+
#pragma GCC diagnostic ignored "-Warray-bounds"
138142
unsigned int ebda = ((*(u16 *)0x40eu) << 4) & ~(SIZE_PAGE - 1);
143+
#pragma GCC diagnostic pop
144+
139145
rsdp_t *result;
140146
if ((ebda < 0x00080000u) || (ebda > 0x0009ffffu)) {
141147
ebda = 0x00080000u;

riscv-sbi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif
2525

2626
LDGEN ?= $(CC)
2727

28-
CFLAGS += -I. -Iinclude
28+
CFLAGS += -I. -Iinclude -ffreestanding
2929
CPPFLAGS += -DPAYLOAD_PATH=\"$(PAYLOAD_PATH)\"
3030

3131
ifneq ($(FDT_PATH),)

0 commit comments

Comments
 (0)