Skip to content

Commit

Permalink
Enable -ffreestanding by default
Browse files Browse the repository at this point in the history
Fixes #5429
  • Loading branch information
nfeske committed Jan 21, 2025
1 parent b4f4a6d commit b455139
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions repos/base-linux/lib/import/import-syscall-linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ HOST_INC_DIR += /usr/include/aarch64-linux-gnu
#
CC_OPT += -D_GNU_SOURCE

#
# Enable definition of __STDC_HOSTED__
#
CC_OPT_FREESTANDING =
8 changes: 7 additions & 1 deletion repos/base/mk/global.mk
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ ifneq ($(STDLIB),yes)
LD_OPT_NOSTDLIB := -nostdlib -Wl,-nostdlib
endif

#
# Prevent the definition of __STDC_HOSTED__ by default
#
CC_OPT_FREESTANDING ?= -ffreestanding

#
# Add coverage options
#
Expand Down Expand Up @@ -166,7 +171,8 @@ CC_ADA_WARN ?= -gnatwa $(CC_ADA_WARN_STRICT)
#
# Aggregate compiler options that are common for C and C++
#
CC_OPT += $(CC_OPT_NOSTDINC) -g $(CC_MARCH) $(CC_OLEVEL) $(CC_OPT_DEP) $(CC_WARN)
CC_OPT += $(CC_OPT_NOSTDINC) $(CC_OPT_FREESTANDING) -g \
$(CC_MARCH) $(CC_OLEVEL) $(CC_OPT_DEP) $(CC_WARN)

#
# Incorporate source-file-specific compiler options
Expand Down
5 changes: 5 additions & 0 deletions repos/libports/lib/import/import-libc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ endif
#
REP_INC_DIR += include/libc-genode

#
# Enable definition of __STDC_HOSTED__
#
CC_OPT_FREESTANDING =

#
# Prevent gcc headers from defining __size_t. This definition is done in
# machine/_types.h.
Expand Down

0 comments on commit b455139

Please sign in to comment.