From patchwork Tue Aug 30 14:28:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Marek X-Patchwork-Id: 9305483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFFBE607F0 for ; Tue, 30 Aug 2016 14:31:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0D1D28BF5 for ; Tue, 30 Aug 2016 14:31:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9599C28BF8; Tue, 30 Aug 2016 14:31:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2287E28BF9 for ; Tue, 30 Aug 2016 14:31:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bek2a-0000iu-Rw; Tue, 30 Aug 2016 14:29:28 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bek2V-0000dm-Rp for linux-arm-kernel@lists.infradead.org; Tue, 30 Aug 2016 14:29:25 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B5B56AAC7; Tue, 30 Aug 2016 14:29:00 +0000 (UTC) Received: by sepie.suse.cz (Postfix, from userid 10020) id 7AE0D40933; Tue, 30 Aug 2016 16:28:59 +0200 (CEST) From: Michal Marek To: Catalin Marinas , Will Deacon Subject: [PATCH v2] arm64: Set UTS_MACHINE in the Makefile Date: Tue, 30 Aug 2016 16:28:49 +0200 Message-Id: <1472567329-10254-1-git-send-email-mmarek@suse.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160830_072924_198276_E5F6F73D X-CRM114-Status: GOOD ( 10.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabian Vogt , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP UTS_MACHINE is set to the kbuild architecture name by the main Makefile, and optionally adjusted by the arch Makefiles, so that it holds the architecture name as presented to userspace (uname -m). In particular, the make rpm target relies on proper UTS_MACHINE definition. Do the same in the arm64 Makefile and also, use the variable in arch/arm64/kernel/setup.c, so that it's not accidentally removed in the future. Meanwhile, the make deb-pkg target adapted to the wrong UTS_MACHINE definition, fix that as well. Reported-and-tested-by: Fabian Vogt Signed-off-by: Michal Marek --- v2: Explain the problem more in the changelog and also fix make deb-pkg (thanks to Will Deacon) arch/arm64/Makefile | 2 ++ arch/arm64/kernel/Makefile | 2 ++ arch/arm64/kernel/setup.c | 2 +- scripts/package/builddeb | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 5b54f8c021d8..ab3df36fdfbb 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -38,10 +38,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__ diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 14f7b651c787..7d66bbaafc0c 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -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 \ diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 536dce22fe76..c5dd09778c75 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -228,7 +228,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; diff --git a/scripts/package/builddeb b/scripts/package/builddeb index e1c09e2f9be7..b8900db5115a 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -51,7 +51,7 @@ set_debarch() { debarch=hppa ;; mips*) debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; - arm64) + aarch64*) debarch=arm64 ;; arm*) if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then