Skip to content

Commit

Permalink
kbuild: correct assingment to CFLAGS with CROSS_COMPILE
Browse files Browse the repository at this point in the history
Some architectures change $CC in arch/$(ARCH)/Makefile
mips is one example.

That have impact on what options are supported by gcc so move all
$(call cc-option, ...) after include of arch specific Makefile.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Sam Ravnborg committed Aug 16, 2006
1 parent 9ee4e33 commit c9eca0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,6 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)

CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common
# Force gcc to behave correct even for buggy distributions
CFLAGS += $(call cc-option, -fno-stack-protector)

AFLAGS := -D__ASSEMBLY__

# Read KERNELRELEASE from include/config/kernel.release (if it exists)
Expand Down Expand Up @@ -486,6 +483,8 @@ else
CFLAGS += -O2
endif

include $(srctree)/arch/$(ARCH)/Makefile

ifdef CONFIG_FRAME_POINTER
CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
else
Expand All @@ -500,7 +499,8 @@ ifdef CONFIG_DEBUG_INFO
CFLAGS += -g
endif

include $(srctree)/arch/$(ARCH)/Makefile
# Force gcc to behave correct even for buggy distributions
CFLAGS += $(call cc-option, -fno-stack-protector)

# arch Makefile may override CC so keep this after arch Makefile is included
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
Expand Down

0 comments on commit c9eca0b

Please sign in to comment.