All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Helsley <mhelsley@vmware.com>
To: <linux-kernel@vger.kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Julien Thierry <jthierry@redhat.com>,
	Miroslav Benes <mbenes@suse.cz>,
	Steven Rostedt <rostedt@goodmis.org>,
	Matt Helsley <mhelsley@vmware.com>
Subject: [PATCH 0/3] Enable objtool multiarch build
Date: Tue, 19 May 2020 13:55:30 -0700	[thread overview]
Message-ID: <cover.1589913349.git.mhelsley@vmware.com> (raw)

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


             reply	other threads:[~2020-05-19 20:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 20:55 Matt Helsley [this message]
2020-05-19 20:55 ` [PATCH 1/3] objtool: Exit successfully when requesting help Matt Helsley
2020-05-27 14:44   ` Kamalesh Babulal
2020-05-19 20:55 ` [PATCH 2/3] objtool: Move struct objtool_file into arch-independent header Matt Helsley
2020-05-20  8:04   ` Julien Thierry
2020-05-27 14:43   ` Kamalesh Babulal
2020-05-19 20:55 ` [PATCH 3/3] objtool: Enable compilation of objtool for all architectures Matt Helsley
2020-05-19 21:18   ` Josh Poimboeuf
2020-05-19 21:46     ` Matt Helsley
2020-05-20 14:16       ` Josh Poimboeuf
2020-05-20 16:38         ` Matt Helsley
2020-05-27 14:42         ` Kamalesh Babulal
2020-05-20  8:31   ` Julien Thierry
2020-05-20 16:41     ` Matt Helsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1589913349.git.mhelsley@vmware.com \
    --to=mhelsley@vmware.com \
    --cc=jpoimboe@redhat.com \
    --cc=jthierry@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.