stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Mikulas Patocka <mpatocka@redhat.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Sven Joachim <svenjoac@gmx.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>
Subject: [PATCH 4.14 06/74] objtool: Fix 64-bit build on 32-bit host
Date: Wed, 27 Dec 2017 17:45:39 +0100	[thread overview]
Message-ID: <20171227164614.368465652@linuxfoundation.org> (raw)
In-Reply-To: <20171227164614.109898944@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mikulas Patocka <mpatocka@redhat.com>

commit 14c47b54b0d9389e3ca0718e805cdd90c5a4303a upstream.

The new ORC unwinder breaks the build of a 64-bit kernel on a 32-bit
host.  Building the kernel on a i386 or x32 host fails with:

  orc_dump.c: In function 'orc_dump':
  orc_dump.c:105:26: error: passing argument 2 of 'elf_getshdrnum' from incompatible pointer type [-Werror=incompatible-pointer-types]
    if (elf_getshdrnum(elf, &nr_sections)) {
                            ^
  In file included from /usr/local/include/gelf.h:32:0,
                   from elf.h:22,
                   from warn.h:26,
                   from orc_dump.c:20:
  /usr/local/include/libelf.h:304:12: note: expected 'size_t * {aka unsigned int *}' but argument is of type 'long unsigned int *'
   extern int elf_getshdrnum (Elf *__elf, size_t *__dst);
              ^~~~~~~~~~~~~~
  orc_dump.c:190:17: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'Elf64_Sxword {aka long long int}' [-Werror=format=]
      printf("%s+%lx:", name, rela.r_addend);
                 ~~^          ~~~~~~~~~~~~~
                 %llx

Fix the build failure.

Another problem is that if the user specifies HOSTCC or HOSTLD
variables, they are ignored in the objtool makefile.  Change the
Makefile to respect these variables.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sven Joachim <svenjoac@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 627fce14809b ("objtool: Add ORC unwind table generation")
Link: http://lkml.kernel.org/r/19f0e64d8e07e30a7b307cd010eb780c404fe08d.1512252895.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 tools/objtool/Makefile   |    8 +++++---
 tools/objtool/orc_dump.c |    7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -7,9 +7,11 @@ ARCH := x86
 endif
 
 # always use the host compiler
-CC = gcc
-LD = ld
-AR = ar
+HOSTCC	?= gcc
+HOSTLD	?= ld
+CC	 = $(HOSTCC)
+LD	 = $(HOSTLD)
+AR	 = ar
 
 ifeq ($(srctree),)
 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
--- a/tools/objtool/orc_dump.c
+++ b/tools/objtool/orc_dump.c
@@ -76,7 +76,8 @@ int orc_dump(const char *_objname)
 	int fd, nr_entries, i, *orc_ip = NULL, orc_size = 0;
 	struct orc_entry *orc = NULL;
 	char *name;
-	unsigned long nr_sections, orc_ip_addr = 0;
+	size_t nr_sections;
+	Elf64_Addr orc_ip_addr = 0;
 	size_t shstrtab_idx;
 	Elf *elf;
 	Elf_Scn *scn;
@@ -187,10 +188,10 @@ int orc_dump(const char *_objname)
 				return -1;
 			}
 
-			printf("%s+%lx:", name, rela.r_addend);
+			printf("%s+%llx:", name, (unsigned long long)rela.r_addend);
 
 		} else {
-			printf("%lx:", orc_ip_addr + (i * sizeof(int)) + orc_ip[i]);
+			printf("%llx:", (unsigned long long)(orc_ip_addr + (i * sizeof(int)) + orc_ip[i]));
 		}
 
 

  parent reply	other threads:[~2017-12-27 16:47 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-27 16:45 [PATCH 4.14 00/74] 4.14.10-stable review Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 02/74] objtool: Move synced files to their original relative locations Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 03/74] objtool: Move kernel headers/code sync check to a script Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 04/74] objtool: Fix cross-build Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 05/74] tools/headers: Sync objtool UAPI header Greg Kroah-Hartman
2017-12-27 16:45 ` Greg Kroah-Hartman [this message]
2017-12-27 16:45 ` [PATCH 4.14 07/74] x86/decoder: Fix and update the opcodes map Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 08/74] x86/insn-eval: Add utility functions to get segment selector Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 09/74] x86/Kconfig: Limit NR_CPUS on 32-bit to a sane amount Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 10/74] x86/mm/dump_pagetables: Check PAGE_PRESENT for real Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 11/74] x86/mm/dump_pagetables: Make the address hints correct and readable Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 12/74] x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchy Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 13/74] x86/vsyscall/64: Warn and fail vsyscall emulation in NATIVE mode Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 14/74] arch, mm: Allow arch_dup_mmap() to fail Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 15/74] x86/ldt: Rework locking Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 16/74] x86/ldt: Prevent LDT inheritance on exec Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 17/74] x86/mm/64: Improve the memory map documentation Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 18/74] x86/doc: Remove obvious weirdnesses from the x86 MM layout documentation Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 19/74] x86/entry: Rename SYSENTER_stack to CPU_ENTRY_AREA_entry_stack Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 20/74] x86/uv: Use the right TLB-flush API Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 21/74] x86/microcode: Dont abuse the TLB-flush interface Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 22/74] x86/mm: Use __flush_tlb_one() for kernel memory Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 23/74] x86/mm: Remove superfluous barriers Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 24/74] x86/mm: Add comments to clarify which TLB-flush functions are supposed to flush what Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 25/74] x86/mm: Move the CR3 construction functions to tlbflush.h Greg Kroah-Hartman
2017-12-27 16:45 ` [PATCH 4.14 26/74] x86/mm: Remove hard-coded ASID limit checks Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 27/74] x86/mm: Put MMU to hardware ASID translation in one place Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 28/74] x86/mm: Create asm/invpcid.h Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 29/74] x86/cpu_entry_area: Move it to a separate unit Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 30/74] x86/cpu_entry_area: Move it out of the fixmap Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 31/74] init: Invoke init_espfix_bsp() from mm_init() Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 32/74] x86/cpu_entry_area: Prevent wraparound in setup_cpu_entry_area_ptes() on 32bit Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 33/74] ACPI: APEI / ERST: Fix missing error handling in erst_reader() Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 34/74] acpi, nfit: fix health event notification Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 35/74] crypto: skcipher - set walk.iv for zero-length inputs Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 36/74] crypto: mcryptd - protect the per-CPU queue with a lock Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 37/74] crypto: af_alg - wait for data at beginning of recvmsg Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 38/74] crypto: af_alg - fix race accessing cipher request Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 39/74] mfd: cros ec: spi: Dont send first message too soon Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 40/74] mfd: twl4030-audio: Fix sibling-node lookup Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 41/74] mfd: twl6040: Fix child-node lookup Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 42/74] ALSA: rawmidi: Avoid racy info ioctl via ctl device Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 43/74] ALSA: hda/realtek - Fix Dell AIO LineOut issue Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 44/74] ALSA: hda - Add vendor id for Cannonlake HDMI codec Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 45/74] ALSA: usb-audio: Add native DSD support for Esoteric D-05X Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 46/74] ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 47/74] PCI / PM: Force devices to D0 in pci_pm_thaw_noirq() Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 48/74] block: unalign call_single_data in struct request Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 49/74] block-throttle: avoid double charge Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 50/74] parisc: Align os_hpmc_size on word boundary Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 51/74] parisc: Fix indenting in puts() Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 52/74] parisc: Hide Diva-built-in serial aux and graphics card Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 53/74] Revert "parisc: Re-enable interrupts early" Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 54/74] spi: xilinx: Detect stall with Unknown commands Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 55/74] spi: a3700: Fix clk prescaling for coefficient over 15 Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 56/74] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 57/74] arm64: kvm: Prevent restoring stale PMSCR_EL1 for vcpu Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 58/74] KVM: arm/arm64: Fix HYP unmapping going off limits Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 60/74] KVM: PPC: Book3S HV: Fix pending_pri value in kvmppc_xive_get_icp() Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 63/74] kvm: x86: fix RSM when PCID is non-zero Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 64/74] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 65/74] powerpc/perf: Dereference BHRB entries safely Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 66/74] drm/i915: Flush pending GTT writes before unbinding Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 67/74] drm/sun4i: Fix error path handling Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 68/74] libnvdimm, dax: fix 1GB-aligned namespaces vs physical misalignment Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 69/74] libnvdimm, btt: Fix an incompatibility in the log layout Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 70/74] libnvdimm, pfn: fix start_pad handling for aligned namespaces Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 71/74] net: mvneta: clear interface link status on port disable Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 72/74] net: mvneta: use proper rxq_number in loop on rx queues Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 73/74] net: mvneta: eliminate wrong call to handle rx descriptor error Greg Kroah-Hartman
2017-12-27 16:46 ` [PATCH 4.14 74/74] Revert "ipmi_si: fix memory leak on new_smi" Greg Kroah-Hartman
2017-12-28  5:59 ` [PATCH 4.14 00/74] 4.14.10-stable review Naresh Kamboju
2017-12-29  9:18   ` Greg Kroah-Hartman
2017-12-29 10:35     ` Milosz Wasilewski
2017-12-30 16:53       ` Milosz Wasilewski
2017-12-31 10:15         ` Greg Kroah-Hartman
2018-01-02 10:17           ` Milosz Wasilewski
2017-12-28 15:42 ` Guenter Roeck
2017-12-29  9:18   ` Greg Kroah-Hartman

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=20171227164614.368465652@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=svenjoac@gmx.de \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).