mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
kbuild: enable 'make CFLAGS=...' to add additional options to CC
The variable CFLAGS is a wellknown variable and the usage by kbuild may result in unexpected behaviour. On top of that several people over time has asked for a way to pass in additional flags to gcc. This patch replace use of CFLAGS with KBUILD_CFLAGS all over the tree and enabling one to use: make CFLAGS=... to specify additional gcc commandline options. One usecase is when trying to find gcc bugs but other use cases has been requested too. Patch was tested on following architectures: alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k Test was simple to do a defconfig build, apply the patch and check that nothing got rebuild. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
parent
9a39e273d4
commit
a0f97e06a4
46 changed files with 137 additions and 136 deletions
|
@ -294,7 +294,7 @@ more details, with real examples.
|
||||||
|
|
||||||
|
|
||||||
This variable is necessary because the top Makefile owns the
|
This variable is necessary because the top Makefile owns the
|
||||||
variable $(CFLAGS) and uses it for compilation flags for the
|
variable $(KBUILD_CFLAGS) and uses it for compilation flags for the
|
||||||
entire tree.
|
entire tree.
|
||||||
|
|
||||||
$(EXTRA_AFLAGS) is a similar string for per-directory options
|
$(EXTRA_AFLAGS) is a similar string for per-directory options
|
||||||
|
@ -437,6 +437,7 @@ more details, with real examples.
|
||||||
-march=pentium-mmx if supported by $(CC), otherwise -march=i586.
|
-march=pentium-mmx if supported by $(CC), otherwise -march=i586.
|
||||||
The second argument to cc-option is optional, and if omitted,
|
The second argument to cc-option is optional, and if omitted,
|
||||||
cflags-y will be assigned no value if first option is not supported.
|
cflags-y will be assigned no value if first option is not supported.
|
||||||
|
Note: cc-option uses KBUILD_CFLAGS for $(CC) options
|
||||||
|
|
||||||
cc-option-yn
|
cc-option-yn
|
||||||
cc-option-yn is used to check if gcc supports a given option
|
cc-option-yn is used to check if gcc supports a given option
|
||||||
|
@ -452,6 +453,7 @@ more details, with real examples.
|
||||||
option. When $(biarch) equals 'y', the expanded variables $(aflags-y)
|
option. When $(biarch) equals 'y', the expanded variables $(aflags-y)
|
||||||
and $(cflags-y) will be assigned the values -a32 and -m32,
|
and $(cflags-y) will be assigned the values -a32 and -m32,
|
||||||
respectively.
|
respectively.
|
||||||
|
Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options
|
||||||
|
|
||||||
cc-option-align
|
cc-option-align
|
||||||
gcc versions >= 3.0 changed the type of options used to specify
|
gcc versions >= 3.0 changed the type of options used to specify
|
||||||
|
@ -463,10 +465,11 @@ more details, with real examples.
|
||||||
cc-option-align = -falign
|
cc-option-align = -falign
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
CFLAGS += $(cc-option-align)-functions=4
|
KBUILD_CFLAGS += $(cc-option-align)-functions=4
|
||||||
|
|
||||||
In the above example, the option -falign-functions=4 is used for
|
In the above example, the option -falign-functions=4 is used for
|
||||||
gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used.
|
gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used.
|
||||||
|
Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options
|
||||||
|
|
||||||
cc-version
|
cc-version
|
||||||
cc-version returns a numerical version of the $(CC) compiler version.
|
cc-version returns a numerical version of the $(CC) compiler version.
|
||||||
|
@ -825,17 +828,17 @@ When kbuild executes, the following steps are followed (roughly):
|
||||||
#arch/sparc64/Makefile
|
#arch/sparc64/Makefile
|
||||||
AFLAGS += -m64 -mcpu=ultrasparc
|
AFLAGS += -m64 -mcpu=ultrasparc
|
||||||
|
|
||||||
CFLAGS $(CC) compiler flags
|
KBUILD_CFLAGS $(CC) compiler flags
|
||||||
|
|
||||||
Default value - see top level Makefile
|
Default value - see top level Makefile
|
||||||
Append or modify as required per architecture.
|
Append or modify as required per architecture.
|
||||||
|
|
||||||
Often, the CFLAGS variable depends on the configuration.
|
Often, the KBUILD_CFLAGS variable depends on the configuration.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
#arch/i386/Makefile
|
#arch/i386/Makefile
|
||||||
cflags-$(CONFIG_M386) += -march=i386
|
cflags-$(CONFIG_M386) += -march=i386
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
|
|
||||||
Many arch Makefiles dynamically run the target C compiler to
|
Many arch Makefiles dynamically run the target C compiler to
|
||||||
probe supported options:
|
probe supported options:
|
||||||
|
@ -847,7 +850,7 @@ When kbuild executes, the following steps are followed (roughly):
|
||||||
-march=pentium2,-march=i686)
|
-march=pentium2,-march=i686)
|
||||||
...
|
...
|
||||||
# Disable unit-at-a-time mode ...
|
# Disable unit-at-a-time mode ...
|
||||||
CFLAGS += $(call cc-option,-fno-unit-at-a-time)
|
KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time)
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
|
20
Makefile
20
Makefile
|
@ -320,7 +320,7 @@ LINUXINCLUDE := -Iinclude \
|
||||||
|
|
||||||
CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
|
CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
|
||||||
|
|
||||||
CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||||
-fno-strict-aliasing -fno-common \
|
-fno-strict-aliasing -fno-common \
|
||||||
-Werror-implicit-function-declaration
|
-Werror-implicit-function-declaration
|
||||||
AFLAGS := -D__ASSEMBLY__
|
AFLAGS := -D__ASSEMBLY__
|
||||||
|
@ -335,7 +335,7 @@ export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
|
||||||
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
|
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
|
||||||
|
|
||||||
export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
|
export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
|
||||||
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
|
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
|
||||||
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
|
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
|
||||||
|
|
||||||
# When compiling out-of-tree modules, put MODVERDIR in the module
|
# When compiling out-of-tree modules, put MODVERDIR in the module
|
||||||
|
@ -492,36 +492,36 @@ endif # $(dot-config)
|
||||||
all: vmlinux
|
all: vmlinux
|
||||||
|
|
||||||
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||||
CFLAGS += -Os
|
KBUILD_CFLAGS += -Os
|
||||||
else
|
else
|
||||||
CFLAGS += -O2
|
KBUILD_CFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(srctree)/arch/$(ARCH)/Makefile
|
include $(srctree)/arch/$(ARCH)/Makefile
|
||||||
|
|
||||||
ifdef CONFIG_FRAME_POINTER
|
ifdef CONFIG_FRAME_POINTER
|
||||||
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||||
else
|
else
|
||||||
CFLAGS += -fomit-frame-pointer
|
KBUILD_CFLAGS += -fomit-frame-pointer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_DEBUG_INFO
|
ifdef CONFIG_DEBUG_INFO
|
||||||
CFLAGS += -g
|
KBUILD_CFLAGS += -g
|
||||||
AFLAGS += -gdwarf-2
|
AFLAGS += -gdwarf-2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Force gcc to behave correct even for buggy distributions
|
# Force gcc to behave correct even for buggy distributions
|
||||||
CFLAGS += $(call cc-option, -fno-stack-protector)
|
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
|
||||||
|
|
||||||
# arch Makefile may override CC so keep this after arch Makefile is included
|
# arch Makefile may override CC so keep this after arch Makefile is included
|
||||||
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
|
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
|
||||||
CHECKFLAGS += $(NOSTDINC_FLAGS)
|
CHECKFLAGS += $(NOSTDINC_FLAGS)
|
||||||
|
|
||||||
# warn about C99 declaration after statement
|
# warn about C99 declaration after statement
|
||||||
CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
|
KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
|
||||||
|
|
||||||
# disable pointer signed / unsigned warnings in gcc 4.0
|
# disable pointer signed / unsigned warnings in gcc 4.0
|
||||||
CFLAGS += $(call cc-option,-Wno-pointer-sign,)
|
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
|
||||||
|
|
||||||
# Use --build-id when available.
|
# Use --build-id when available.
|
||||||
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
|
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
|
||||||
|
|
|
@ -84,7 +84,7 @@ endif
|
||||||
# For TSUNAMI, we must have the assembler not emulate our instructions.
|
# For TSUNAMI, we must have the assembler not emulate our instructions.
|
||||||
# The same is true for IRONGATE, POLARIS, PYXIS.
|
# The same is true for IRONGATE, POLARIS, PYXIS.
|
||||||
# BWX is most important, but we don't really want any emulation ever.
|
# BWX is most important, but we don't really want any emulation ever.
|
||||||
CFLAGS += $(cflags-y) -Wa,-mev6
|
KBUILD_CFLAGS += $(cflags-y) -Wa,-mev6
|
||||||
|
|
||||||
head-y := arch/alpha/kernel/head.o
|
head-y := arch/alpha/kernel/head.o
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
extra-y := head.o vmlinux.lds
|
extra-y := head.o vmlinux.lds
|
||||||
EXTRA_AFLAGS := $(CFLAGS)
|
EXTRA_AFLAGS := $(KBUILD_CFLAGS)
|
||||||
EXTRA_CFLAGS := -Werror -Wno-sign-compare
|
EXTRA_CFLAGS := -Werror -Wno-sign-compare
|
||||||
|
|
||||||
obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
|
obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Makefile for alpha-specific library files..
|
# Makefile for alpha-specific library files..
|
||||||
#
|
#
|
||||||
|
|
||||||
EXTRA_AFLAGS := $(CFLAGS)
|
EXTRA_AFLAGS := $(KBUILD_CFLAGS)
|
||||||
EXTRA_CFLAGS := -Werror
|
EXTRA_CFLAGS := -Werror
|
||||||
|
|
||||||
# Many of these routines have implementations tuned for ev6.
|
# Many of these routines have implementations tuned for ev6.
|
||||||
|
|
|
@ -14,9 +14,9 @@ LDFLAGS_vmlinux :=-p --no-undefined -X
|
||||||
CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
|
CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
|
||||||
OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
|
OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
|
||||||
GZFLAGS :=-9
|
GZFLAGS :=-9
|
||||||
#CFLAGS +=-pipe
|
#KBUILD_CFLAGS +=-pipe
|
||||||
# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
|
# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
|
||||||
CFLAGS +=$(call cc-option,-marm,)
|
KBUILD_CFLAGS +=$(call cc-option,-marm,)
|
||||||
|
|
||||||
# Do not use arch/arm/defconfig - it's always outdated.
|
# Do not use arch/arm/defconfig - it's always outdated.
|
||||||
# Select a platform tht is kept up-to-date
|
# Select a platform tht is kept up-to-date
|
||||||
|
@ -28,7 +28,7 @@ MMUEXT := -nommu
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||||
CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
|
KBUILD_CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
|
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
|
||||||
|
@ -85,7 +85,7 @@ CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-th
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Need -Uarm for gcc < 3.x
|
# Need -Uarm for gcc < 3.x
|
||||||
CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
|
KBUILD_CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
|
||||||
AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
|
AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
|
||||||
|
|
||||||
CHECKFLAGS += -D__arm__
|
CHECKFLAGS += -D__arm__
|
||||||
|
|
|
@ -87,7 +87,7 @@ ifneq ($(PARAMS_PHYS),)
|
||||||
LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
|
LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
|
||||||
endif
|
endif
|
||||||
LDFLAGS_vmlinux += -p --no-undefined -X \
|
LDFLAGS_vmlinux += -p --no-undefined -X \
|
||||||
$(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -T
|
$(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name) -T
|
||||||
|
|
||||||
# Don't allow any static data in misc.o, which
|
# Don't allow any static data in misc.o, which
|
||||||
# would otherwise mess up our GOT table
|
# would otherwise mess up our GOT table
|
||||||
|
|
|
@ -11,14 +11,14 @@ all: uImage vmlinux.elf
|
||||||
|
|
||||||
KBUILD_DEFCONFIG := atstk1002_defconfig
|
KBUILD_DEFCONFIG := atstk1002_defconfig
|
||||||
|
|
||||||
CFLAGS += -pipe -fno-builtin -mno-pic
|
KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic
|
||||||
AFLAGS += -mrelax -mno-pic
|
AFLAGS += -mrelax -mno-pic
|
||||||
CFLAGS_MODULE += -mno-relax
|
CFLAGS_MODULE += -mno-relax
|
||||||
LDFLAGS_vmlinux += --relax
|
LDFLAGS_vmlinux += --relax
|
||||||
|
|
||||||
cpuflags-$(CONFIG_CPU_AT32AP7000) += -mcpu=ap7000
|
cpuflags-$(CONFIG_CPU_AT32AP7000) += -mcpu=ap7000
|
||||||
|
|
||||||
CFLAGS += $(cpuflags-y)
|
KBUILD_CFLAGS += $(cpuflags-y)
|
||||||
AFLAGS += $(cpuflags-y)
|
AFLAGS += $(cpuflags-y)
|
||||||
|
|
||||||
CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN
|
CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN
|
||||||
|
|
|
@ -53,7 +53,7 @@ rev-$(CONFIG_BF_REV_0_5) := 0.5
|
||||||
rev-$(CONFIG_BF_REV_NONE) := none
|
rev-$(CONFIG_BF_REV_NONE) := none
|
||||||
rev-$(CONFIG_BF_REV_ANY) := any
|
rev-$(CONFIG_BF_REV_ANY) := any
|
||||||
|
|
||||||
CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
|
KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
|
||||||
AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
|
AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
|
||||||
|
|
||||||
head-y := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
|
head-y := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
|
||||||
|
|
|
@ -31,16 +31,16 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S
|
||||||
CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
|
CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
|
||||||
AFLAGS += -mlinux
|
AFLAGS += -mlinux
|
||||||
|
|
||||||
CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
|
KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe
|
||||||
|
|
||||||
ifdef CONFIG_FRAME_POINTER
|
ifdef CONFIG_FRAME_POINTER
|
||||||
CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
|
KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
|
||||||
CFLAGS += -fno-omit-frame-pointer
|
KBUILD_CFLAGS += -fno-omit-frame-pointer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
|
head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
|
||||||
|
|
||||||
LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
|
LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
|
||||||
|
|
||||||
core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
|
core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
|
||||||
core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
|
core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
|
||||||
|
|
|
@ -39,13 +39,13 @@ endif
|
||||||
ARCHMODFLAGS += -G0 -mlong-calls
|
ARCHMODFLAGS += -G0 -mlong-calls
|
||||||
|
|
||||||
ifdef CONFIG_GPREL_DATA_8
|
ifdef CONFIG_GPREL_DATA_8
|
||||||
CFLAGS += -G8
|
KBUILD_CFLAGS += -G8
|
||||||
else
|
else
|
||||||
ifdef CONFIG_GPREL_DATA_4
|
ifdef CONFIG_GPREL_DATA_4
|
||||||
CFLAGS += -G4
|
KBUILD_CFLAGS += -G4
|
||||||
else
|
else
|
||||||
ifdef CONFIG_GPREL_DATA_NONE
|
ifdef CONFIG_GPREL_DATA_NONE
|
||||||
CFLAGS += -G0
|
KBUILD_CFLAGS += -G0
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -53,25 +53,25 @@ endif
|
||||||
#LDFLAGS_vmlinux := -Map linkmap.txt
|
#LDFLAGS_vmlinux := -Map linkmap.txt
|
||||||
|
|
||||||
ifdef CONFIG_GC_SECTIONS
|
ifdef CONFIG_GC_SECTIONS
|
||||||
CFLAGS += -ffunction-sections -fdata-sections
|
KBUILD_CFLAGS += -ffunction-sections -fdata-sections
|
||||||
LINKFLAGS += --gc-sections
|
LINKFLAGS += --gc-sections
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef CONFIG_FRAME_POINTER
|
ifndef CONFIG_FRAME_POINTER
|
||||||
CFLAGS += -mno-linked-fp
|
KBUILD_CFLAGS += -mno-linked-fp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_CPU_FR451_COMPILE
|
ifdef CONFIG_CPU_FR451_COMPILE
|
||||||
CFLAGS += -mcpu=fr450
|
KBUILD_CFLAGS += -mcpu=fr450
|
||||||
AFLAGS += -mcpu=fr450
|
AFLAGS += -mcpu=fr450
|
||||||
ASFLAGS += -mcpu=fr450
|
ASFLAGS += -mcpu=fr450
|
||||||
else
|
else
|
||||||
ifdef CONFIG_CPU_FR551_COMPILE
|
ifdef CONFIG_CPU_FR551_COMPILE
|
||||||
CFLAGS += -mcpu=fr550
|
KBUILD_CFLAGS += -mcpu=fr550
|
||||||
AFLAGS += -mcpu=fr550
|
AFLAGS += -mcpu=fr550
|
||||||
ASFLAGS += -mcpu=fr550
|
ASFLAGS += -mcpu=fr550
|
||||||
else
|
else
|
||||||
CFLAGS += -mcpu=fr400
|
KBUILD_CFLAGS += -mcpu=fr400
|
||||||
AFLAGS += -mcpu=fr400
|
AFLAGS += -mcpu=fr400
|
||||||
ASFLAGS += -mcpu=fr400
|
ASFLAGS += -mcpu=fr400
|
||||||
endif
|
endif
|
||||||
|
@ -80,15 +80,15 @@ endif
|
||||||
# pretend the kernel is going to run on an FR400 with no media-fp unit
|
# pretend the kernel is going to run on an FR400 with no media-fp unit
|
||||||
# - reserve CC3 for use with atomic ops
|
# - reserve CC3 for use with atomic ops
|
||||||
# - all the extra registers are dealt with only at context switch time
|
# - all the extra registers are dealt with only at context switch time
|
||||||
CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media
|
KBUILD_CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media
|
||||||
CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
|
KBUILD_CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
|
||||||
AFLAGS += -mno-fdpic
|
AFLAGS += -mno-fdpic
|
||||||
ASFLAGS += -mno-fdpic
|
ASFLAGS += -mno-fdpic
|
||||||
|
|
||||||
# make sure the .S files get compiled with debug info
|
# make sure the .S files get compiled with debug info
|
||||||
# and disable optimisations that are unhelpful whilst debugging
|
# and disable optimisations that are unhelpful whilst debugging
|
||||||
ifdef CONFIG_DEBUG_INFO
|
ifdef CONFIG_DEBUG_INFO
|
||||||
#CFLAGS += -O1
|
#KBUILD_CFLAGS += -O1
|
||||||
AFLAGS += -Wa,--gdwarf2
|
AFLAGS += -Wa,--gdwarf2
|
||||||
ASFLAGS += -Wa,--gdwarf2
|
ASFLAGS += -Wa,--gdwarf2
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -30,16 +30,16 @@ ldflags-$(CONFIG_CPU_H8300H) := -mh8300helf
|
||||||
cflags-$(CONFIG_CPU_H8S) := -ms
|
cflags-$(CONFIG_CPU_H8S) := -ms
|
||||||
ldflags-$(CONFIG_CPU_H8S) := -mh8300self
|
ldflags-$(CONFIG_CPU_H8S) := -mh8300self
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
CFLAGS += -mint32 -fno-builtin
|
KBUILD_CFLAGS += -mint32 -fno-builtin
|
||||||
CFLAGS += -g
|
KBUILD_CFLAGS += -g
|
||||||
CFLAGS += -D__linux__
|
KBUILD_CFLAGS += -D__linux__
|
||||||
CFLAGS += -DUTS_SYSNAME=\"uClinux\"
|
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
|
||||||
AFLAGS += -DPLATFORM=$(PLATFORM) -DMODEL=$(MODEL) $(cflags-y)
|
AFLAGS += -DPLATFORM=$(PLATFORM) -DMODEL=$(MODEL) $(cflags-y)
|
||||||
LDFLAGS += $(ldflags-y)
|
LDFLAGS += $(ldflags-y)
|
||||||
|
|
||||||
CROSS_COMPILE = h8300-elf-
|
CROSS_COMPILE = h8300-elf-
|
||||||
LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||||
|
|
||||||
head-y := arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/crt0_$(MODEL).o
|
head-y := arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/crt0_$(MODEL).o
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,10 @@ LDFLAGS_vmlinux := --emit-relocs
|
||||||
endif
|
endif
|
||||||
CHECKFLAGS += -D__i386__
|
CHECKFLAGS += -D__i386__
|
||||||
|
|
||||||
CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return
|
KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return
|
||||||
|
|
||||||
# prevent gcc from keeping the stack 16 byte aligned
|
# prevent gcc from keeping the stack 16 byte aligned
|
||||||
CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
|
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
|
||||||
|
|
||||||
# CPU-specific tuning. Anything which can be shared with UML should go here.
|
# CPU-specific tuning. Anything which can be shared with UML should go here.
|
||||||
include $(srctree)/arch/i386/Makefile.cpu
|
include $(srctree)/arch/i386/Makefile.cpu
|
||||||
|
@ -51,7 +51,7 @@ cflags-y += -maccumulate-outgoing-args
|
||||||
|
|
||||||
# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
|
# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
|
||||||
# a lot more stack due to the lack of sharing of stacklots:
|
# a lot more stack due to the lack of sharing of stacklots:
|
||||||
CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
|
KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
|
||||||
|
|
||||||
# do binutils support CFI?
|
# do binutils support CFI?
|
||||||
cflags-y += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
|
cflags-y += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
|
||||||
|
@ -61,7 +61,7 @@ AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_end
|
||||||
cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
|
cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
|
||||||
AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
|
AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
|
|
||||||
# Default subarch .c files
|
# Default subarch .c files
|
||||||
mcore-y := arch/x86/mach-default
|
mcore-y := arch/x86/mach-default
|
||||||
|
@ -116,7 +116,7 @@ drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
|
||||||
drivers-$(CONFIG_PM) += arch/x86/power/
|
drivers-$(CONFIG_PM) += arch/x86/power/
|
||||||
drivers-$(CONFIG_FB) += arch/x86/video/
|
drivers-$(CONFIG_FB) += arch/x86/video/
|
||||||
|
|
||||||
CFLAGS += $(mflags-y)
|
KBUILD_CFLAGS += $(mflags-y)
|
||||||
AFLAGS += $(mflags-y)
|
AFLAGS += $(mflags-y)
|
||||||
|
|
||||||
boot := arch/x86/boot
|
boot := arch/x86/boot
|
||||||
|
|
|
@ -44,7 +44,7 @@ ifeq ($(call cc-version),0304)
|
||||||
cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley
|
cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o
|
head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o
|
||||||
|
|
||||||
libs-y += arch/ia64/lib/
|
libs-y += arch/ia64/lib/
|
||||||
|
|
|
@ -9,7 +9,7 @@ LDFLAGS :=
|
||||||
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
|
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
|
||||||
LDFLAGS_vmlinux :=
|
LDFLAGS_vmlinux :=
|
||||||
|
|
||||||
CFLAGS += -pipe -fno-schedule-insns
|
KBUILD_CFLAGS += -pipe -fno-schedule-insns
|
||||||
CFLAGS_KERNEL += -mmodel=medium
|
CFLAGS_KERNEL += -mmodel=medium
|
||||||
CFLAGS_MODULE += -mmodel=large
|
CFLAGS_MODULE += -mmodel=large
|
||||||
|
|
||||||
|
@ -24,14 +24,14 @@ endif
|
||||||
cflags-$(CONFIG_ISA_M32R) += -DNO_FPU
|
cflags-$(CONFIG_ISA_M32R) += -DNO_FPU
|
||||||
aflags-$(CONFIG_ISA_M32R) += -DNO_FPU -O2 -Wa,-no-bitinst
|
aflags-$(CONFIG_ISA_M32R) += -DNO_FPU -O2 -Wa,-no-bitinst
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
AFLAGS += $(aflags-y)
|
AFLAGS += $(aflags-y)
|
||||||
|
|
||||||
CHECKFLAGS += -D__m32r__ -D__BIG_ENDIAN__=1
|
CHECKFLAGS += -D__m32r__ -D__BIG_ENDIAN__=1
|
||||||
|
|
||||||
head-y := arch/m32r/kernel/head.o arch/m32r/kernel/init_task.o
|
head-y := arch/m32r/kernel/head.o arch/m32r/kernel/init_task.o
|
||||||
|
|
||||||
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||||
|
|
||||||
libs-y += arch/m32r/lib/ $(LIBGCC)
|
libs-y += arch/m32r/lib/ $(LIBGCC)
|
||||||
core-y += arch/m32r/kernel/ \
|
core-y += arch/m32r/kernel/ \
|
||||||
|
|
|
@ -32,18 +32,18 @@ endif
|
||||||
CHECKFLAGS += -D__mc68000__
|
CHECKFLAGS += -D__mc68000__
|
||||||
|
|
||||||
# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
|
# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
|
||||||
CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
|
KBUILD_CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
|
||||||
|
|
||||||
# enable processor switch if compiled only for a single cpu
|
# enable processor switch if compiled only for a single cpu
|
||||||
ifndef CONFIG_M68020
|
ifndef CONFIG_M68020
|
||||||
ifndef CONFIG_M68030
|
ifndef CONFIG_M68030
|
||||||
|
|
||||||
ifndef CONFIG_M68060
|
ifndef CONFIG_M68060
|
||||||
CFLAGS := $(CFLAGS) -m68040
|
KBUILD_CFLAGS += -m68040
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef CONFIG_M68040
|
ifndef CONFIG_M68040
|
||||||
CFLAGS := $(CFLAGS) -m68060
|
KBUILD_CFLAGS += -m68060
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@ -52,7 +52,7 @@ endif
|
||||||
ifdef CONFIG_KGDB
|
ifdef CONFIG_KGDB
|
||||||
# If configured for kgdb support, include debugging infos and keep the
|
# If configured for kgdb support, include debugging infos and keep the
|
||||||
# frame pointer
|
# frame pointer
|
||||||
CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
|
KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef CONFIG_SUN3
|
ifndef CONFIG_SUN3
|
||||||
|
|
|
@ -104,9 +104,9 @@ cflags-$(CONFIG_M68360) := -m68332
|
||||||
|
|
||||||
AFLAGS += $(cflags-y)
|
AFLAGS += $(cflags-y)
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
CFLAGS += -D__linux__
|
KBUILD_CFLAGS += -D__linux__
|
||||||
CFLAGS += -DUTS_SYSNAME=\"uClinux\"
|
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
|
||||||
|
|
||||||
head-y := arch/m68knommu/platform/$(cpuclass-y)/head.o
|
head-y := arch/m68knommu/platform/$(cpuclass-y)/head.o
|
||||||
|
|
||||||
|
|
|
@ -609,13 +609,13 @@ ifdef CONFIG_64BIT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AFLAGS += $(cflags-y)
|
AFLAGS += $(cflags-y)
|
||||||
CFLAGS += $(cflags-y) \
|
KBUILD_CFLAGS += $(cflags-y) \
|
||||||
-D"VMLINUX_LOAD_ADDRESS=$(load-y)"
|
-D"VMLINUX_LOAD_ADDRESS=$(load-y)"
|
||||||
|
|
||||||
LDFLAGS += -m $(ld-emul)
|
LDFLAGS += -m $(ld-emul)
|
||||||
|
|
||||||
ifdef CONFIG_MIPS
|
ifdef CONFIG_MIPS
|
||||||
CHECKFLAGS += $(shell $(CC) $(CFLAGS) -dM -E -xc /dev/null | \
|
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -xc /dev/null | \
|
||||||
egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \
|
egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \
|
||||||
sed -e 's/^\#define /-D/' -e "s/ /='/" -e "s/$$/'/")
|
sed -e 's/^\#define /-D/' -e "s/ /='/" -e "s/$$/'/")
|
||||||
ifdef CONFIG_64BIT
|
ifdef CONFIG_64BIT
|
||||||
|
@ -632,7 +632,7 @@ OBJCOPYFLAGS += --remove-section=.reginfo
|
||||||
#
|
#
|
||||||
|
|
||||||
CPPFLAGS_vmlinux.lds := \
|
CPPFLAGS_vmlinux.lds := \
|
||||||
$(CFLAGS) \
|
$(KBUILD_CFLAGS) \
|
||||||
-D"LOADADDR=$(load-y)" \
|
-D"LOADADDR=$(load-y)" \
|
||||||
-D"JIFFIES=$(JIFFIES)" \
|
-D"JIFFIES=$(JIFFIES)" \
|
||||||
-D"DATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)"
|
-D"DATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)"
|
||||||
|
|
|
@ -71,7 +71,7 @@ obj-$(CONFIG_PCSPEAKER) += pcspeaker.o
|
||||||
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
|
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
|
||||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||||
|
|
||||||
CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
|
CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
|
||||||
|
|
||||||
obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
|
obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ cflags-$(CONFIG_PA8X00) += -march=2.0 -mschedule=8000
|
||||||
|
|
||||||
head-y := arch/parisc/kernel/head.o
|
head-y := arch/parisc/kernel/head.o
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
|
|
||||||
kernel-y := mm/ kernel/ math-emu/ kernel/init_task.o
|
kernel-y := mm/ kernel/ math-emu/ kernel/init_task.o
|
||||||
kernel-$(CONFIG_HPUX) += hpux/
|
kernel-$(CONFIG_HPUX) += hpux/
|
||||||
|
|
|
@ -77,8 +77,8 @@ CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc
|
||||||
CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
|
CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
|
||||||
CPPFLAGS += $(CPPFLAGS-y)
|
CPPFLAGS += $(CPPFLAGS-y)
|
||||||
AFLAGS += $(AFLAGS-y)
|
AFLAGS += $(AFLAGS-y)
|
||||||
CFLAGS += -msoft-float -pipe $(CFLAGS-y)
|
KBUILD_CFLAGS += -msoft-float -pipe $(CFLAGS-y)
|
||||||
CPP = $(CC) -E $(CFLAGS)
|
CPP = $(CC) -E $(KBUILD_CFLAGS)
|
||||||
|
|
||||||
CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
|
CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
|
||||||
|
|
||||||
|
@ -88,35 +88,35 @@ GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi
|
||||||
ifeq ($(CONFIG_POWER4_ONLY),y)
|
ifeq ($(CONFIG_POWER4_ONLY),y)
|
||||||
ifeq ($(CONFIG_ALTIVEC),y)
|
ifeq ($(CONFIG_ALTIVEC),y)
|
||||||
ifeq ($(GCC_BROKEN_VEC),y)
|
ifeq ($(GCC_BROKEN_VEC),y)
|
||||||
CFLAGS += $(call cc-option,-mcpu=970)
|
KBUILD_CFLAGS += $(call cc-option,-mcpu=970)
|
||||||
else
|
else
|
||||||
CFLAGS += $(call cc-option,-mcpu=power4)
|
KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
CFLAGS += $(call cc-option,-mcpu=power4)
|
KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
CFLAGS += $(call cc-option,-mtune=power4)
|
KBUILD_CFLAGS += $(call cc-option,-mtune=power4)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_TUNE_CELL),y)
|
ifeq ($(CONFIG_TUNE_CELL),y)
|
||||||
CFLAGS += $(call cc-option,-mtune=cell)
|
KBUILD_CFLAGS += $(call cc-option,-mtune=cell)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# No AltiVec instruction when building kernel
|
# No AltiVec instruction when building kernel
|
||||||
CFLAGS += $(call cc-option,-mno-altivec)
|
KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
|
||||||
|
|
||||||
# Enable unit-at-a-time mode when possible. It shrinks the
|
# Enable unit-at-a-time mode when possible. It shrinks the
|
||||||
# kernel considerably.
|
# kernel considerably.
|
||||||
CFLAGS += $(call cc-option,-funit-at-a-time)
|
KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
|
||||||
|
|
||||||
# Never use string load/store instructions as they are
|
# Never use string load/store instructions as they are
|
||||||
# often slow when they are implemented at all
|
# often slow when they are implemented at all
|
||||||
CFLAGS += -mno-string
|
KBUILD_CFLAGS += -mno-string
|
||||||
|
|
||||||
ifeq ($(CONFIG_6xx),y)
|
ifeq ($(CONFIG_6xx),y)
|
||||||
CFLAGS += -mcpu=powerpc
|
KBUILD_CFLAGS += -mcpu=powerpc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cpu-as-$(CONFIG_4xx) += -Wa,-m405
|
cpu-as-$(CONFIG_4xx) += -Wa,-m405
|
||||||
|
@ -126,7 +126,7 @@ cpu-as-$(CONFIG_E500) += -Wa,-me500
|
||||||
cpu-as-$(CONFIG_E200) += -Wa,-me200
|
cpu-as-$(CONFIG_E200) += -Wa,-me200
|
||||||
|
|
||||||
AFLAGS += $(cpu-as-y)
|
AFLAGS += $(cpu-as-y)
|
||||||
CFLAGS += $(cpu-as-y)
|
KBUILD_CFLAGS += $(cpu-as-y)
|
||||||
|
|
||||||
head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
|
head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
|
||||||
head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
|
head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
|
||||||
|
|
|
@ -24,20 +24,20 @@ LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
|
||||||
# The -Iarch/$(ARCH)/include is temporary while we are merging
|
# The -Iarch/$(ARCH)/include is temporary while we are merging
|
||||||
CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
|
CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
|
||||||
AFLAGS += -Iarch/$(ARCH)
|
AFLAGS += -Iarch/$(ARCH)
|
||||||
CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
|
KBUILD_CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
|
||||||
-ffixed-r2 -mmultiple
|
-ffixed-r2 -mmultiple
|
||||||
|
|
||||||
# No AltiVec instruction when building kernel
|
# No AltiVec instruction when building kernel
|
||||||
CFLAGS += $(call cc-option, -mno-altivec)
|
KBUILD_CFLAGS += $(call cc-option, -mno-altivec)
|
||||||
|
|
||||||
CPP = $(CC) -E $(CFLAGS)
|
CPP = $(CC) -E $(KBUILD_CFLAGS)
|
||||||
# Temporary hack until we have migrated to asm-powerpc
|
# Temporary hack until we have migrated to asm-powerpc
|
||||||
LINUXINCLUDE += -Iarch/$(ARCH)/include
|
LINUXINCLUDE += -Iarch/$(ARCH)/include
|
||||||
|
|
||||||
CHECKFLAGS += -D__powerpc__
|
CHECKFLAGS += -D__powerpc__
|
||||||
|
|
||||||
ifndef CONFIG_FSL_BOOKE
|
ifndef CONFIG_FSL_BOOKE
|
||||||
CFLAGS += -mstring
|
KBUILD_CFLAGS += -mstring
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cpu-as-$(CONFIG_4xx) += -Wa,-m405
|
cpu-as-$(CONFIG_4xx) += -Wa,-m405
|
||||||
|
@ -46,7 +46,7 @@ cpu-as-$(CONFIG_E500) += -Wa,-me500
|
||||||
cpu-as-$(CONFIG_E200) += -Wa,-me200
|
cpu-as-$(CONFIG_E200) += -Wa,-me200
|
||||||
|
|
||||||
AFLAGS += $(cpu-as-y)
|
AFLAGS += $(cpu-as-y)
|
||||||
CFLAGS += $(cpu-as-y)
|
KBUILD_CFLAGS += $(cpu-as-y)
|
||||||
|
|
||||||
# Default to the common case.
|
# Default to the common case.
|
||||||
KBUILD_DEFCONFIG := common_defconfig
|
KBUILD_DEFCONFIG := common_defconfig
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
ifndef CONFIG_64BIT
|
ifndef CONFIG_64BIT
|
||||||
LDFLAGS := -m elf_s390
|
LDFLAGS := -m elf_s390
|
||||||
CFLAGS += -m31
|
KBUILD_CFLAGS += -m31
|
||||||
AFLAGS += -m31
|
AFLAGS += -m31
|
||||||
UTS_MACHINE := s390
|
UTS_MACHINE := s390
|
||||||
STACK_SIZE := 8192
|
STACK_SIZE := 8192
|
||||||
|
@ -23,7 +23,7 @@ CHECKFLAGS += -D__s390__ -msize-long
|
||||||
else
|
else
|
||||||
LDFLAGS := -m elf64_s390
|
LDFLAGS := -m elf64_s390
|
||||||
MODFLAGS += -fpic -D__PIC__
|
MODFLAGS += -fpic -D__PIC__
|
||||||
CFLAGS += -m64
|
KBUILD_CFLAGS += -m64
|
||||||
AFLAGS += -m64
|
AFLAGS += -m64
|
||||||
UTS_MACHINE := s390x
|
UTS_MACHINE := s390x
|
||||||
STACK_SIZE := 16384
|
STACK_SIZE := 16384
|
||||||
|
@ -77,8 +77,8 @@ cflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
|
||||||
cflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
|
cflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += -mbackchain -msoft-float $(cflags-y)
|
KBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y)
|
||||||
CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
|
KBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
|
||||||
AFLAGS += $(aflags-y)
|
AFLAGS += $(aflags-y)
|
||||||
|
|
||||||
OBJCOPYFLAGS := -O binary
|
OBJCOPYFLAGS := -O binary
|
||||||
|
|
|
@ -91,12 +91,12 @@ LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4'
|
||||||
LDFLAGS += -EB
|
LDFLAGS += -EB
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += -pipe $(cflags-y)
|
KBUILD_CFLAGS += -pipe $(cflags-y)
|
||||||
AFLAGS += $(cflags-y)
|
AFLAGS += $(cflags-y)
|
||||||
|
|
||||||
head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
|
head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
|
||||||
|
|
||||||
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||||
|
|
||||||
core-y += arch/sh/kernel/ arch/sh/mm/
|
core-y += arch/sh/kernel/ arch/sh/mm/
|
||||||
core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
|
core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
|
||||||
|
|
|
@ -21,7 +21,7 @@ IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
|
||||||
$(CONFIG_MEMORY_START) + \
|
$(CONFIG_MEMORY_START) + \
|
||||||
$(CONFIG_BOOT_LINK_OFFSET)]')
|
$(CONFIG_BOOT_LINK_OFFSET)]')
|
||||||
|
|
||||||
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||||
|
|
||||||
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds
|
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ LDFLAGS += -EB -mshelf32_linux
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# No requirements for endianess support from AFLAGS, 'as' always run through gcc
|
# No requirements for endianess support from AFLAGS, 'as' always run through gcc
|
||||||
CFLAGS += $(cpu-y)
|
KBUILD_CFLAGS += $(cpu-y)
|
||||||
|
|
||||||
LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \
|
LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \
|
||||||
--defsym phys_stext_shmedia=phys_stext+1 \
|
--defsym phys_stext_shmedia=phys_stext+1 \
|
||||||
|
@ -57,7 +57,7 @@ ifneq ($(machine-y),)
|
||||||
core-y += arch/sh64/mach-$(machine-y)/
|
core-y += arch/sh64/mach-$(machine-y)/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||||
libs-y += arch/$(ARCH)/lib/ $(LIBGCC)
|
libs-y += arch/$(ARCH)/lib/ $(LIBGCC)
|
||||||
|
|
||||||
drivers-$(CONFIG_OPROFILE) += arch/sh64/oprofile/
|
drivers-$(CONFIG_OPROFILE) += arch/sh64/oprofile/
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Uncomment the first CFLAGS if you are doing kgdb source level
|
# Uncomment the first KBUILD_CFLAGS if you are doing kgdb source level
|
||||||
# debugging of the kernel to get the proper debugging information.
|
# debugging of the kernel to get the proper debugging information.
|
||||||
|
|
||||||
AS := $(AS) -32
|
AS := $(AS) -32
|
||||||
LDFLAGS := -m elf32_sparc
|
LDFLAGS := -m elf32_sparc
|
||||||
CHECKFLAGS += -D__sparc__
|
CHECKFLAGS += -D__sparc__
|
||||||
|
|
||||||
#CFLAGS := $(CFLAGS) -g -pipe -fcall-used-g5 -fcall-used-g7
|
#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
|
||||||
CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
|
KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
|
||||||
AFLAGS := $(AFLAGS) -m32
|
AFLAGS := $(AFLAGS) -m32
|
||||||
|
|
||||||
#LDFLAGS_vmlinux = -N -Ttext 0xf0004000
|
#LDFLAGS_vmlinux = -N -Ttext 0xf0004000
|
||||||
|
|
|
@ -39,17 +39,17 @@ AS := $(AS) --undeclared-regs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(NEW_GCC),y)
|
ifneq ($(NEW_GCC),y)
|
||||||
CFLAGS := $(CFLAGS) -pipe -mno-fpu -mtune=ultrasparc -mmedlow \
|
KBUILD_CFLAGS += -pipe -mno-fpu -mtune=ultrasparc -mmedlow \
|
||||||
-ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
|
-ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
|
||||||
else
|
else
|
||||||
CFLAGS := $(CFLAGS) -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
|
KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
|
||||||
-ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
|
-ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
|
||||||
$(CC_UNDECL)
|
$(CC_UNDECL)
|
||||||
AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL)
|
AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_MCOUNT),y)
|
ifeq ($(CONFIG_MCOUNT),y)
|
||||||
CFLAGS := $(CFLAGS) -pg
|
KBUILD_CFLAGS += -pg
|
||||||
endif
|
endif
|
||||||
|
|
||||||
head-y := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o
|
head-y := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o
|
||||||
|
|
|
@ -58,14 +58,14 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
|
||||||
#
|
#
|
||||||
# These apply to USER_CFLAGS to.
|
# These apply to USER_CFLAGS to.
|
||||||
|
|
||||||
CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
|
KBUILD_CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
|
||||||
$(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
|
$(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
|
||||||
-Din6addr_loopback=kernel_in6addr_loopback
|
-Din6addr_loopback=kernel_in6addr_loopback
|
||||||
|
|
||||||
AFLAGS += $(ARCH_INCLUDE)
|
AFLAGS += $(ARCH_INCLUDE)
|
||||||
|
|
||||||
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
|
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
|
||||||
$(patsubst -I%,,$(CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
|
$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
|
||||||
-D_FILE_OFFSET_BITS=64
|
-D_FILE_OFFSET_BITS=64
|
||||||
|
|
||||||
include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
|
include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
|
||||||
|
@ -75,14 +75,14 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
|
||||||
|
|
||||||
# -Derrno=kernel_errno - This turns all kernel references to errno into
|
# -Derrno=kernel_errno - This turns all kernel references to errno into
|
||||||
# kernel_errno to separate them from the libc errno. This allows -fno-common
|
# kernel_errno to separate them from the libc errno. This allows -fno-common
|
||||||
# in CFLAGS. Otherwise, it would cause ld to complain about the two different
|
# in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different
|
||||||
# errnos.
|
# errnos.
|
||||||
# These apply to kernelspace only.
|
# These apply to kernelspace only.
|
||||||
|
|
||||||
KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
|
KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
|
||||||
-Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)
|
-Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)
|
||||||
CFLAGS += $(KERNEL_DEFINES)
|
KBUILD_CFLAGS += $(KERNEL_DEFINES)
|
||||||
CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
|
KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
|
||||||
|
|
||||||
# These are needed for clean and mrproper, since in that case .config is not
|
# These are needed for clean and mrproper, since in that case .config is not
|
||||||
# included; the values here are meaningless
|
# included; the values here are meaningless
|
||||||
|
|
|
@ -15,7 +15,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S
|
||||||
|
|
||||||
ifeq ("$(origin SUBARCH)", "command line")
|
ifeq ("$(origin SUBARCH)", "command line")
|
||||||
ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
|
ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
|
||||||
CFLAGS += $(call cc-option,-m32)
|
KBUILD_CFLAGS += $(call cc-option,-m32)
|
||||||
AFLAGS += $(call cc-option,-m32)
|
AFLAGS += $(call cc-option,-m32)
|
||||||
LINK-y += $(call cc-option,-m32)
|
LINK-y += $(call cc-option,-m32)
|
||||||
UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
|
UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
|
||||||
|
@ -36,4 +36,4 @@ cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
|
||||||
# an unresolved reference.
|
# an unresolved reference.
|
||||||
cflags-y += -ffreestanding
|
cflags-y += -ffreestanding
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
|
|
|
@ -5,4 +5,4 @@
|
||||||
|
|
||||||
# To get a definition of F_SETSIG
|
# To get a definition of F_SETSIG
|
||||||
USER_CFLAGS += -D_GNU_SOURCE -D_LARGEFILE64_SOURCE
|
USER_CFLAGS += -D_GNU_SOURCE -D_LARGEFILE64_SOURCE
|
||||||
CFLAGS += -D_LARGEFILE64_SOURCE
|
KBUILD_CFLAGS += -D_LARGEFILE64_SOURCE
|
||||||
|
|
|
@ -9,7 +9,7 @@ _extra_flags_ = -fno-builtin -m64
|
||||||
#We #undef __x86_64__ for kernelspace, not for userspace where
|
#We #undef __x86_64__ for kernelspace, not for userspace where
|
||||||
#it's needed for headers to work!
|
#it's needed for headers to work!
|
||||||
ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
|
ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
|
||||||
CFLAGS += $(_extra_flags_)
|
KBUILD_CFLAGS += $(_extra_flags_)
|
||||||
|
|
||||||
CHECKFLAGS += -m64
|
CHECKFLAGS += -m64
|
||||||
AFLAGS += -m64
|
AFLAGS += -m64
|
||||||
|
|
|
@ -17,7 +17,7 @@ ubd-objs := ubd_kern.o ubd_user.o
|
||||||
port-objs := port_kern.o port_user.o
|
port-objs := port_kern.o port_user.o
|
||||||
harddog-objs := harddog_kern.o harddog_user.o
|
harddog-objs := harddog_kern.o harddog_user.o
|
||||||
|
|
||||||
LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a)
|
LDFLAGS_pcap.o := -r $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a)
|
||||||
|
|
||||||
targets := pcap_kern.o pcap_user.o
|
targets := pcap_kern.o pcap_user.o
|
||||||
|
|
||||||
|
|
|
@ -20,4 +20,4 @@ CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)
|
||||||
|
|
||||||
include arch/um/scripts/Makefile.rules
|
include arch/um/scripts/Makefile.rules
|
||||||
|
|
||||||
$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS))
|
$(obj)/unmap.%: _c_flags = $(call unprofile,$(KBUILD_CFLAGS))
|
||||||
|
|
|
@ -28,4 +28,4 @@ CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)
|
||||||
|
|
||||||
include arch/um/scripts/Makefile.rules
|
include arch/um/scripts/Makefile.rules
|
||||||
|
|
||||||
$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS))
|
$(obj)/unmap.%: _c_flags = $(call unprofile,$(KBUILD_CFLAGS))
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
arch_dir = arch/v850
|
arch_dir = arch/v850
|
||||||
|
|
||||||
CFLAGS += -mv850e
|
KBUILD_CFLAGS += -mv850e
|
||||||
# r16 is a fixed pointer to the current task
|
# r16 is a fixed pointer to the current task
|
||||||
CFLAGS += -ffixed-r16 -mno-prolog-function
|
KBUILD_CFLAGS += -ffixed-r16 -mno-prolog-function
|
||||||
CFLAGS += -fno-builtin
|
KBUILD_CFLAGS += -fno-builtin
|
||||||
CFLAGS += -D__linux__ -DUTS_SYSNAME=\"uClinux\"
|
KBUILD_CFLAGS += -D__linux__ -DUTS_SYSNAME=\"uClinux\"
|
||||||
|
|
||||||
# By default, build a kernel that runs on the gdb v850 simulator.
|
# By default, build a kernel that runs on the gdb v850 simulator.
|
||||||
KBUILD_DEFCONFIG := sim_defconfig
|
KBUILD_DEFCONFIG := sim_defconfig
|
||||||
|
|
|
@ -50,7 +50,7 @@ HOSTCFLAGS_build.o := $(LINUXINCLUDE)
|
||||||
# that way we can complain to the user if the CPU is insufficient.
|
# that way we can complain to the user if the CPU is insufficient.
|
||||||
cflags-i386 :=
|
cflags-i386 :=
|
||||||
cflags-x86_64 := -m32
|
cflags-x86_64 := -m32
|
||||||
CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
|
KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
|
||||||
$(cflags-$(ARCH)) \
|
$(cflags-$(ARCH)) \
|
||||||
-Wall -Wstrict-prototypes \
|
-Wall -Wstrict-prototypes \
|
||||||
-march=i386 -mregparm=3 \
|
-march=i386 -mregparm=3 \
|
||||||
|
@ -61,7 +61,7 @@ CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
|
||||||
$(call cc-option, -fno-unit-at-a-time)) \
|
$(call cc-option, -fno-unit-at-a-time)) \
|
||||||
$(call cc-option, -fno-stack-protector) \
|
$(call cc-option, -fno-stack-protector) \
|
||||||
$(call cc-option, -mpreferred-stack-boundary=2)
|
$(call cc-option, -mpreferred-stack-boundary=2)
|
||||||
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
|
AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
||||||
|
|
||||||
$(obj)/zImage: IMAGE_OFFSET := 0x1000
|
$(obj)/zImage: IMAGE_OFFSET := 0x1000
|
||||||
$(obj)/zImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK)
|
$(obj)/zImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK)
|
||||||
|
|
|
@ -11,7 +11,7 @@ EXTRA_AFLAGS := -traditional
|
||||||
LDFLAGS_vmlinux := -T
|
LDFLAGS_vmlinux := -T
|
||||||
hostprogs-y := relocs
|
hostprogs-y := relocs
|
||||||
|
|
||||||
CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
|
KBUILD_CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
|
||||||
-fno-strict-aliasing -fPIC \
|
-fno-strict-aliasing -fPIC \
|
||||||
$(call cc-option,-ffreestanding) \
|
$(call cc-option,-ffreestanding) \
|
||||||
$(call cc-option,-fno-stack-protector)
|
$(call cc-option,-fno-stack-protector)
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
|
|
||||||
targets := vmlinux vmlinux.bin vmlinux.bin.gz head_64.o misc_64.o piggy.o
|
targets := vmlinux vmlinux.bin vmlinux.bin.gz head_64.o misc_64.o piggy.o
|
||||||
|
|
||||||
CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \
|
KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \
|
||||||
-fno-strict-aliasing -fPIC -mcmodel=small \
|
-fno-strict-aliasing -fPIC -mcmodel=small \
|
||||||
$(call cc-option, -ffreestanding) \
|
$(call cc-option, -ffreestanding) \
|
||||||
$(call cc-option, -fno-stack-protector)
|
$(call cc-option, -fno-stack-protector)
|
||||||
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
|
AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
||||||
LDFLAGS := -m elf_x86_64
|
LDFLAGS := -m elf_x86_64
|
||||||
|
|
||||||
LDFLAGS_vmlinux := -T
|
LDFLAGS_vmlinux := -T
|
||||||
|
|
|
@ -34,8 +34,8 @@ $(obj)/vdso.so: $(src)/vdso.lds $(vobjs) FORCE
|
||||||
|
|
||||||
CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64
|
CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64
|
||||||
|
|
||||||
$(obj)/vclock_gettime.o: CFLAGS = $(CFL)
|
$(obj)/vclock_gettime.o: KBUILD_CFLAGS = $(CFL)
|
||||||
$(obj)/vgetcpu.o: CFLAGS = $(CFL)
|
$(obj)/vgetcpu.o: KBUILD_CFLAGS = $(CFL)
|
||||||
|
|
||||||
# We also create a special relocatable object that should mirror the symbol
|
# We also create a special relocatable object that should mirror the symbol
|
||||||
# table and layout of the linked DSO. With ld -R we can then refer to
|
# table and layout of the linked DSO. With ld -R we can then refer to
|
||||||
|
|
|
@ -70,7 +70,7 @@ AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONF
|
||||||
cflags-$(CONFIG_CC_STACKPROTECTOR) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector )
|
cflags-$(CONFIG_CC_STACKPROTECTOR) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector )
|
||||||
cflags-$(CONFIG_CC_STACKPROTECTOR_ALL) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector-all )
|
cflags-$(CONFIG_CC_STACKPROTECTOR_ALL) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector-all )
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
KBUILD_CFLAGS += $(cflags-y)
|
||||||
CFLAGS_KERNEL += $(cflags-kernel-y)
|
CFLAGS_KERNEL += $(cflags-kernel-y)
|
||||||
AFLAGS += -m64
|
AFLAGS += -m64
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,9 @@ PLATFORM = $(platform-y)
|
||||||
export PLATFORM
|
export PLATFORM
|
||||||
|
|
||||||
# temporarily until string.h is fixed
|
# temporarily until string.h is fixed
|
||||||
cflags-y += -ffreestanding
|
KBUILD_CFLAGS += -ffreestanding
|
||||||
|
|
||||||
cflags-y += -pipe -mlongcalls
|
KBUILD_CFLAGS += -pipe -mlongcalls
|
||||||
|
|
||||||
CFLAGS += $(cflags-y)
|
|
||||||
|
|
||||||
KBUILD_DEFCONFIG := iss_defconfig
|
KBUILD_DEFCONFIG := iss_defconfig
|
||||||
|
|
||||||
|
@ -56,7 +54,7 @@ endif
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||||
|
|
||||||
head-y := arch/xtensa/kernel/head.o
|
head-y := arch/xtensa/kernel/head.o
|
||||||
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
|
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
|
||||||
|
|
|
@ -19,7 +19,7 @@ boot-y := bootstrap.o
|
||||||
OBJS := $(addprefix $(obj)/,$(boot-y))
|
OBJS := $(addprefix $(obj)/,$(boot-y))
|
||||||
LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
|
LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
|
||||||
|
|
||||||
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||||
|
|
||||||
zImage: vmlinux $(OBJS) $(LIBS)
|
zImage: vmlinux $(OBJS) $(LIBS)
|
||||||
$(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
|
$(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
|
||||||
|
|
|
@ -30,4 +30,4 @@ $(obj)/version.o: include/linux/compile.h
|
||||||
include/linux/compile.h: FORCE
|
include/linux/compile.h: FORCE
|
||||||
@echo ' CHK $@'
|
@echo ' CHK $@'
|
||||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
|
||||||
"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(CFLAGS)"
|
"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
|
||||||
|
|
|
@ -75,7 +75,7 @@ try-run = $(shell set -e; \
|
||||||
# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
|
# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
|
||||||
|
|
||||||
as-option = $(call try-run,\
|
as-option = $(call try-run,\
|
||||||
$(CC) $(CFLAGS) $(1) -c -xassembler /dev/null -o "$$TMP",$(1),$(2))
|
$(CC) $(KBUILD_CFLAGS) $(1) -c -xassembler /dev/null -o "$$TMP",$(1),$(2))
|
||||||
|
|
||||||
# as-instr
|
# as-instr
|
||||||
# Usage: cflags-y += $(call as-instr,instr,option1,option2)
|
# Usage: cflags-y += $(call as-instr,instr,option1,option2)
|
||||||
|
@ -87,12 +87,12 @@ as-instr = $(call try-run,\
|
||||||
# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
|
# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
|
||||||
|
|
||||||
cc-option = $(call try-run,\
|
cc-option = $(call try-run,\
|
||||||
$(CC) $(CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",$(1),$(2))
|
$(CC) $(KBUILD_CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",$(1),$(2))
|
||||||
|
|
||||||
# cc-option-yn
|
# cc-option-yn
|
||||||
# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
|
# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
|
||||||
cc-option-yn = $(call try-run,\
|
cc-option-yn = $(call try-run,\
|
||||||
$(CC) $(CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",y,n)
|
$(CC) $(KBUILD_CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",y,n)
|
||||||
|
|
||||||
# cc-option-align
|
# cc-option-align
|
||||||
# Prefix align with either -falign or -malign
|
# Prefix align with either -falign or -malign
|
||||||
|
|
|
@ -84,7 +84,7 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
|
||||||
modname_flags = $(if $(filter 1,$(words $(modname))),\
|
modname_flags = $(if $(filter 1,$(words $(modname))),\
|
||||||
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
|
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
|
||||||
|
|
||||||
_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
|
_c_flags = $(KBUILD_CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
|
||||||
_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
|
_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
|
||||||
_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
|
_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue