@@ -233,8 +233,3 @@ KBUILD_VMLINUX_MAIN
All object files for the main part of vmlinux.
KBUILD_VMLINUX_INIT and KBUILD_VMLINUX_MAIN together specify
all the object files used to link vmlinux.
-
-UAPICFLAGS
---------------------------------------------------
-Arch specific flags used when building sample binaries.
-This is usually the machine size (32 versus 64 bit).
@@ -746,7 +746,7 @@ Kbuild support building sample modules and sample binaries.
To build sample modules the existing infrastructure is used, but
to build sample binaries kbuild adds dedicated suppport.
-The sample binaries are build for the same host and bit-size as the kernel.
+The sample binaries are build for the architecture of the build host.
The samples may demonstrate facilities not yet available
in the installed libc therefore they are build so they include
@@ -968,11 +968,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
archprepare: archheaders archscripts prepare1 scripts_basic
-# To build userspace samples the uapi headers needs to be exported
+# To build userspace samples the uapi headers need to be exported for
+# the host architecture
prepare0: archprepare FORCE
$(Q)$(MAKE) $(build)=.
ifdef CONFIG_SAMPLES
- $(Q)$(MAKE) KBUILD_SRC= headers_install
+ $(MAKE) KBUILD_SRC= ARCH=$(SUBARCH) \
+ INSTALL_HDR_PATH=usr/host headers_install
endif
# All the preparing..
@@ -18,7 +18,6 @@ LD_BFD := elf32-s390
LDFLAGS := -m elf_s390
KBUILD_CFLAGS += -m31
KBUILD_AFLAGS += -m31
-UAPICFLAGS += -m31
UTS_MACHINE := s390
STACK_SIZE := 8192
CHECKFLAGS += -D__s390__ -msize-long
@@ -29,7 +28,6 @@ KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_CFLAGS += -m64
KBUILD_AFLAGS += -m64
-UAPICFLAGS += -m64
UTS_MACHINE := s390x
STACK_SIZE := 16384
CHECKFLAGS += -D__s390__ -D__s390x__
@@ -26,7 +26,6 @@ UTS_MACHINE := sparc
KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
KBUILD_AFLAGS += -m32 -Wa,-Av8
-UAPICFLAGS += -m32
else
#####
@@ -43,7 +42,6 @@ KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
KBUILD_CFLAGS += -Wa,--undeclared-regs
KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
-UAPICFLAGS += -m64
ifeq ($(CONFIG_MCOUNT),y)
KBUILD_CFLAGS += -pg
@@ -47,7 +47,6 @@ ifeq ($(CONFIG_X86_32),y)
biarch := $(call cc-option,-m32)
KBUILD_AFLAGS += $(biarch)
KBUILD_CFLAGS += $(biarch)
- UAPICFLAGS += $(biarch)
KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
@@ -80,7 +79,6 @@ else
biarch := -m64
KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
- UAPICFLAGS += -m64
# Don't autogenerate traditional x87, MMX or SSE instructions
KBUILD_CFLAGS += -mno-mmx -mno-sse
@@ -29,8 +29,7 @@ uapi-cmulti := $(addprefix $(obj)/,$(uapi-cmulti))
uapi-cobjs := $(addprefix $(obj)/,$(uapi-cobjs))
# Options to uapicc.
-uapic_flags = -Wp,-MD,$(depfile) -isystem $(INSTALL_HDR_PATH)/include \
- $(UAPICFLAGS) -Wall
+uapic_flags = -Wp,-MD,$(depfile) -isystem usr/host/include $(HOSTCFLAGS)
#####
# Compile uapi programs on the build host
@@ -38,21 +37,21 @@ uapic_flags = -Wp,-MD,$(depfile) -isystem $(INSTALL_HDR_PATH)/include \
# Create executable from a single .c file
# uapi-csingle -> executable
quiet_cmd_uapi-csingle = UAPICC $@
- cmd_uapi-csingle = $(CC) $(uapic_flags) -o $@ $<
+ cmd_uapi-csingle = $(HOSTCC) $(uapic_flags) -o $@ $<
$(uapi-csingle): $(obj)/%: $(src)/%.c FORCE
$(call if_changed_dep,uapi-csingle)
# Create .o file from a single .c file
# uapi-cobjs -> .o
quiet_cmd_uapi-cobjs = UAPICC $@
- cmd_uapi-cobjs = $(CC) $(uapic_flags) -c -o $@ $<
+ cmd_uapi-cobjs = $(HOSTCC) $(uapic_flags) -c -o $@ $<
$(uapi-cobjs): $(obj)/%.o: $(src)/%.c FORCE
$(call if_changed_dep,uapi-cobjs)
# Link an executable based on list of .o files
# uapi-cmulti -> executable
quiet_cmd_uapi-cmulti = UAPILD $@
- cmd_uapi-cmulti = $(CC) -o $@ \
+ cmd_uapi-cmulti = $(HOSTCC) -o $@ \
$(addprefix $(obj)/,$($(@F)-y))
$(uapi-cmulti): $(obj)/%: $(uapi-cobjs) FORCE
$(call if_changed,uapi-cmulti)