mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris J Arges <chris.j.arges@canonical.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	live-patching@vger.kernel.org, Michal Marek <mmarek@suse.cz>,
	Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>, Pedro Alves <palves@redhat.com>,
	Namhyung Kim <namhyung@gmail.com>,
	Bernd Petrovitsch <bernd@petrovitsch.priv.at>,
	Andrew Morton <akpm@linux-foundation.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Chris Wright <chrisw@sous-sol.org>,
	Alok Kataria <akataria@vmware.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Pavel Machek <pavel@ucw.cz>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	Matt Fleming <matt.fleming@intel.com>
Subject: Re: [PATCH v12 00/21] Compile-time stack metadata validation
Date: Tue, 15 Sep 2015 11:57:00 -0500	[thread overview]
Message-ID: <20150915165659.GA11492@canonical.com> (raw)
In-Reply-To: <cover.1441749989.git.jpoimboe@redhat.com>

I got the following compiler error when building v12 of this patchset:

  DESCEND  stacktool
  CC       stacktool.o
  CC       elf.o
  CC       special.o
  CC       arch/x86/decode.o
  LD       arch/x86/stacktool-in.o
  LD       stacktool-in.o
Warning: stacktool: x86 instruction decoder differs from kernel
  LINK     stacktool
stacktool-in.o: In function `elf_close':
(.text+0xe7c): undefined reference to `elf_end'
stacktool-in.o: In function `elf_open':
(.text+0xec7): undefined reference to `elf_version'
stacktool-in.o: In function `elf_open':
(.text+0xf29): undefined reference to `elf_begin'
stacktool-in.o: In function `elf_open':
(.text+0xf42): undefined reference to `gelf_getehdr'
stacktool-in.o: In function `elf_open':
(.text+0xf59): undefined reference to `elf_getshdrnum'
stacktool-in.o: In function `elf_open':
(.text+0xf6f): undefined reference to `elf_getshdrstrndx'
stacktool-in.o: In function `elf_open':
(.text+0xfc9): undefined reference to `elf_getscn'
stacktool-in.o: In function `elf_open':
(.text+0xfdd): undefined reference to `elf_ndxscn'
stacktool-in.o: In function `elf_open':
(.text+0xff2): undefined reference to `gelf_getshdr'
stacktool-in.o: In function `elf_open':
(.text+0x100e): undefined reference to `elf_strptr'
stacktool-in.o: In function `elf_open':
(.text+0x1029): undefined reference to `elf_getdata'
stacktool-in.o: In function `elf_open':
(.text+0x1101): undefined reference to `elf_nextscn'
stacktool-in.o: In function `elf_open':
(.text+0x119e): undefined reference to `gelf_getsym'
stacktool-in.o: In function `elf_open':
(.text+0x11b8): undefined reference to `elf_strptr'
stacktool-in.o: In function `elf_open':
(.text+0x13d4): undefined reference to `gelf_getrela'
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'stacktool' failed
make[2]: *** [stacktool] Error 1
Makefile:53: recipe for target 'stacktool' failed
make[1]: *** [stacktool] Error 2
Makefile:1502: recipe for target 'tools/stacktool' failed
make: *** [tools/stacktool] Error 2

The patch below addresses this issue for me.

--

>From 9ec5827aa726300394c0155657820f2595008116 Mon Sep 17 00:00:00 2001
From: Chris J Arges <chris.j.arges@canonical.com>
Date: Tue, 15 Sep 2015 16:45:27 +0000
Subject: [PATCH] x86/stacktool: Fix LDFLAGS order in Makefile

When building tools/stacktool I get a compiler error which causes libelf to not
properly link. This patch adjusts the LDFLAG after the object file, which
allows gcc to properly link.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
---
 tools/stacktool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/stacktool/Makefile b/tools/stacktool/Makefile
index 87a3ee0..9f5d2f9 100644
--- a/tools/stacktool/Makefile
+++ b/tools/stacktool/Makefile
@@ -39,7 +39,7 @@ $(STACKTOOL): $(STACKTOOL_IN)
 	diff -I'^#include' arch/x86/insn/inat.h ../../arch/x86/include/asm/inat.h >/dev/null && \
 	diff -I'^#include' arch/x86/insn/inat_types.h ../../arch/x86/include/asm/inat_types.h >/dev/null) \
 	|| echo "Warning: stacktool: x86 instruction decoder differs from kernel" >&2 )) || true
-	$(QUIET_LINK)$(CC) $(LDFLAGS) $(STACKTOOL_IN) -o $@
+	$(QUIET_LINK)$(CC) $(STACKTOOL_IN) $(LDFLAGS) -o $@
 
 clean:
 	$(call QUIET_CLEAN, stacktool) $(RM) $(STACKTOOL)
-- 
2.5.0


  parent reply	other threads:[~2015-09-15 16:57 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 13:21 Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 01/21] tools: Fix formatting of the "make -C tools" help message Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 02/21] x86/asm: Frame pointer macro cleanup Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 03/21] x86/asm: Add C versions of frame pointer macros Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 04/21] x86/stacktool: Compile-time stack metadata validation Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 05/21] x86/stacktool: Add file and directory ignores Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 06/21] x86/stacktool: Add ignore macros Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 07/21] x86/xen: Add stack frame dependency to hypercall inline asm calls Josh Poimboeuf
2015-09-09 13:30   ` David Vrabel
2015-09-09 13:21 ` [PATCH v12 08/21] x86/paravirt: Add stack frame dependency to PVOP " Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 09/21] x86/paravirt: Create a stack frame in PV_CALLEE_SAVE_REGS_THUNK Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 10/21] x86/amd: Set ELF function type for vide() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 11/21] x86/reboot: Add ljmp instructions to stacktool whitelist Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 12/21] x86/xen: Add xen_cpuid() and xen_setup_gdt() to stacktool whitelists Josh Poimboeuf
2015-09-09 13:31   ` David Vrabel
2015-09-09 13:21 ` [PATCH v12 13/21] x86/asm/crypto: Create stack frames in aesni-intel_asm.S Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 14/21] x86/asm/crypto: Move .Lbswap_mask data to .rodata section Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 15/21] x86/asm/crypto: Move jump_table " Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 16/21] x86/asm/crypto: Create stack frames in clmul_ghash_mul/update() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 17/21] x86/asm/entry: Create stack frames in thunk functions Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 18/21] x86/asm/acpi: Create a stack frame in do_suspend_lowlevel() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 19/21] x86/asm: Create stack frames in rwsem functions Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 20/21] x86/asm/efi: Create a stack frame in efi_call() Josh Poimboeuf
2015-09-09 13:22 ` [PATCH v12 21/21] x86/asm/power: Create stack frames in hibernate_asm_64.S Josh Poimboeuf
2015-09-15 16:57 ` Chris J Arges [this message]
2015-09-15 18:11   ` [PATCH v12 00/21] Compile-time stack metadata validation Josh Poimboeuf
2015-09-17 22:14 ` [PATCH 0/3] A few stacktool warning fixes Chris J Arges
2015-09-17 22:14   ` [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm Chris J Arges
2015-09-18 13:57     ` Josh Poimboeuf
2015-09-17 22:14   ` [PATCH 2/3] x86/stacktool: Ignore head_$(BITS) files Chris J Arges
2015-09-18 13:57     ` Josh Poimboeuf
2015-09-17 22:14   ` [PATCH 3/3] kprobes/x86: stacktool: ignore kretprobe_trampoline_holder Chris J Arges
2015-09-18 14:04     ` Josh Poimboeuf

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=20150915165659.GA11492@canonical.com \
    --to=chris.j.arges@canonical.com \
    --cc=akataria@vmware.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=bernd@petrovitsch.priv.at \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=chrisw@sous-sol.org \
    --cc=davem@davemloft.net \
    --cc=david.vrabel@citrix.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=jpoimboe@redhat.com \
    --cc=konrad.wilk@oracle.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@redhat.com \
    --cc=mmarek@suse.cz \
    --cc=namhyung@gmail.com \
    --cc=palves@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome