arm64: Set UTS_MACHINE in the Makefile
authorMichal Marek <mmarek@suse.com>
Tue, 30 Aug 2016 08:31:35 +0000 (10:31 +0200)
committerWill Deacon <will.deacon@arm.com>
Wed, 31 Aug 2016 11:31:38 +0000 (12:31 +0100)
The make rpm target depends on proper UTS_MACHINE definition.  Also, use
the variable in arch/arm64/kernel/setup.c, so that it's not accidentally
removed in the future.

Reported-and-tested-by: Fabian Vogt <fvogt@suse.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Makefile
arch/arm64/kernel/Makefile
arch/arm64/kernel/setup.c

index 0b53c752f23f8449659ef521771a04ce25f3cc26..ab51aed6b6c18eb362f8dc65621f932bed0dc7b8 100644 (file)
@@ -46,10 +46,12 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS        += -mbig-endian
 AS             += -EB
 LD             += -EB
+UTS_MACHINE    := aarch64_be
 else
 KBUILD_CPPFLAGS        += -mlittle-endian
 AS             += -EL
 LD             += -EL
+UTS_MACHINE    := aarch64
 endif
 
 CHECKFLAGS     += -D__aarch64__
index 14f7b651c7875adf7fb23acab0a739077b07157c..7d66bbaafc0c1c299cbf9ab109dedc1dbfdf9f7e 100644 (file)
@@ -10,6 +10,8 @@ CFLAGS_REMOVE_ftrace.o = -pg
 CFLAGS_REMOVE_insn.o = -pg
 CFLAGS_REMOVE_return_address.o = -pg
 
+CFLAGS_setup.o = -DUTS_MACHINE='"$(UTS_MACHINE)"'
+
 # Object file lists.
 arm64-obj-y            := debug-monitors.o entry.o irq.o fpsimd.o              \
                           entry-fpsimd.o process.o ptrace.o setup.o signal.o   \
index 514b4e3ba029854ad2081babc2c63512eec11104..f534f492a26874dec5b56e9ab7a6bef17ee08fc3 100644 (file)
@@ -233,7 +233,7 @@ void __init setup_arch(char **cmdline_p)
 {
        pr_info("Boot CPU: AArch64 Processor [%08x]\n", read_cpuid_id());
 
-       sprintf(init_utsname()->machine, ELF_PLATFORM);
+       sprintf(init_utsname()->machine, UTS_MACHINE);
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
        init_mm.end_data   = (unsigned long) _edata;