xiaoxiang781216 commented on code in PR #1783: URL: https://github.com/apache/nuttx-apps/pull/1783#discussion_r1225774890
########## tools/Wasm.mk: ########## @@ -54,10 +54,29 @@ CFLAGS_STRIP += $(ARCHCPUFLAGS) $(ARCHCFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(A WCFLAGS += $(filter-out $(CFLAGS_STRIP),$(CFLAGS)) WCFLAGS += --sysroot=$(WSYSROOT) -nostdlib -D__NuttX__ +# Setup optimization and lto flags + +ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y) + WCFLAGS += $(CONFIG_DEBUG_OPTLEVEL) +else ifeq ($(CONFIG_DEBUG_FULLOPT),y) + WCFLAGS += -Oz +endif + +ifeq ($(CONFIG_LTO_FULL),y) + WCFLAGS += -flto=full +else ifeq ($(CONFIG_LTO_THIN),y) + WCFLAGS += -flto=thin +endif + +ifneq ($(CONFIG_LTO_NONE),y) + WLDFLAGS += -Wl,--lto +endif + WLDFLAGS = -z stack-size=$(STACKSIZE) -Wl,--initial-memory=$(INITIAL_MEMORY) WLDFLAGS += -Wl,--export=main -Wl,--export=__main_argc_argv WLDFLAGS += -Wl,--export=__heap_base -Wl,--export=__data_end WLDFLAGS += -Wl,--no-entry -Wl,--strip-all -Wl,--allow-undefined +WLDFLAGS += $(filter -flto%, $(ARCHOPTIMIZATION)) Review Comment: remove the reference to ARCHOPTIMIZATION -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
