summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-22 15:37:32 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-27 21:16:56 +0200
commitc6f95bc715c4dad2e189b8b6fcb29963c4cec1cd (patch)
treed8c443ba46336f13ffd84a7dc488f6338939783f /arch/x86
parent331eecaa77074726cf7be045afad5eea5969f477 (diff)
downloadbarebox-c6f95bc715c4dad2e189b8b6fcb29963c4cec1cd.tar.gz
barebox-c6f95bc715c4dad2e189b8b6fcb29963c4cec1cd.tar.xz
kbuild: prefix compiler flag variables with KBUILD_
In old days, Linux also used to use well-known variables such CFLAGS, CPPFLAGS, etc. They were prefixed with KBUILD_ presumably for preventing users from overriding them accidentally. Rename as follows: CFLAGS -> KBUILD_CFLAGS AFLAGS -> KBUILD_AFLAGS CPPFLAGS -> KBUILD_CPPFLAGS LDFLAGS -> KBUILD_LDFLAGS HOSTCFLAGS -> KBUILD_HOSTCFLAGS HOSTCXXFLAGS -> KBUILD_HOSTCXXFLAGS HOSTLDFLAGS -> KBUILD_HOSTLDFLAGS HOST_LOADLIBES -> KBUILD_HOSTLDLIBS HOSTCFLAGS, HOSTCXXFLAGS, HOSTLDFLAGS, HOSTLDLIBS are re-used to allow users to pass-in additional flags to the host compiler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Makefile32
-rw-r--r--arch/x86/boot/Makefile2
2 files changed, 17 insertions, 17 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 4d471c2f8a..c93a680e40 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -1,6 +1,6 @@
KBUILD_DEFCONFIG := generic_defconfig
-CPPFLAGS += -D__X86__
+KBUILD_CPPFLAGS += -D__X86__
board-$(CONFIG_MACH_X86_GENERIC) := x86_generic
@@ -8,15 +8,15 @@ TEXT_BASE = $(CONFIG_TEXT_BASE)
ifeq ($(CONFIG_X86_EFI),y)
machine-y := efi
-CFLAGS += -fpic -fshort-wchar -mno-sse -mno-mmx
+KBUILD_CFLAGS += -fpic -fshort-wchar -mno-sse -mno-mmx
ifeq ($(CONFIG_X86_32),y)
TARGET = efi-app-ia32
else
TARGET = efi-app-x86_64
endif
else
-CPPFLAGS += -fno-strict-aliasing
-CPPFLAGS += -march=i386 -DTEXT_BASE=$(TEXT_BASE) \
+KBUILD_CPPFLAGS += -fno-strict-aliasing
+KBUILD_CPPFLAGS += -march=i386 -DTEXT_BASE=$(TEXT_BASE) \
-fno-unwind-tables -fno-asynchronous-unwind-tables
machine-y := i386
@@ -25,21 +25,21 @@ endif
ifeq ($(CONFIG_X86_32),y)
UTS_MACHINE := i386
biarch := $(call cc-option,-m32)
- AFLAGS += $(biarch)
- CFLAGS += $(biarch)
- CPPFLAGS += $(biarch)
+ KBUILD_AFLAGS += $(biarch)
+ KBUILD_CFLAGS += $(biarch)
+ KBUILD_CPPFLAGS += $(biarch)
else
UTS_MACHINE := x86_64
- AFLAGS += -m64
- CFLAGS += -m64 -mno-red-zone
- CPPFLAGS += -m64
+ KBUILD_AFLAGS += -m64
+ KBUILD_CFLAGS += -m64 -mno-red-zone
+ KBUILD_CPPFLAGS += -m64
endif
ifndef CONFIG_MODULES
# Add cleanup flags
ifneq ($(CONFIG_X86_EFI),y)
-CPPFLAGS += -fdata-sections -ffunction-sections
+KBUILD_CPPFLAGS += -fdata-sections -ffunction-sections
LDFLAGS_barebox += -static --gc-sections
endif
endif
@@ -47,9 +47,9 @@ endif
machdirs := $(patsubst %,arch/x86/mach-%/,$(machine-y))
ifeq ($(KBUILD_SRC),)
-CPPFLAGS += $(patsubst %,-I%include,$(machdirs))
+KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs))
else
-CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
+KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
endif
ifneq ($(board-y),)
@@ -74,7 +74,7 @@ ifeq ($(CONFIG_X86_EFI),y)
lds-$(CONFIG_X86_32) := arch/x86/mach-efi/elf_ia32_efi.lds
lds-$(CONFIG_X86_64) := arch/x86/mach-efi/elf_x86_64_efi.lds
-cmd_barebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_barebox) -o $@ \
+cmd_barebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_barebox) -o $@ \
-T $(lds-y) \
-shared -Bsymbolic -nostdlib -znocombreloc \
--start-group $(BAREBOX_OBJS) \
@@ -89,7 +89,7 @@ quiet_cmd_efi_image = EFI-IMG $@
KBUILD_BINARY := barebox
-LDFLAGS := --no-undefined
+KBUILD_LDFLAGS := --no-undefined
barebox.efi: $(KBUILD_BINARY) FORCE
$(call if_changed,efi_image)
@@ -104,7 +104,7 @@ lds-$(CONFIG_BOARD_LINKER_SCRIPT) := $(BOARD)/barebox.lds
endif
-LDFLAGS += -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
CLEAN_FILES += $(lds-y)
CLEAN_FILES += arch/x86/lib/barebox.lds barebox.map barebox.S
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index b92b4750fc..4a520a2a84 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -1,5 +1,5 @@
-CPPFLAGS += -D__I386__ -fno-strict-aliasing -m32 -g -Os -march=i386 \
+KBUILD_CPPFLAGS += -D__I386__ -fno-strict-aliasing -m32 -g -Os -march=i386 \
-mregparm=3 -fno-strict-aliasing -fomit-frame-pointer -ffreestanding \
-fno-toplevel-reorder -fno-unit-at-a-time -fno-stack-protector \
-mpreferred-stack-boundary=2