Received: by 2002:a17:90a:bc8d:0:0:0:0 with SMTP id x13csp2385705pjr; Tue, 19 May 2020 14:00:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQaXSgMEZ9G1ndviLDZSQNqj+jU5tMdqrjKaWIHgwCZ0KBj2JMwzODImITNsXoUrgyskl4 X-Received: by 2002:a17:906:dbef:: with SMTP id yd15mr988482ejb.5.1589922001828; Tue, 19 May 2020 14:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589922001; cv=none; d=google.com; s=arc-20160816; b=mzi4NT/8C1VzLe9+oNlaiEN6rc3dpUjax+S1D0lP+yWmdD9OgQD3jsIPpL4mMnJFvr rwjmdAqaceBSza+oYist+D3C8wsOdcb7BFs9IloDQGfDKLFSxc6lM8B98tWZ/ku+VLpL qXJTuNr/ExFIlJUUgFqICAjQoVw27IKvmrKBRET8tK6Hdb+I+Dwsv9DGOrHq6r3ehwxC BLtE5fjIwj2WAby89OQtEnKZteve9PG7loNpqDLbIjaAWpvmHPfHgml9p/ymbEZlLu7n JGSytYLRmaSpoXAf2NYRW8perkwF63zhtej0KV5X+tmM6k5tzKOkUfX6ga+RdpnQzQhC uyuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sUppX/TevpI8MeNM7eh5elr+xiLRt/n382EauWEH9rA=; b=TTmTxCkpJtz6rTPG7vyqCGzGl61WFKha9neh0CPMQdbMqHNRgHMZMfpCet0z0GsbqC vH9lUQghdTrtRtKLaNuex5gJAL9nG63OsybjeECsxIXOtr3nnt8l7IgPkeunzqRtVDM2 itmLeTE+P1MUSVe099BcJ6cx5K55hCZUEyvCld71Xov55K+t+R57+pbIATDKCpumff20 XKBLTa1DsWtu9KQqcRLWp4I8sD4Clt0j7fn6CF4ttQPo8VFfHanvW1BOQ5EIEpS0T8BQ yegzL9KZH9kAYrCom7lhYDEDXpntFZ8gORL06sPkG5rrc4r6/zTdrNVMkbiNww4488+X 7Pdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nh7si588321ejb.182.2020.05.19.13.59.32; Tue, 19 May 2020 14:00:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbgESUzz (ORCPT + 99 others); Tue, 19 May 2020 16:55:55 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:40869 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbgESUzz (ORCPT ); Tue, 19 May 2020 16:55:55 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 19 May 2020 13:55:52 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.200.192.41]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 6EE55404B7; Tue, 19 May 2020 13:55:54 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Julien Thierry , Miroslav Benes , Steven Rostedt , Matt Helsley Subject: [PATCH 0/3] Enable objtool multiarch build Date: Tue, 19 May 2020 13:55:30 -0700 Message-ID: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII Received-SPF: None (EX13-EDG-OU-002.vmware.com: mhelsley@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As a necessary first step to adding new architecture and subcommand support to objtool enabling building of objtool for more than the x86 architecture. Some folks have been working on enabling objtool checking functionality for arm64. Rather than repeat that work here this minimal set does not port the existing commands but replaces them with weak, not-implemented versions which exit with status 127. On x86 the check and orc subcommands will still build and operate correctly while on other architectures the commands will exit with status 127. This allows future changes to port the check command to arm64 or add new subcommands such as mcount to replace the separate recordmcount tool. Since the series does not add support for stack validation or checking to any new architectures there's no reason to make KConfig or Makefile changes which would normally be used to test this. So I've been forcing builds of objtool with: make O=build-foo ARCH=foo CROSS_COMPILE=foo-linux-gnu- defconfig make O=build-foo ARCH=foo CROSS_COMPILE=foo-linux-gnu- tools/objtool And running the resulting binary to verify that it shows all objtoo subcommands are supported on x86 and unsupported on other archs. Changes since RFC[1]: - Removed the arch/missing pattern and put everything in weak.c (Julien Thierry and Josh Poimboeuf) - Kept arch.h, special, etc. in the top level objtool dir (Julien) - Dropped the patch reporting which subcommands are missing in --help output - Postponed the rela patch Josh asked to rename a bunch of these variables and suggested an untested improvement. Since they're necessary for recordmcount but not the current arch built support we can drop them from this set. - Misc: Removed else (Josh) and updated the commit messages (Julien) - Cleaned up includes Moved the prototypes for the command entry functions and other functions that weak symbols need to be consistent with into objtool.h. (Josh) Tested with cross-compilation for sparc, arm64, s390, and powerpc [1] https://lore.kernel.org/lkml/cover.1588888003.git.mhelsley@vmware.com/ Matt Helsley (3): objtool: Exit successfully when requesting help objtool: Move struct objtool_file into arch-independent header objtool: Enable compilation of objtool for all architectures tools/objtool/Build | 13 +++++++++---- tools/objtool/Makefile | 11 ++++++++++- tools/objtool/arch.h | 4 +++- tools/objtool/builtin-check.c | 2 +- tools/objtool/builtin-orc.c | 3 +-- tools/objtool/check.c | 4 ++-- tools/objtool/check.h | 12 ------------ tools/objtool/objtool.c | 4 +++- tools/objtool/objtool.h | 34 ++++++++++++++++++++++++++++++++++ tools/objtool/orc.h | 18 ------------------ tools/objtool/orc_dump.c | 3 ++- tools/objtool/orc_gen.c | 1 - tools/objtool/weak.c | 35 +++++++++++++++++++++++++++++++++++ 13 files changed, 100 insertions(+), 44 deletions(-) create mode 100644 tools/objtool/objtool.h delete mode 100644 tools/objtool/orc.h create mode 100644 tools/objtool/weak.c base-commit: bba413deb1065f1291cb1f366247513f11215520 -- 2.20.1