Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1346278 > unrolled thread
| Started by | Stephen Rothwell <sfr@canb.auug.org.au> |
|---|---|
| First post | 2016-03-01 02:30 +0100 |
| Last post | 2016-03-03 09:00 +0100 |
| Articles | 6 on this page of 26 — 6 participants |
Back to article view | Back to linux.kernel
linux-next: build failure after merge of the tip tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-01 02:30 +0100
Re: linux-next: build failure after merge of the tip tree Ingo Molnar <mingo@kernel.org> - 2016-03-01 08:10 +0100
Re: linux-next: build failure after merge of the tip tree Sedat Dilek <sedat.dilek@gmail.com> - 2016-03-01 08:30 +0100
Re: linux-next: build failure after merge of the tip tree "H. Peter Anvin" <hpa@zytor.com> - 2016-03-01 08:50 +0100
Re: linux-next: build failure after merge of the tip tree Sedat Dilek <sedat.dilek@gmail.com> - 2016-03-01 09:50 +0100
Re: linux-next: build failure after merge of the tip tree Ingo Molnar <mingo@kernel.org> - 2016-03-01 10:50 +0100
Re: linux-next: build failure after merge of the tip tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-01 10:50 +0100
[PATCH] objtool: Disable stack validation when CROSS_COMPILE is used Josh Poimboeuf <jpoimboe@redhat.com> - 2016-03-01 23:00 +0100
Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-02 03:30 +0100
Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used Josh Poimboeuf <jpoimboe@redhat.com> - 2016-03-02 22:20 +0100
Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-02 23:30 +0100
[PATCH 0/2] objtool: Cross-compilation support Josh Poimboeuf <jpoimboe@redhat.com> - 2016-03-03 01:50 +0100
[PATCH 1/2] x86/asm/decoder: Use explicitly signed chars Josh Poimboeuf <jpoimboe@redhat.com> - 2016-03-03 01:50 +0100
[tip:core/objtool] x86/asm/decoder: Use explicitly signed chars tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-03-03 18:00 +0100
Re: [tip:core/objtool] x86/asm/decoder: Use explicitly signed chars "H. Peter Anvin" <hpa@zytor.com> - 2016-03-03 20:10 +0100
[PATCH 2/2] objtool: Support CROSS_COMPILE Josh Poimboeuf <jpoimboe@redhat.com> - 2016-03-03 01:50 +0100
Re: [PATCH 2/2] objtool: Support CROSS_COMPILE Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-03 03:50 +0100
Re: [PATCH 2/2] objtool: Support CROSS_COMPILE Josh Poimboeuf <jpoimboe@redhat.com> - 2016-03-03 04:30 +0100
Re: [PATCH 2/2] objtool: Support CROSS_COMPILE Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-03 04:40 +0100
Re: [PATCH 2/2] objtool: Support CROSS_COMPILE Josh Poimboeuf <jpoimboe@redhat.com> - 2016-03-03 04:50 +0100
Re: [PATCH 2/2] objtool: Support CROSS_COMPILE Ingo Molnar <mingo@kernel.org> - 2016-03-03 16:20 +0100
Re: [PATCH 2/2] objtool: Support CROSS_COMPILE Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-04 00:10 +0100
Re: [PATCH 2/2] objtool: Support CROSS_COMPILE "H. Peter Anvin" <hpa@zytor.com> - 2016-03-03 16:30 +0100
[tip:core/objtool] objtool: Support CROSS_COMPILE tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-03-03 18:10 +0100
Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used Sedat Dilek <sedat.dilek@gmail.com> - 2016-03-03 08:40 +0100
Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used Stephen Rothwell <sfr@canb.auug.org.au> - 2016-03-03 09:00 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-03-03 16:20 +0100 |
| Subject | Re: [PATCH 2/2] objtool: Support CROSS_COMPILE |
| Message-ID | <r8DcK-oy-11@gated-at.bofh.it> |
| In reply to | #1348745 |
* Stephen Rothwell <sfr@canb.auug.org.au> wrote: > Hi Josh, > > On Wed, 2 Mar 2016 21:20:58 -0600 Josh Poimboeuf <jpoimboe@redhat.com> wrote: > > > > On Thu, Mar 03, 2016 at 01:43:14PM +1100, Stephen Rothwell wrote: > > > > > > I was wondering if this would be more appropriate in scripts/objtool > > > since it is used during the building of the kernel. Or does it have a > > > wider use? > > > > Yeah, it was actually in the scripts/ dir in earlier revisions of the > > patch set, for that very reason. However, Ingo pointed out that it > > could be useful beyond the kernel, so we graduated it to a "tool". > > > > > > > > We have HOSTCC with its associated HOSTCFLAGS etc ... I am not sure if > > > that is more appropriate (but it does take care of people using clang). > > > > The "tools" are almost completely separate from the rest of the kernel. > > They have their own scaled-down version of kbuild, which doesn't have > > HOSTCC. > > > > But yeah, we might eventually need to copy some of the host compilation > > infrastructure from scripts/Makefile.host over to the tools/ side. > > That all sounds sane, thanks. > > I did not add this to linux-next today, but may tomorrow if people > think it is sensible to do so (for testing on a powerpcle host). If I > do, I will just back out to the previous patch if it all goes south (so > it won't impact on the rest of the tip tree's testing). I'll add Josh's fixes to -tip ASAP as well, so hopefully soon you can drop all linux-next specific patches related to this and it will all work Just Fine (tm). Sorry about the breakage! Thanks, Ingo
[toc] | [prev] | [next] | [standalone]
| From | Stephen Rothwell <sfr@canb.auug.org.au> |
|---|---|
| Date | 2016-03-04 00:10 +0100 |
| Subject | Re: [PATCH 2/2] objtool: Support CROSS_COMPILE |
| Message-ID | <r8Kxz-63E-1@gated-at.bofh.it> |
| In reply to | #1349275 |
Hi Ingo, On Thu, 3 Mar 2016 16:10:21 +0100 Ingo Molnar <mingo@kernel.org> wrote: > > I'll add Josh's fixes to -tip ASAP as well, so hopefully soon you can drop all > linux-next specific patches related to this and it will all work Just Fine (tm). Thanks for that. I have now dropped these patches. > Sorry about the breakage! Hey, it happens .. -- Cheers, Stephen Rothwell
[toc] | [prev] | [next] | [standalone]
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Date | 2016-03-03 16:30 +0100 |
| Subject | Re: [PATCH 2/2] objtool: Support CROSS_COMPILE |
| Message-ID | <r8Dmr-ux-39@gated-at.bofh.it> |
| In reply to | #1348713 |
On March 2, 2016 6:43:14 PM PST, Stephen Rothwell <sfr@canb.auug.org.au> wrote: >Hi Josh, > >Just a couple of quick comments ... > >On Wed, 2 Mar 2016 18:39:37 -0600 Josh Poimboeuf <jpoimboe@redhat.com> >wrote: >> >> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile >> index c4f0713..e4a6bd5 100644 >> --- a/tools/objtool/Makefile >> +++ b/tools/objtool/Makefile > >I was wondering if this would be more appropriate in scripts/objtool >since it is used during the building of the kernel. Or does it have a >wider use? > >> @@ -7,13 +7,19 @@ ARCH := x86 >> endif >> endif >> >> +# always use the host compiler >> +CC = gcc > >We have HOSTCC with its associated HOSTCFLAGS etc ... I am not sure if >that is more appropriate (but it does take care of people using clang). This is what HOSTCC is for. And yes, this belongs in scripts. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Josh Poimboeuf <tipbot@zytor.com> |
|---|---|
| Date | 2016-03-03 18:10 +0100 |
| Subject | [tip:core/objtool] objtool: Support CROSS_COMPILE |
| Message-ID | <r8EVc-1Ta-3@gated-at.bofh.it> |
| In reply to | #1348660 |
Commit-ID: c1d45c3abd49b5bf9447e435099c1b000dcde752
Gitweb: http://git.kernel.org/tip/c1d45c3abd49b5bf9447e435099c1b000dcde752
Author: Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Wed, 2 Mar 2016 18:39:37 -0600
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 3 Mar 2016 16:13:00 +0100
objtool: Support CROSS_COMPILE
When building with CONFIG_STACK_VALIDATION on a ppc64le host with an x86
cross-compiler, Stephen Rothwell saw the following objtool build errors:
DESCEND objtool
CC /home/sfr/next/x86_64_allmodconfig/tools/objtool/builtin-check.o
CC /home/sfr/next/x86_64_allmodconfig/tools/objtool/special.o
CC /home/sfr/next/x86_64_allmodconfig/tools/objtool/elf.o
CC /home/sfr/next/x86_64_allmodconfig/tools/objtool/objtool.o
MKDIR /home/sfr/next/x86_64_allmodconfig/tools/objtool/arch/x86/insn/
CC /home/sfr/next/x86_64_allmodconfig/tools/objtool/libstring.o
elf.c:22:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
CC /home/sfr/next/x86_64_allmodconfig/tools/objtool/exec-cmd.o
CC /home/sfr/next/x86_64_allmodconfig/tools/objtool/help.o
builtin-check.c:28:20: fatal error: string.h: No such file or directory
compilation terminated.
objtool.c:28:19: fatal error: stdio.h: No such file or directory
compilation terminated.
It fails to build because it tries to compile objtool with the
cross-compiler instead of the host compiler.
Ensure that it always uses the host compiler by ignoring CROSS_COMPILE.
In order to do that properly, the libsubcmd.a library needs to be built
in tools/objtool/ rather than tools/lib/subcmd/. The latter directory
contains the cross-compiled version which is needed for perf and
possibly other tools.
Note that cross-compiling for x86 on a _big_ endian system would result
in a bunch of false positive objtool warnings during the kernel build
because it isn't endian-aware. But that's generally a rare edge case
and there haven't been any reports of anybody needing that.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/55b63eefc347f1bb28573f972d8d1adbf1f1c31d.1456962210.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/lib/subcmd/Makefile | 6 ++++--
tools/objtool/Makefile | 17 ++++++++++-------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
index 629cf8c..1faecb8 100644
--- a/tools/lib/subcmd/Makefile
+++ b/tools/lib/subcmd/Makefile
@@ -8,8 +8,10 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif
-CC = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
+CC ?= $(CROSS_COMPILE)gcc
+LD ?= $(CROSS_COMPILE)ld
+AR ?= $(CROSS_COMPILE)ar
+
RM = rm -f
MAKEFLAGS += --no-print-directory
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index c4f0713..e4a6bd5 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -7,13 +7,19 @@ ARCH := x86
endif
endif
+# always use the host compiler
+CC = gcc
+LD = ld
+AR = ar
+
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
-SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/
-LIBSUBCMD = $(if $(OUTPUT),$(OUTPUT),$(SUBCMD_SRCDIR))libsubcmd.a
+SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/
+LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(PWD)/)
+LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a
OBJTOOL := $(OUTPUT)objtool
OBJTOOL_IN := $(OBJTOOL)-in.o
@@ -45,12 +51,9 @@ $(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN)
$(LIBSUBCMD): fixdep FORCE
- $(Q)$(MAKE) -C $(SUBCMD_SRCDIR)
-
-$(LIBSUBCMD)-clean:
- $(Q)$(MAKE) -C $(SUBCMD_SRCDIR) clean > /dev/null
+ $(Q)$(MAKE) -C $(SUBCMD_SRCDIR) OUTPUT=$(LIBSUBCMD_OUTPUT)
-clean: $(LIBSUBCMD)-clean
+clean:
$(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
$(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
$(Q)$(RM) $(OUTPUT)arch/x86/insn/inat-tables.c $(OUTPUT)fixdep
[toc] | [prev] | [next] | [standalone]
| From | Sedat Dilek <sedat.dilek@gmail.com> |
|---|---|
| Date | 2016-03-03 08:40 +0100 |
| Subject | Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used |
| Message-ID | <r8w1z-3Ix-11@gated-at.bofh.it> |
| In reply to | #1347679 |
On 3/2/16, Stephen Rothwell <sfr@canb.auug.org.au> wrote: > Hi Josh, > > On Tue, 1 Mar 2016 15:54:51 -0600 Josh Poimboeuf <jpoimboe@redhat.com> > wrote: >> >> Changing it to use the host compiler would probably be an easy fix, but >> that would expose a harder bug related to endianness. > > Just by luck, my PowerPC host is little endian :-) > >> How about the below workaround patch to disable objtool and warn when >> CROSS_COMPILE is used? If anybody complains about lack of cross-compile >> support later, we could try to fix it then. > > This seems reasonable. > >> From a3c65947011a420743f308b698171c4209105d3f Mon Sep 17 00:00:00 2001 >> Message-Id: >> <a3c65947011a420743f308b698171c4209105d3f.1456868910.git.jpoimboe@redhat.com> >> From: Josh Poimboeuf <jpoimboe@redhat.com> >> Date: Tue, 1 Mar 2016 13:35:51 -0600 >> Subject: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is >> used > > I have applied this to the merge of the tip tree in linux-next today > and it compiles fine for me. I will continue applying it until > something better comes along or it is applied to the tip tree. > Does Linux next-20160303 has this patch? On a quick view I could not find it. - Sedat - > Thanks for that. > -- > Cheers, > Stephen Rothwell > -- > To unsubscribe from this list: send the line "unsubscribe linux-next" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
[toc] | [prev] | [next] | [standalone]
| From | Stephen Rothwell <sfr@canb.auug.org.au> |
|---|---|
| Date | 2016-03-03 09:00 +0100 |
| Subject | Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used |
| Message-ID | <r8wkV-3Pv-5@gated-at.bofh.it> |
| In reply to | #1348832 |
Hi Sedat, On Thu, 3 Mar 2016 08:31:57 +0100 Sedat Dilek <sedat.dilek@gmail.com> wrote: > > Does Linux next-20160303 has this patch? > On a quick view I could not find it. It is applied as part of the merge commit that merges the tip tree, so there is not a separate commit for it. -- Cheers, Stephen Rothwell
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web