Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ ifneq ($(MAINSRC),)
MODCXXFLAGS = $(CXXELFFLAGS)
MODLDFLAGS = $(LDELFFLAGS)
endif

# The compiler driver (CONFIG_LTO_FULL) takes a linker option with -Wl,

ifneq ($(filter %gcc %clang,$(firstword $(MODULELD))),)
MODDEFSYM = -Wl,--defsym=
else
MODDEFSYM = --defsym=
endif
endif

# The GNU make CURDIR will always be a POSIX-like path with forward slashes
Expand Down Expand Up @@ -140,13 +148,13 @@ ifneq ($(strip $(PROGNAME)),)
# Per-target so each PROGLIST entry picks up its own STACKSIZE_/PRIORITY_.

$(PROGLIST): MODLDFLAGS += \
$(if $(STACKSIZE_$@),--defsym nx_stacksize=$(STACKSIZE_$@)) \
$(if $(filter-out SCHED_PRIORITY_DEFAULT,$(PRIORITY_$@)),--defsym nx_priority=$(PRIORITY_$@))
$(if $(STACKSIZE_$@),$(MODDEFSYM)nx_stacksize=$(STACKSIZE_$@)) \
$(if $(filter-out SCHED_PRIORITY_DEFAULT,$(PRIORITY_$@)),$(MODDEFSYM)nx_priority=$(PRIORITY_$@))
ifeq ($(CONFIG_SCHED_USER_IDENTITY),y)
$(PROGLIST): MODLDFLAGS += \
$(if $(UID_$@),--defsym nx_uid=$(UID_$@)) \
$(if $(GID_$@),--defsym nx_gid=$(GID_$@)) \
$(if $(MODE_$@),--defsym nx_mode=$(MODE_$@))
$(if $(UID_$@),$(MODDEFSYM)nx_uid=$(UID_$@)) \
$(if $(GID_$@),$(MODDEFSYM)nx_gid=$(GID_$@)) \
$(if $(MODE_$@),$(MODDEFSYM)nx_mode=$(MODE_$@))
endif

# Keep the attribute symbols through --strip-unneeded so the binary loader
Expand Down
Loading