From 479d98918522ba0b8534a790a5284724184b280e Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Mon, 18 Apr 2022 01:09:52 -0700 Subject: [PATCH] [make] default WITH_LINKER_GC to false at the place it is used Also switch the test logic to the TOBOOL macro. --- arch/m68k/rules.mk | 4 +--- arch/microblaze/rules.mk | 2 -- arch/mips/rules.mk | 1 - make/build.mk | 4 +++- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/m68k/rules.mk b/arch/m68k/rules.mk index 0e65a1f8..00194672 100644 --- a/arch/m68k/rules.mk +++ b/arch/m68k/rules.mk @@ -16,10 +16,8 @@ ifndef TOOLCHAIN_PREFIX TOOLCHAIN_PREFIX := m68k-elf- endif -WITH_LINKER_GC ?= 0 - # select the cpu based on flags the platform/target passes in -M68K_CPU ?= 68040 +M68K_CPU ?= 68040 # default to 040 ifeq ($(M68K_CPU),68000) ARCH_COMPILEFLAGS := -mcpu=68000 diff --git a/arch/microblaze/rules.mk b/arch/microblaze/rules.mk index bd8e6a12..296f53cf 100644 --- a/arch/microblaze/rules.mk +++ b/arch/microblaze/rules.mk @@ -24,8 +24,6 @@ ifndef TOOLCHAIN_PREFIX TOOLCHAIN_PREFIX := microblaze-elf- endif -WITH_LINKER_GC ?= 0 - LITTLE_ENDIAN ?= 0 ifneq ($(LITTLE_ENDIAN),0) diff --git a/arch/mips/rules.mk b/arch/mips/rules.mk index 49ab0c30..1ea27b4d 100644 --- a/arch/mips/rules.mk +++ b/arch/mips/rules.mk @@ -26,7 +26,6 @@ ifndef TOOLCHAIN_PREFIX TOOLCHAIN_PREFIX := mips-elf- endif -WITH_LINKER_GC ?= 0 LITTLE_ENDIAN ?= 0 ifneq ($(LITTLE_ENDIAN),0) diff --git a/make/build.mk b/make/build.mk index 0efe81b6..84dca4a1 100644 --- a/make/build.mk +++ b/make/build.mk @@ -1,7 +1,9 @@ # use linker garbage collection, if requested -ifeq ($(WITH_LINKER_GC),1) +WITH_LINKER_GC ?= false +ifeq (true,$(call TOBOOL,$(WITH_LINKER_GC))) GLOBAL_COMPILEFLAGS += -ffunction-sections -fdata-sections GLOBAL_LDFLAGS += --gc-sections +GLOBAL_DEFINES += LINKER_GC=1 endif ifneq (,$(EXTRA_BUILDRULES))