Makefile (156ff4a544ae13c5fd6759a09ecb069f7059c1a1) Makefile (83a44a4f47ad20997aebb311fc678a13cde391d7)
1# SPDX-License-Identifier: GPL-2.0
2# Unified Makefile for i386 and x86_64
3
4# select defconfig based on actual architecture
5ifeq ($(ARCH),x86)
6 ifeq ($(shell uname -m),x86_64)
7 KBUILD_DEFCONFIG := x86_64_defconfig
8 else

--- 138 unchanged lines hidden (view full) ---

147 cflags-$(CONFIG_MATOM) += -march=atom
148 cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
149 KBUILD_CFLAGS += $(cflags-y)
150
151 KBUILD_CFLAGS += -mno-red-zone
152 KBUILD_CFLAGS += -mcmodel=kernel
153endif
154
1# SPDX-License-Identifier: GPL-2.0
2# Unified Makefile for i386 and x86_64
3
4# select defconfig based on actual architecture
5ifeq ($(ARCH),x86)
6 ifeq ($(shell uname -m),x86_64)
7 KBUILD_DEFCONFIG := x86_64_defconfig
8 else

--- 138 unchanged lines hidden (view full) ---

147 cflags-$(CONFIG_MATOM) += -march=atom
148 cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
149 KBUILD_CFLAGS += $(cflags-y)
150
151 KBUILD_CFLAGS += -mno-red-zone
152 KBUILD_CFLAGS += -mcmodel=kernel
153endif
154
155ifdef CONFIG_X86_X32
156 x32_ld_ok := $(call try-run,\
157 /bin/echo -e '1: .quad 1b' | \
158 $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" - && \
159 $(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMP.o" && \
160 $(LD) -m elf32_x86_64 "$$TMP.o" -o "$$TMP",y,n)
161 ifeq ($(x32_ld_ok),y)
162 CONFIG_X86_X32_ABI := y
163 KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
164 KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
165 else
166 $(warning CONFIG_X86_X32 enabled but no binutils support)
167 endif
168endif
169export CONFIG_X86_X32_ABI
170
171#
172# If the function graph tracer is used with mcount instead of fentry,
173# '-maccumulate-outgoing-args' is needed to prevent a GCC bug
174# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109)
175#
176ifdef CONFIG_FUNCTION_GRAPH_TRACER
177 ifndef CONFIG_HAVE_FENTRY
178 ACCUMULATE_OUTGOING_ARGS := 1

--- 155 unchanged lines hidden ---
155#
156# If the function graph tracer is used with mcount instead of fentry,
157# '-maccumulate-outgoing-args' is needed to prevent a GCC bug
158# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109)
159#
160ifdef CONFIG_FUNCTION_GRAPH_TRACER
161 ifndef CONFIG_HAVE_FENTRY
162 ACCUMULATE_OUTGOING_ARGS := 1

--- 155 unchanged lines hidden ---