Skip to content

Commit

Permalink
makefiles: fix -nostartfiles and up to C++20
Browse files Browse the repository at this point in the history
Presence of __dso_handle signal has been solved in RIOT by PR 20348.
Thus removal of -nostartfiles option is no more necessary.
Also bump C++ version to C++20.

[1] RIOT-OS/RIOT#20348
  • Loading branch information
gdoffe committed Mar 30, 2024
1 parent fac0529 commit e332a01
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ MCUFW_MODULE_DIRS = " \
shell_module_dirs = $(wildcard $(MCUFW_MODULE_DIRS:%=$(MCUFIRMWAREBASE)/%/*/shell_*/.))
EXTERNAL_MODULE_DIRS += $(MCUFW_MODULE_DIRS:%=$(MCUFIRMWAREBASE)/%/) $(shell_module_dirs:%=%/..)

# Use C++20 by default
tmp_cxxexflags := $(CXXEXFLAGS)
CXXEXFLAGS = $(filter-out -std=%, $(tmp_cxxexflags))
CXXEXFLAGS += -std=c++20
CXXEXFLAGS += -Wno-pedantic
CXXEXFLAGS += -Wno-cast-align
CXXEXFLAGS += -fno-use-cxa-atexit

# Export mcu-firmware global variables
include $(MCUFIRMWAREBASE)/makefiles/global_vars.mk.inc

Expand Down Expand Up @@ -88,18 +96,9 @@ else
CFLAGS += -D"MALLINFO_FUNC()=mallinfo()"
endif

# Use C++14 by default
tmp_cxxexflags := $(CXXEXFLAGS)
CXXEXFLAGS = $(filter-out -std=%, $(tmp_cxxexflags))
CXXEXFLAGS += -std=c++17
CXXEXFLAGS += -Wno-pedantic
CXXEXFLAGS += -Wno-cast-align

# Activate asserts debug
CFLAGS += -DDEBUG_ASSERT_VERBOSE

LINKFLAGS:=$(filter-out -nostartfiles,$(LINKFLAGS))

# Link to librt for timer_* functions definitions
ifeq ($(CPU),native)
LINKFLAGS += -lrt
Expand Down

0 comments on commit e332a01

Please sign in to comment.