linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system
@ 2011-07-11 21:38 David Ahern
  2011-07-15 15:27 ` David Ahern
  2011-07-21 14:30 ` David Ahern
  0 siblings, 2 replies; 5+ messages in thread
From: David Ahern @ 2011-07-11 21:38 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel
  Cc: acme, mingo, peterz, fweisbec, paulus, David Ahern

Builds for 32-bit binaries on a 64-bit host currently fail with the error:

gcc -o /tmp/perf-ppc/bench/mem-memcpy-x86-64-asm.o -c -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wformat-y2k -Wshadow -Winit-self -Wpacked -Wredundant-decls -Wstrict-aliasing=3 -Wswitch-default -Wswitch-enum -Wno-system-headers -Wundef -Wwrite-strings -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wdeclaration-after-statement -m32 -fstack-protector-all -Wstack-protector -Wvolatile-register-var -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Iutil/include -Iarch/x86/include -I/tmp/perf-ppc/ -DLIBELF_NO_MMAP -DDWARF_SUPPORT -DNO_NEWT_SUPPORT -DNO_LIBPERL -DNO_LIBPYTHON -DHAVE_CPLUS_DEMANGLE -DNO_STRLCPY -DARCH_X86_64 bench/mem-memcpy-x86-64-asm.
 S
bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi'
bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs'
bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi'
bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi'
...

The problem is the detection of the host arch without considering passed in
flags. This change fixes 32-bit builds via:

make EXTRA_CFLAGS=-m32 

and 64-bit builds still reference the memcpy_64.S.

Signed-off-by: David Ahern <dsahern@gmail.com>
---
 tools/perf/Makefile |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 940257b..c168366 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -52,7 +52,10 @@ ifeq ($(ARCH),i386)
 endif
 ifeq ($(ARCH),x86_64)
 	ARCH := x86
-	IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
+	IS_X86_64 := 0
+	ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
+		IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
+	endif
 	ifeq (${IS_X86_64}, 1)
 		RAW_ARCH := x86_64
 		ARCH_CFLAGS := -DARCH_X86_64
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system
  2011-07-11 21:38 [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system David Ahern
@ 2011-07-15 15:27 ` David Ahern
  2011-07-15 15:32   ` Frederic Weisbecker
  2011-07-15 15:38   ` Peter Zijlstra
  2011-07-21 14:30 ` David Ahern
  1 sibling, 2 replies; 5+ messages in thread
From: David Ahern @ 2011-07-15 15:27 UTC (permalink / raw)
  To: mingo, fweisbec; +Cc: linux-perf-users, linux-kernel, acme, peterz, paulus

On 07/11/2011 03:38 PM, David Ahern wrote:
> Builds for 32-bit binaries on a 64-bit host currently fail with the error:
> 
> gcc -o /tmp/perf-ppc/bench/mem-memcpy-x86-64-asm.o -c -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wformat-y2k -Wshadow -Winit-self -Wpacked -Wredundant-decls -Wstrict-aliasing=3 -Wswitch-default -Wswitch-enum -Wno-system-headers -Wundef -Wwrite-strings -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wdeclaration-after-statement -m32 -fstack-protector-all -Wstack-protector -Wvolatile-register-var -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Iutil/include -Iarch/x86/include -I/tmp/perf-ppc/ -DLIBELF_NO_MMAP -DDWARF_SUPPORT -DNO_NEWT_SUPPORT -DNO_LIBPERL -DNO_LIBPYTHON -DHAVE_CPLUS_DEMANGLE -DNO_STRLCPY -DARCH_X86_64 bench/mem-memcpy-x86-64-as
 m.S
> bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
> bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi'
> bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs'
> bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi'
> bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi'
> ...
> 
> The problem is the detection of the host arch without considering passed in
> flags. This change fixes 32-bit builds via:
> 
> make EXTRA_CFLAGS=-m32 
> 
> and 64-bit builds still reference the memcpy_64.S.
> 

Fairly trivial change to the Makefile. Any objections? I believe Arnaldo
is out for a few more days and realistically another week to get through
a month's backlog.

David

> Signed-off-by: David Ahern <dsahern@gmail.com>
> ---
>  tools/perf/Makefile |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 940257b..c168366 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -52,7 +52,10 @@ ifeq ($(ARCH),i386)
>  endif
>  ifeq ($(ARCH),x86_64)
>  	ARCH := x86
> -	IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
> +	IS_X86_64 := 0
> +	ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
> +		IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
> +	endif
>  	ifeq (${IS_X86_64}, 1)
>  		RAW_ARCH := x86_64
>  		ARCH_CFLAGS := -DARCH_X86_64

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system
  2011-07-15 15:27 ` David Ahern
@ 2011-07-15 15:32   ` Frederic Weisbecker
  2011-07-15 15:38   ` Peter Zijlstra
  1 sibling, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2011-07-15 15:32 UTC (permalink / raw)
  To: David Ahern, Ingo Molnar
  Cc: linux-perf-users, linux-kernel, acme, peterz, paulus

On Fri, Jul 15, 2011 at 09:27:20AM -0600, David Ahern wrote:
> On 07/11/2011 03:38 PM, David Ahern wrote:
> > Builds for 32-bit binaries on a 64-bit host currently fail with the error:
> > 
> > gcc -o /tmp/perf-ppc/bench/mem-memcpy-x86-64-asm.o -c -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wformat-y2k -Wshadow -Winit-self -Wpacked -Wredundant-decls -Wstrict-aliasing=3 -Wswitch-default -Wswitch-enum -Wno-system-headers -Wundef -Wwrite-strings -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wdeclaration-after-statement -m32 -fstack-protector-all -Wstack-protector -Wvolatile-register-var -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Iutil/include -Iarch/x86/include -I/tmp/perf-ppc/ -DLIBELF_NO_MMAP -DDWARF_SUPPORT -DNO_NEWT_SUPPORT -DNO_LIBPERL -DNO_LIBPYTHON -DHAVE_CPLUS_DEMANGLE -DNO_STRLCPY -DARCH_X86_64 bench/mem-memcpy-x86-64-
 asm.S
> > bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
> > bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi'
> > bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs'
> > bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi'
> > bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi'
> > ...
> > 
> > The problem is the detection of the host arch without considering passed in
> > flags. This change fixes 32-bit builds via:
> > 
> > make EXTRA_CFLAGS=-m32 
> > 
> > and 64-bit builds still reference the memcpy_64.S.
> > 
> 
> Fairly trivial change to the Makefile. Any objections? I believe Arnaldo
> is out for a few more days and realistically another week to get through
> a month's backlog.
> 
> David

Yeah, looks good.

Thanks.

Acked-by: Frederic Weisbecker <fweisbec@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system
  2011-07-15 15:27 ` David Ahern
  2011-07-15 15:32   ` Frederic Weisbecker
@ 2011-07-15 15:38   ` Peter Zijlstra
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2011-07-15 15:38 UTC (permalink / raw)
  To: David Ahern; +Cc: mingo, fweisbec, linux-perf-users, linux-kernel, acme, paulus

On Fri, 2011-07-15 at 09:27 -0600, David Ahern wrote:
> 
> Fairly trivial change to the Makefile. Any objections? I believe Arnaldo
> is out for a few more days and realistically another week to get through
> a month's backlog. 

I took both patches, lets hope Ingo resurfaces soon, otherwise I'll have
to push stuff to Linus directly.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system
  2011-07-11 21:38 [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system David Ahern
  2011-07-15 15:27 ` David Ahern
@ 2011-07-21 14:30 ` David Ahern
  1 sibling, 0 replies; 5+ messages in thread
From: David Ahern @ 2011-07-21 14:30 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-perf-users, linux-kernel, acme, fweisbec, paulus



On 07/11/2011 03:38 PM, David Ahern wrote:
> Builds for 32-bit binaries on a 64-bit host currently fail with the error:
> 
> gcc -o /tmp/perf-ppc/bench/mem-memcpy-x86-64-asm.o -c -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wformat-y2k -Wshadow -Winit-self -Wpacked -Wredundant-decls -Wstrict-aliasing=3 -Wswitch-default -Wswitch-enum -Wno-system-headers -Wundef -Wwrite-strings -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wdeclaration-after-statement -m32 -fstack-protector-all -Wstack-protector -Wvolatile-register-var -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Iutil/include -Iarch/x86/include -I/tmp/perf-ppc/ -DLIBELF_NO_MMAP -DDWARF_SUPPORT -DNO_NEWT_SUPPORT -DNO_LIBPERL -DNO_LIBPYTHON -DHAVE_CPLUS_DEMANGLE -DNO_STRLCPY -DARCH_X86_64 bench/mem-memcpy-x86-64-as
 m.S
> bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
> bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi'
> bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs'
> bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi'
> bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi'
> ...
> 
> The problem is the detection of the host arch without considering passed in
> flags. This change fixes 32-bit builds via:
> 
> make EXTRA_CFLAGS=-m32 
> 
> and 64-bit builds still reference the memcpy_64.S.
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>

This one was missed in the recent commits. It has been acked by Frederic
and Peter made a comment about picking it up. Perhaps coming through his
tree?

Thanks,
David

> ---
>  tools/perf/Makefile |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 940257b..c168366 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -52,7 +52,10 @@ ifeq ($(ARCH),i386)
>  endif
>  ifeq ($(ARCH),x86_64)
>  	ARCH := x86
> -	IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
> +	IS_X86_64 := 0
> +	ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
> +		IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
> +	endif
>  	ifeq (${IS_X86_64}, 1)
>  		RAW_ARCH := x86_64
>  		ARCH_CFLAGS := -DARCH_X86_64

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-21 14:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 21:38 [PATCH] perf tools, x86: fix 32-bit compile on 64-bit system David Ahern
2011-07-15 15:27 ` David Ahern
2011-07-15 15:32   ` Frederic Weisbecker
2011-07-15 15:38   ` Peter Zijlstra
2011-07-21 14:30 ` David Ahern

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).