Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #19484 #19565
Browse files Browse the repository at this point in the history
19484: makefiles/arch/msp430.inc.mk: Fix compilation issues with GCC 12 r=maribu a=maribu

### Contribution description

This fixes the following compilation issues:

    /home/maribu/Repos/software/RIOT/cpu/msp430fxyz/periph/gpio.c: In function 'gpio_periph_mode':
    /home/maribu/Repos/software/RIOT/cpu/msp430fxyz/periph/gpio.c:95:15: error: array subscript 0 is outside array bounds of 'msp_port_isr_t[0]' [-Werror=array-bounds]
       95 |         sel = &(isrport->SEL);
          |               ^~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

by adding `CFLAGS += --param-min-pagesize=0` for GCC 12 (same issue as already fixed for AVR).

and:

    /usr/lib/gcc/msp430-elf/12.2.0/../../../../msp430-elf/bin/ld: warning: /home/maribu/Repos/software/RIOT/cpu/msp430_common/ldscripts/xfa.ld contains output sections; did you forget -T?

by adding the missing `-T`.

### Testing procedure

The following should still work:

- `make BOARD=msb-430 -C examples/hello-world`
- `make BOARD=msb-430 -C tests/xfa flash test`

### Issues/PRs references

None

19565: tests: move core related applications to their own tests/core/ folder r=aabadie a=aabadie



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
3 people authored May 10, 2023
3 parents c7f750a + b86366e + cabe02c commit 754d4a3
Showing 168 changed files with 92 additions and 67 deletions.
3 changes: 3 additions & 0 deletions cpu/msp430_common/ldscripts/riot-msp430f1611.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE msp430f1611.ld
INCLUDE msp430_common.ld
INCLUDE xfa.ld
3 changes: 3 additions & 0 deletions cpu/msp430_common/ldscripts/riot-msp430f1612.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE msp430f1612.ld
INCLUDE msp430_common.ld
INCLUDE xfa.ld
3 changes: 3 additions & 0 deletions cpu/msp430_common/ldscripts/riot-msp430f1617.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE msp430f1617.ld
INCLUDE msp430_common.ld
INCLUDE xfa.ld
3 changes: 3 additions & 0 deletions cpu/msp430_common/ldscripts/riot-msp430f2617.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE msp430f2617.ld
INCLUDE msp430_common.ld
INCLUDE xfa.ld
1 change: 1 addition & 0 deletions makefiles/app_dirs.inc.mk
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ APPLICATION_DIRS := \
examples \
tests \
tests/bench \
tests/core \
tests/drivers \
tests/periph \
tests/pkg \
7 changes: 0 additions & 7 deletions makefiles/arch/avr8.inc.mk
Original file line number Diff line number Diff line change
@@ -41,10 +41,3 @@ endif
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation
OPTIONAL_CFLAGS_BLACKLIST += -gz

ifeq ($(TOOLCHAIN),gnu)
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
ifneq ($(findstring 12.,$(shell $(TARGET_ARCH)-gcc --version 2>/dev/null)),)
CFLAGS += --param=min-pagesize=0
endif
endif
18 changes: 14 additions & 4 deletions makefiles/arch/msp430.inc.mk
Original file line number Diff line number Diff line change
@@ -13,11 +13,21 @@ CFLAGS_OPT ?= -Os
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
ASFLAGS += $(CFLAGS_CPU) --defsym $(CPU_MODEL)=1 $(CFLAGS_DBG)

BINUTILS_VERSION := $(shell $(PREFIX)ld --version | grep -Eo '[0-9]\.[0-9]+')
NEEDS_NEW_LINKER_SCRIPT := $(call version_is_greater_or_equal,$(BINUTILS_VERSION),2.40)

LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT)
LINKFLAGS += -Wl,--gc-sections -Wl,-L$(MSP430_SUPPORT_FILES)/include
LINKFLAGS += -T $(MSP430_SUPPORT_FILES)/include/$(CPU_MODEL).ld
LINKFLAGS += -T $(RIOTCPU)/msp430_common/ldscripts/msp430_common.ld
LINKFLAGS += $(RIOTCPU)/msp430_common/ldscripts/xfa.ld
LINKFLAGS += -Wl,--gc-sections
LINKFLAGS += -Wl,-L$(MSP430_SUPPORT_FILES)/include
LINKFLAGS += -Wl,-L$(RIOTCPU)/msp430_common/ldscripts

ifeq (1,$(NEEDS_NEW_LINKER_SCRIPT))
LINKFLAGS += -T riot-$(CPU_MODEL).ld
else
LINKFLAGS += -T $(MSP430_SUPPORT_FILES)/include/$(CPU_MODEL).ld
LINKFLAGS += -T $(RIOTCPU)/msp430_common/ldscripts/msp430_common.ld
LINKFLAGS += $(RIOTCPU)/msp430_common/ldscripts/xfa.ld
endif

OPTIONAL_CFLAGS_BLACKLIST += -fdiagnostics-color
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow
7 changes: 7 additions & 0 deletions makefiles/toolchain/gnu.inc.mk
Original file line number Diff line number Diff line change
@@ -32,3 +32,10 @@ endif

# We use GDB for debugging
include $(RIOTMAKE)/tools/gdb.inc.mk

# Data address spaces starts at zero for all supported architectures. This fixes
# compilation at least on MSP430 and AVR.
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
ifeq ($(GCC_VERSION),12)
CFLAGS += --param=min-pagesize=0
endif
2 changes: 2 additions & 0 deletions tests/core/Makefile.core_common
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RIOTBASE ?= $(CURDIR)/../../..
include $(CURDIR)/../../Makefile.tests_common
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += xtimer

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += test_utils_interactive_sync

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

FEATURES_BLACKLIST += arch_avr8 arch_msp430 arch_riscv

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += xtimer

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/irq_cpp/Makefile → tests/core/irq_cpp/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common
FEATURES_REQUIRED += cpp
FEATURES_REQUIRED += libstdcpp
USEPKG += fff
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += fmt
USEMODULE += xtimer
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += xtimer

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../Makefile.tests_common
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += embunit

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../Makefile.tests_common
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../Makefile.tests_common
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../Makefile.tests_common
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/irq/Makefile → tests/core/mutex_cancel/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += xtimer

File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/mutex_order/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

# stm32f030f4-demo doesn't have enough RAM to run the test
# so we reduce the stack size for every thread
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/rmutex/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

FEATURES_REQUIRED += cpp

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += nice
USEMODULE += ps
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/sched_testing/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/thread_basic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

ifneq (,$(filter nucleo-f042k6,$(BOARD)))
PROBLEM ?= 3
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/thread_exit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += core_thread_flags
USEMODULE += xtimer
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += core_thread_flags
USEMODULE += xtimer
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += printf_float
USEMODULE += ztimer_usec
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/thread_flood/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/thread_msg/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DEVELHELP := 1

include ../Makefile.tests_common
include ../Makefile.core_common

DISABLE_MODULE += auto_init_xtimer
DISABLE_MODULE += auto_init_random
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/thread_msg_block_w_queue/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/thread_msg_block_wo_queue/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += core_msg_bus

File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/core/thread_msg_seq/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include ../Makefile.core_common

include $(RIOTBASE)/Makefile.include
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += fmt
USEMODULE += core_mutex_priority_inheritance
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

# stm32f030f4-demo doesn't have enough RAM to run the test
# so we reduce the stack size for every thread
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

USEMODULE += printf_float

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../Makefile.tests_common
include ../Makefile.core_common

# For better testing use ps
#USEMODULE += ps
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions tests/mutex_order/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/rmutex/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/sched_testing/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/thread_basic/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/thread_exit/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/thread_flood/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/thread_msg/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/thread_msg_block_w_queue/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/thread_msg_block_wo_queue/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions tests/thread_msg_seq/Makefile

This file was deleted.

0 comments on commit 754d4a3

Please sign in to comment.