Skip to contentSkip to conversation

powerpc64 powerpc64le: add support

PATCH New Cody P Schafer 2 participants 8 messages May 11, 2014 – May 12, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 powerpc64 powerpc64le: add support

This enables powerpc64 and powerpc64le. Currently, le needs at least glibc 2.19 and gcc 4.9.0. For gdb, 7.7.1 works (added in a later patch).

This also provides a helper config to replace the ad-hoc altivec logic.

---

Since v1:
- remove altivec from generic + 64bit (power4 & 5 break that)
- filter ppc64le first.
- SPE config is a bool.

 Makefile                                    |  4 +-
 arch/Config.in                              | 21 +++++++-
 arch/Config.in.powerpc                      | 76 ++++++++++++++++++++++++++---
 linux/Config.in                             |  5 +-
 package/Makefile.in                         |  2 +-
 package/efl/libevas/libevas.mk              |  2 +-
 package/ffmpeg/ffmpeg.mk                    |  5 +-
 package/glibc/Config.in                     |  3 +-
 package/gstreamer/gst-ffmpeg/gst-ffmpeg.mk  |  5 +-
 package/gstreamer1/gst1-libav/gst1-libav.mk |  5 +-
 package/libatomic_ops/Config.in             |  2 +-
 package/mpg123/mpg123.mk                    |  4 +-
 package/openssl/openssl.mk                  |  6 +++
 package/systemd/Config.in                   |  3 +-
 package/vlc/vlc.mk                          |  3 +-
 toolchain/toolchain-buildroot/Config.in     |  5 +-
 16 files changed, 117 insertions(+), 34 deletions(-)
Makefile +3 -1
index 2f18aab..924de93 100644
@@ -38,7 +38,8 @@ export HOSTARCH := $(shell uname -m | \
 	    -e s/sun4u/sparc64/ \
 	    -e s/arm.*/arm/ \
 	    -e s/sa110/arm/ \
-	    -e s/ppc64/powerpc/ \
+	    -e s/ppc64le/powerpc64le/ \
+	    -e s/ppc64/powerpc64/ \
 	    -e s/ppc/powerpc/ \
 	    -e s/macppc/powerpc/\
 	    -e s/sh.*/sh/)
@@ -310,6 +311,7 @@ KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
 	-e s/aarch64/arm64/ \
 	-e s/bfin/blackfin/ \
 	-e s/parisc64/parisc/ \
+	-e s/powerpc64le/powerpc/ \
 	-e s/powerpc64/powerpc/ \
 	-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
 	-e s/sh.*/sh/ \
arch/Config.in +20 -1
index bc81dac..819823c 100644
@@ -140,6 +140,25 @@ config BR2_powerpc
 	bool "PowerPC"
 	help
 	  PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
+	  Big endian.
+	  http://www.power.org/
+	  http://en.wikipedia.org/wiki/Powerpc
+
+config BR2_powerpc64
+	bool "PowerPC 64"
+	select BR2_ARCH_IS_64
+	help
+	  PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
+	  Big endian.
+	  http://www.power.org/
+	  http://en.wikipedia.org/wiki/Powerpc
+
+config BR2_powerpc64le
+	bool "PowerPC 64 (Little endian)"
+	select BR2_ARCH_IS_64
+	help
+	  PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
+	  Little endian.
 	  http://www.power.org/
 	  http://en.wikipedia.org/wiki/Powerpc
 
@@ -321,7 +340,7 @@ if BR2_nios2
 source "arch/Config.in.nios2"
 endif
 
-if BR2_powerpc
+if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
 source "arch/Config.in.powerpc"
 endif
 
arch/Config.in.powerpc +70 -6

175 lines not on this page · raw message

linux/Config.in +3 -2
index 77c28f3..0bd1c9e 100644
@@ -183,8 +183,9 @@ config BR2_LINUX_KERNEL_BZIMAGE
 
 config BR2_LINUX_KERNEL_ZIMAGE
 	bool "zImage"
-	depends on BR2_arm || BR2_armeb || BR2_powerpc || BR2_sparc || \
-		   BR2_sh || BR2_sh64 || BR2_xtensa
+	depends on BR2_arm || BR2_armeb || \
+		   BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \
+		   BR2_sparc || BR2_sh || BR2_sh64 || BR2_xtensa
 
 config BR2_LINUX_KERNEL_APPENDED_ZIMAGE
 	bool "zImage with appended DT"
package/Makefile.in +1 -1
index 2fc3aa7..0233506 100644
@@ -321,7 +321,7 @@ endif
 ifeq ($(BR2_m68k),y)
 BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
 endif
-ifeq ($(BR2_powerpc)$(BR2_ENDIAN),yBIG)
+ifeq ($(BR2_powerpc)$(BR2_powerpc64)$(BR2_powerpc64le),y)
 BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
 endif
 
package/efl/libevas/libevas.mk +1 -1
index 41ceb49..71f1aeb 100644
@@ -136,7 +136,7 @@ else
 LIBEVAS_CONF_OPT += --disable-cpu-sse3
 endif
 
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
 LIBEVAS_CONF_OPT += --enable-cpu-altivec
 else
 LIBEVAS_CONF_OPT += --disable-cpu-altivec
package/ffmpeg/ffmpeg.mk +1 -4
index f8c1526..b14f678 100644
@@ -299,14 +299,11 @@ FFMPEG_CONF_OPT += \
 	--disable-mipsdspr2
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc),y)
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
 FFMPEG_CONF_OPT += --enable-altivec
 else
 FFMPEG_CONF_OPT += --disable-altivec
 endif
-endif
 
 ifeq ($(BR2_PREFER_STATIC_LIB),)
 FFMPEG_CONF_OPT += --enable-pic
package/glibc/Config.in +2 -1
index 693a33e..c20d9e1 100644
@@ -8,7 +8,8 @@ choice
 		   BR2_i386   || BR2_mips     || BR2_mipsel  || \
 		   BR2_mips64 || BR2_mips64el || BR2_powerpc || \
 		   BR2_sh     || BR2_sh64     || BR2_sparc   || \
-		   BR2_x86_64 || BR2_microblaze
+		   BR2_x86_64 || BR2_microblaze || BR2_powerpc64 || \
+		   BR2_powerpc64le
 
 config BR2_GLIBC_VERSION_2_18
        bool "2.18"
package/gstreamer/gst-ffmpeg/gst-ffmpeg.mk +1 -4
index f18ab18..5c4b754 100644
@@ -63,14 +63,11 @@ ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
 GST_FFMPEG_CONF_EXTRA_OPT += --enable-neon
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc),y)
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
 GST_FFMPEG_CONF_EXTRA_OPT += --enable-altivec
 else
 GST_FFMPEG_CONF_EXTRA_OPT += --disable-altivec
 endif
-endif
 
 ifeq ($(BR2_PREFER_STATIC_LIB),)
 GST_FFMPEG_CONF_EXTRA_OPT += --enable-pic
package/gstreamer1/gst1-libav/gst1-libav.mk +1 -4
index 7a0182e..f84bcb2 100644
@@ -71,14 +71,11 @@ else
 GST1_LIBAV_CONF_EXTRA_OPT += --disable-vfp
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc),y)
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HASH_ALTIVEC),y)
 GST1_LIBAV_CONF_EXTRA_OPT += --enable-altivec
 else
 GST1_LIBAV_CONF_EXTRA_OPT += --disable-altivec
 endif
-endif
 
 GST1_LIBAV_CONF_OPT = \
 	--with-libav-extra-configure="$(GST1_LIBAV_CONF_EXTRA_OPT)"
package/libatomic_ops/Config.in +1 -1
index f0a55a4..fe1efd4 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS
 	bool
-	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_powerpc || BR2_x86_64
+	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64
 
 config BR2_PACKAGE_LIBATOMIC_OPS
 	bool "libatomic_ops"
package/mpg123/mpg123.mk +1 -3
index a950813..d66592c 100644
@@ -22,14 +22,12 @@ ifeq ($(BR2_i386),y)
 MPG123_CPU = x86
 endif
 
-ifeq ($(BR2_powerpc),y)
-ifneq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
 MPG123_CPU = altivec
 endif
 ifeq ($(BR2_SOFT_FLOAT),y)
 MPG123_CPU = ppc_nofpu
 endif
-endif
 
 ifeq ($(BR2_x86_64),y)
 MPG123_CPU = x86-64
package/openssl/openssl.mk +6 -0
index 52abb46..87bc2ef 100644
@@ -42,6 +42,12 @@ ifeq ($(BR2_powerpc_401)$(BR2_powerpc_403)$(BR2_powerpc_405)$(BR2_powerpc_405fp)
 	OPENSSL_TARGET_ARCH = ppc
 endif
 endif
+ifeq ($(ARCH),powerpc64)
+	OPENSSL_TARGET_ARCH = ppc64
+endif
+ifeq ($(ARCH),powerpc64le)
+	OPENSSL_TARGET_ARCH = ppc64le
+endif
 ifeq ($(ARCH),x86_64)
 	OPENSSL_TARGET_ARCH = x86_64
 endif
package/systemd/Config.in +2 -1
index f10637a..05f4680 100644
@@ -2,7 +2,8 @@ config BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS
 	bool
 	# see src/shared/architecture.h
 	default y if BR2_arm || BR2_armeb || BR2_i386 || BR2_mips || \
-		BR2_mipsel || BR2_powerpc || BR2_sh4 || BR2_sh4eb || \
+		BR2_mipsel || BR2_powerpc || BR2_powerpc64 || \
+		BR2_powerpc64le  || BR2_sh4 || BR2_sh4eb || \
 		BR2_sh4a || BR2_sh4aeb || BR2_sparc || BR2_x86_64 || \
 		BR2_aarch64 || BR2_m68k
 
package/vlc/vlc.mk +1 -2
index e14c9c3..6eb7eea 100644
@@ -49,8 +49,7 @@ ifeq ($(BR2_PREFER_STATIC_LIB),)
 VLC_CONF_OPT += --disable-static
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
 VCL_CONF_OPT += --enable-altivec
 else
 VLC_CONF_OPT += --disable-altivec
toolchain/toolchain-buildroot/Config.in +3 -2
index 216f9db..91ff705 100644
@@ -45,7 +45,7 @@ config BR2_TOOLCHAIN_BUILDROOT_EGLIBC
 		   BR2_i386   || BR2_mips     || BR2_mipsel  || \
 		   BR2_mips64 || BR2_mips64el || BR2_powerpc || \
 		   BR2_sh     || BR2_sh64     || BR2_sparc   || \
-		   BR2_x86_64 || BR2_microblaze
+		   BR2_x86_64 || BR2_microblaze || BR2_powerpc64
 	depends on BR2_USE_MMU
 	depends on !BR2_PREFER_STATIC_LIB
 	select BR2_TOOLCHAIN_USES_GLIBC
@@ -63,7 +63,8 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 		   BR2_i386   || BR2_mips     || BR2_mipsel  || \
 		   BR2_mips64 || BR2_mips64el || BR2_powerpc || \
 		   BR2_sh     || BR2_sh64     || BR2_sparc   || \
-		   BR2_x86_64 || BR2_microblaze
+		   BR2_x86_64 || BR2_microblaze || BR2_powerpc64 || \
+		   BR2_powerpc64le
 	depends on BR2_USE_MMU
 	depends on !BR2_PREFER_STATIC_LIB
 	select BR2_TOOLCHAIN_USES_GLIBC
Signature · 1 line
1.9.3
#1 lore raw

PATCH v2 2/2 package/gdb: add gdb 7.7.1

---
 package/gdb/Config.in.host | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
package/gdb/Config.in.host +7 -2
index e853469..77c5459 100644
@@ -19,7 +19,7 @@ choice
 	depends on !BR2_microblaze
 	default BR2_GDB_VERSION_6_6 if BR2_bfin
 	default BR2_GDB_VERSION_6_7_1_AVR32_2_1_5 if BR2_avr32
-	default BR2_GDB_VERSION_7_5
+	default BR2_GDB_VERSION_7_7
 	help
 	  Select the version of gdb you wish to use.
 
@@ -39,6 +39,10 @@ choice
 		bool "gdb 7.5.x"
 		depends on !BR2_bfin
 
+	config BR2_GDB_VERSION_7_7
+		bool "gdb 7.7.x"
+		depends on !BR2_bfin
+
 endchoice
 
 endif
@@ -54,4 +58,5 @@ config BR2_GDB_VERSION
 	default "arc-4.8-R3" if BR2_arc
 	default "6be65fb56ea6694a9260733a536a023a1e2d4d57" if BR2_microblaze
 	default "7.4.1"    if BR2_GDB_VERSION_7_4
-	default "7.5.1"    if BR2_GDB_VERSION_7_5 || !BR2_PACKAGE_HOST_GDB
+	default "7.5.1"    if BR2_GDB_VERSION_7_5
+	default "7.7.1"    if BR2_GDB_VERSION_7_7 || !BR2_PACKAGE_HOST_GDB
Signature · 1 line
1.9.3
#2 lore raw

PATCH v2 2/2 package/gdb: add gdb 7.7.1

Dear Cody P Schafer,

I had a fairly similar patch sitting in my patch stack.

package/gdb/Config.in.host choice · line 22

Quoted 10 lines · Cody P Schafer
package/gdb/Config.in.host +1 -1
index e853469..77c5459 100644
@@ -19,7 +19,7 @@ choice
 	depends on !BR2_microblaze
 	default BR2_GDB_VERSION_6_6 if BR2_bfin
 	default BR2_GDB_VERSION_6_7_1_AVR32_2_1_5 if BR2_avr32
-	default BR2_GDB_VERSION_7_5
+	default BR2_GDB_VERSION_7_7

I'm not sure we want to jump straight to 7.7 for all architectures. We're usually a bit conservative with regard to the version of toolchain components. So I'd suggest instead to add 7.6 and 7.7. Make 7.6 the new default for all architectures except PPC64, and make 7.6 unavailable for PPC64, and therefore select 7.7 for PPC64. Of course, all older gdb versions should be unavailable for PPC64.

Speaking of component versions, your PATCH 1/2 indicates that gcc 4.9 and glibc 2.19 are needed for PPC64. Can you make sure that the relevant toolchain component versions dependencies are added, so that users can't select a too old glibc version, or a too old gcc version?

Another question is: are there some existing, publicly available, pre-built toolchain for PPC64 ?

My last question is: how far goes your interest for PPC64 ? When we start supporting a new architecture in Buildroot, we generally add it in the autobuilders, which means that a significant portion of the Buildroot packages get built against this new architecture. This often raises a number of build failures. Would you be willing to help fixing those? To help doing this, we generally offer to people in charge of a given architecture to receive a daily e-mail listing the build failures that occurred on that architecture. A good thing is that this helps the persons maintaining this infrastructure notice which userspace packages need to be taken care of.

Thanks a lot again for your contribution, really nice!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 2/2 package/gdb: add gdb 7.7.1

Quoted 15 lines · Thomas Petazzoni

Dear Cody P Schafer,

I had a fairly similar patch sitting in my patch stack.

Quoted 9 lines · Cody P Schafer
package/gdb/Config.in.host +0 -1
index e853469..77c5459 100644
@@ -19,7 +19,7 @@ choice
  	depends on !BR2_microblaze
  	default BR2_GDB_VERSION_6_6 if BR2_bfin
  	default BR2_GDB_VERSION_6_7_1_AVR32_2_1_5 if BR2_avr32
-	default BR2_GDB_VERSION_7_5
Quoted 8 lines

package/gdb/Config.in.host choice · line 22

Quoted 1 line
package/gdb/Config.in.host +1 -0
+	default BR2_GDB_VERSION_7_7

I'm not sure we want to jump straight to 7.7 for all architectures. We're usually a bit conservative with regard to the version of toolchain components. So I'd suggest instead to add 7.6 and 7.7. Make 7.6 the new default for all architectures except PPC64, and make 7.6 unavailable for PPC64, and therefore select 7.7 for PPC64. Of course, all older gdb versions should be unavailable for PPC64.

So long as s/PPC64/PPC64le/, sure.

Quoted 4 lines

Speaking of component versions, your PATCH 1/2 indicates that gcc 4.9 and glibc 2.19 are needed for PPC64. Can you make sure that the relevant toolchain component versions dependencies are added, so that users can't select a too old glibc version, or a too old gcc version?

Will do.

Quoted 2 lines

Another question is: are there some existing, publicly available, pre-built toolchain for PPC64 ?

https://www.kernel.org/pub/tools/crosstool/ has a ppc64 one (without a libc). I'm not aware of one shipping with a libc.
I don't know of any ppc64le prebuilt toolchains.

Quoted 10 lines

My last question is: how far goes your interest for PPC64 ? When we start supporting a new architecture in Buildroot, we generally add it in the autobuilders, which means that a significant portion of the Buildroot packages get built against this new architecture. This often raises a number of build failures. Would you be willing to help fixing those? To help doing this, we generally offer to people in charge of a given architecture to receive a daily e-mail listing the build failures that occurred on that architecture. A good thing is that this helps the persons maintaining this infrastructure notice which userspace packages need to be taken care of.

I'm really only doing this because I end up using buildroot to build netboot images to test kernel changes I make on real hardware. It's entirely a yak shaving project to me.

That said, I'm fine with getting emails, but can't promise anything about actually helping fix things.

#4 lore raw

PATCH v2 2/2 package/gdb: add gdb 7.7.1

Dear Cody P Schafer,

Quoted 8 lines · Cody P Schafer
Quoted 6 lines

I'm not sure we want to jump straight to 7.7 for all architectures. We're usually a bit conservative with regard to the version of toolchain components. So I'd suggest instead to add 7.6 and 7.7. Make 7.6 the new default for all architectures except PPC64, and make 7.6 unavailable for PPC64, and therefore select 7.7 for PPC64. Of course, all older gdb versions should be unavailable for PPC64.

So long as s/PPC64/PPC64le/, sure.

Right. I guess PPC64 (big endian) has been supported since a long time, is this correct?

Quoted 5 lines
Quoted 2 lines

Another question is: are there some existing, publicly available, pre-built toolchain for PPC64 ?

https://www.kernel.org/pub/tools/crosstool/ has a ppc64 one (without a libc). I'm not aware of one shipping with a libc.

Toolchains without a libc are not very useful in the context of Buildroot.

Quoted 1 line

I don't know of any ppc64le prebuilt toolchains.

Ok, no problem :)

Quoted 11 lines
Quoted 10 lines

My last question is: how far goes your interest for PPC64 ? When we start supporting a new architecture in Buildroot, we generally add it in the autobuilders, which means that a significant portion of the Buildroot packages get built against this new architecture. This often raises a number of build failures. Would you be willing to help fixing those? To help doing this, we generally offer to people in charge of a given architecture to receive a daily e-mail listing the build failures that occurred on that architecture. A good thing is that this helps the persons maintaining this infrastructure notice which userspace packages need to be taken care of.

Quoted 6 lines

I'm really only doing this because I end up using buildroot to build netboot images to test kernel changes I make on real hardware. It's entirely a yak shaving project to me.

That said, I'm fine with getting emails, but can't promise anything about actually helping fix things.

No problem, that's fine: it's a best effort thing. It's just that when we support an architecture in Buildroot, we would like to have a fairly decent support. It really isn't nice if we pretend to support a given architecture, and in fact things quickly fall apart when a new user comes in and tries to build a given configuration of packages for this architecture.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH v2 2/2 package/gdb: add gdb 7.7.1

Quoted 11 lines · Thomas Petazzoni

Dear Cody P Schafer,

Quoted 7 lines · Cody P Schafer
Quoted 6 lines

I'm not sure we want to jump straight to 7.7 for all architectures. We're usually a bit conservative with regard to the version of toolchain components. So I'd suggest instead to add 7.6 and 7.7. Make 7.6 the new default for all architectures except PPC64, and make 7.6 unavailable for PPC64, and therefore select 7.7 for PPC64. Of course, all older gdb versions should be unavailable for PPC64.

Quoted 4 lines
Quoted 1 line

So long as s/PPC64/PPC64le/, sure.

Right. I guess PPC64 (big endian) has been supported since a long time, is this correct?

Yep, ppc64 (big endian) has been around and supported in gcc/glibc/gdb for quite a while now (looks like the first gdb support landed in 2007).

#6 lore raw

PATCH v2 1/2 powerpc64 powerpc64le: add support

In reply to Cody P Schafer

Dear Cody P Schafer,

Thanks a lot for this contribution! Really nice to see Buildroot being used on other architectures.

Quoted 6 lines · Cody P Schafer

This enables powerpc64 and powerpc64le. Currently, le needs at least glibc 2.19 and gcc 4.9.0. For gdb, 7.7.1 works (added in a later patch).

This also provides a helper config to replace the ad-hoc altivec logic.

Generally speaking, I believe it would be nice if this patch could be split into smaller patches. This would also ease their way for merging. I'll try to suggest approaches to split it up while reviewing it, below.

arch/Config.in config BR2_powerpc · line 148

Quoted 2 lines
arch/Config.in +2 -0
+config BR2_powerpc64
+	bool "PowerPC 64"

Maybe:

bool "PowerPC 64 (big endian)"

arch/Config.in config BR2_powerpc · line 157

Quoted 9 lines
arch/Config.in +9 -0
+	select BR2_ARCH_IS_64
+	help
+	  PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
+	  Big endian.
+	  http://www.power.org/
+	  http://en.wikipedia.org/wiki/Powerpc
+
+config BR2_powerpc64le
+	bool "PowerPC 64 (Little endian)"

Lowercase "little", to be consistent with what we do for ARM or ARC for example.

Quoted 21 lines
arch/Config.in +5 -1
+	select BR2_ARCH_IS_64
+	help
+	  PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
+	  Little endian.
 	  http://www.power.org/
 	  http://en.wikipedia.org/wiki/Powerpc
@@ -321,7 +340,7 @@ if BR2_nios2
 source "arch/Config.in.nios2"
 endif
 
-if BR2_powerpc
+if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
 source "arch/Config.in.powerpc"
 endif
 
arch/Config.in.powerpc +0 -0
index ae70a8a..386cab1 100644

arch/Config.in.powerpc line 2

Quoted 2 lines
arch/Config.in.powerpc +2 -0
@@ -1,6 +1,15 @@
+config BR2_POWERPC_CPU_HAS_ALTIVEC
+	bool

One blank line between the two definitions would be nice.

arch/Config.in.powerpc line 8

Quoted 6 lines
arch/Config.in.powerpc +6 -0
+config BR2_POWERPC_CPU_HAS_SPE
+	bool
+
+config BR2_POWERPC
+	bool
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le

I see what you want to do, but I'm not a big fan of just using a case difference between BR2_POWERPC and BR2_powerpc. Unfortunately, I don't really have a great proposal to make here. One possibility would be to rename the current BR2_powerpc to BR2_powerpcbe, and then use BR2_powerpc64be instead of BR2_powerpc64. Then BR2_powerpc would be available as a common option for all PowerPC architectures. But that requires a fairly significant rename, so before implementing it, I'd suggest you wait a bit to see if there's a consensus around this proposal or not.

In any case, introducing this common BR2_POWERPC or BR2_powerpc option could be done as a separate, preliminary patch. This way, a good number of the package related changes to use BR2_POWERPC could be made before introducing the PPC64 support.

arch/Config.in.powerpc line 12

Quoted 4 lines
arch/Config.in.powerpc +1 -1
 choice
 	prompt "Target Architecture Variant"
-	depends on BR2_powerpc
+	depends on BR2_POWERPC

Not your fault, but since the file containing this is only included when BR2_powerpc is defined, I'm not sure to see why we have this 'depends on' here.

Quoted 93 lines
arch/Config.in.powerpc +30 -0
 	default BR2_generic_powerpc
 	help
 	  Specific CPU variant to use
@@ -8,84 +17,131 @@ config BR2_generic_powerpc
 	bool "generic"
 config BR2_powerpc_401
 	bool "401"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_403
 	bool "403"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_405
 	bool "405"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_405fp
 	bool "405 with FPU"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_440
 	bool "440"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_440fp
 	bool "440 with FPU"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_464
 	bool "464"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_464fp
 	bool "464 with FPU"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_476
 	bool "476"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_476fp
 	bool "476 with FPU"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_505
 	bool "505"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_601
 	bool "601"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_602
 	bool "602"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_603
 	bool "603"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_603e
 	bool "603e"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_604
 	bool "604"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_604e
 	bool "604e"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_620
 	bool "620"
 config BR2_powerpc_630
 	bool "630"
 config BR2_powerpc_740
 	bool "740"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_7400
 	bool "7400"
+	select BR2_POWERPC_CPU_HAS_ALTIVEC
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_7450
 	bool "7450"
+	select BR2_POWERPC_CPU_HAS_ALTIVEC
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_750
 	bool "750"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_821
 	bool "821"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_823
 	bool "823"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_860
 	bool "860"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_970
 	bool "970"
+	select BR2_POWERPC_CPU_HAS_ALTIVEC
 config BR2_powerpc_8540
 	bool "8540 / e500v1"
+	depends on !BR2_ARCH_IS_64
+	select BR2_POWERPC_CPU_HAS_SPE
 config BR2_powerpc_8548
 	bool "8548 / e500v2"
+	depends on !BR2_ARCH_IS_64

arch/Config.in.powerpc config BR2_generic_powerpc · line 115

Quoted 10 lines
arch/Config.in.powerpc +4 -0
+	select BR2_POWERPC_CPU_HAS_SPE
 config BR2_powerpc_e300c2
 	bool "e300c2"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_e300c3
 	bool "e300c3"
+	depends on !BR2_ARCH_IS_64
 config BR2_powerpc_e500mc
 	bool "e500mc"
+	depends on !BR2_ARCH_IS_64

Adding all these BR2_ARCH_IS_64 and CPU_HAS_ALTIVEC dependencies/selections could be done as separate preliminary patches.

arch/Config.in.powerpc config BR2_generic_powerpc · line 128

Quoted 13 lines
arch/Config.in.powerpc +13 -0
+config BR2_powerpc_power4
+	bool "power4"
+config BR2_powerpc_power5
+	bool "power5"
+config BR2_powerpc_power6
+	bool "power6"
+	select BR2_POWERPC_CPU_HAS_ALTIVEC
+config BR2_powerpc_power7
+	bool "power7"
+	select BR2_POWERPC_CPU_HAS_ALTIVEC
+config BR2_powerpc_power8
+	bool "power8"
+	select BR2_POWERPC_CPU_HAS_ALTIVEC

These additions could also be made separately from adding PPC64 support

arch/Config.in.powerpc config BR2_generic_powerpc · line 134

Quoted 8 lines
arch/Config.in.powerpc +2 -2
 endchoice
 
 choice
 	prompt "Target ABI"
-	depends on BR2_powerpc
-	default BR2_powerpc_SPE if BR2_powerpc_8540 || BR2_powerpc_8548
+	depends on BR2_POWERPC
+	default BR2_powerpc_SPE if BR2_POWERPC_CPU_HAS_SPE

This change could be part of the addition of BR2_POWERPC_CPU_HAS_SPE.

arch/Config.in.powerpc config BR2_generic_powerpc · line 141

Quoted 8 lines
arch/Config.in.powerpc +1 -1
 	default BR2_powerpc_CLASSIC
 	help
 	  Application Binary Interface to use
 
 config BR2_powerpc_CLASSIC
 	bool "Classic"
-	depends on !(BR2_powerpc_8540 || BR2_powerpc_8548)
+	depends on !BR2_POWERPC_CPU_HAS_SPE

Ditto.

arch/Config.in.powerpc config BR2_generic_powerpc · line 144

Quoted 4 lines
arch/Config.in.powerpc +1 -1
 config BR2_powerpc_SPE
 	bool "SPE"
-	depends on BR2_powerpc_8540 || BR2_powerpc_8548
+	depends on BR2_POWERPC_CPU_HAS_SPE

Ditto.

Quoted 4 lines
arch/Config.in.powerpc +0 -0
 endchoice
 
 config BR2_POWERPC_SOFT_FLOAT

arch/Config.in.powerpc config BR2_POWERPC_SOFT_FLOAT · line 163

Quoted 10 lines
arch/Config.in.powerpc +4 -1
@@ -99,9 +155,12 @@ config BR2_POWERPC_SOFT_FLOAT
 
 config BR2_ARCH
 	default "powerpc"	if BR2_powerpc
+	default "powerpc64"	if BR2_powerpc64
+	default "powerpc64le"	if BR2_powerpc64le
 
 config BR2_ENDIAN
-	default "BIG"
+	default "BIG" if BR2_powerpc || BR2_powerpc64
+	default "LITTLE" if BR2_powerpc64le

This indeed needs to be kept in the PPC64 addition patch.

Quoted 20 lines
arch/Config.in.powerpc +5 -0
 config BR2_GCC_TARGET_TUNE
 	default "401"		if BR2_powerpc_401
@@ -136,6 +195,11 @@ config BR2_GCC_TARGET_TUNE
 	default "e300c2"	if BR2_powerpc_e300c2
 	default "e300c3"	if BR2_powerpc_e300c3
 	default "e500mc"	if BR2_powerpc_e500mc
+	default "power4"	if BR2_powerpc_power4
+	default "power5"	if BR2_powerpc_power5
+	default "power6"	if BR2_powerpc_power6
+	default "power7"	if BR2_powerpc_power7
+	default "power8"	if BR2_powerpc_power8
 
 config BR2_GCC_TARGET_ABI
 	default "altivec"		if BR2_PPC_ABI_altivec
linux/Config.in +0 -0
index 77c28f3..0bd1c9e 100644

linux/Config.in config BR2_LINUX_KERNEL_BZIMAGE · line 188

Quoted 8 lines
linux/Config.in +3 -2
@@ -183,8 +183,9 @@ config BR2_LINUX_KERNEL_BZIMAGE
 
 config BR2_LINUX_KERNEL_ZIMAGE
 	bool "zImage"
-	depends on BR2_arm || BR2_armeb || BR2_powerpc || BR2_sparc || \
-		   BR2_sh || BR2_sh64 || BR2_xtensa
+	depends on BR2_arm || BR2_armeb || \
+		   BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \
+		   BR2_sparc || BR2_sh || BR2_sh64 || BR2_xtensa

Any reason not to use the BR2_POWERPC common option here? And it could be part of a separate patch, before PPC64 support is introduced.

package/Makefile.in endif · line 324

Quoted 13 lines
linux/Config.in +0 -0
 config BR2_LINUX_KERNEL_APPENDED_ZIMAGE
 	bool "zImage with appended DT"
package/Makefile.in +1 -1
index 2fc3aa7..0233506 100644
@@ -321,7 +321,7 @@ endif
 ifeq ($(BR2_m68k),y)
 BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
 endif
-ifeq ($(BR2_powerpc)$(BR2_ENDIAN),yBIG)
+ifeq ($(BR2_powerpc)$(BR2_powerpc64)$(BR2_powerpc64le),y)

Same here.

package/efl/libevas/libevas.mk else · line 139

Quoted 13 lines
package/Makefile.in +0 -0
 BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
 endif
 
package/efl/libevas/libevas.mk +1 -1
index 41ceb49..71f1aeb 100644
@@ -136,7 +136,7 @@ else
 LIBEVAS_CONF_OPT += --disable-cpu-sse3
 endif
 
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)

Could be part of the patch adding BR2_POWERPC_CPU_HAS_ALTIVEC, separate from the PPC64 addition patch.

Quoted 8 lines
package/efl/libevas/libevas.mk +0 -0
 LIBEVAS_CONF_OPT += --enable-cpu-altivec
 else
 LIBEVAS_CONF_OPT += --disable-cpu-altivec
package/ffmpeg/ffmpeg.mk +0 -0
index f8c1526..b14f678 100644

package/ffmpeg/ffmpeg.mk FFMPEG_CONF_OPT += \ · line 302

Quoted 7 lines
package/ffmpeg/ffmpeg.mk +1 -3
@@ -299,14 +299,11 @@ FFMPEG_CONF_OPT += \
 	--disable-mipsdspr2
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc),y)
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)

Ditto.

Quoted 13 lines
package/ffmpeg/ffmpeg.mk +0 -1
 FFMPEG_CONF_OPT += --enable-altivec
 else
 FFMPEG_CONF_OPT += --disable-altivec
 endif
-endif
 
 ifeq ($(BR2_PREFER_STATIC_LIB),)
 FFMPEG_CONF_OPT += --enable-pic
package/glibc/Config.in +0 -0
index 693a33e..c20d9e1 100644

package/glibc/Config.in choice · line 12

Quoted 6 lines
package/glibc/Config.in +2 -1
@@ -8,7 +8,8 @@ choice
 		   BR2_i386   || BR2_mips     || BR2_mipsel  || \
 		   BR2_mips64 || BR2_mips64el || BR2_powerpc || \
 		   BR2_sh     || BR2_sh64     || BR2_sparc   || \
-		   BR2_x86_64 || BR2_microblaze
+		   BR2_x86_64 || BR2_microblaze || BR2_powerpc64 || \
+		   BR2_powerpc64le

BR2_POWERPC ?

Quoted 8 lines
package/glibc/Config.in +0 -0
 config BR2_GLIBC_VERSION_2_18
        bool "2.18"
package/gstreamer/gst-ffmpeg/gst-ffmpeg.mk +0 -0
index f18ab18..5c4b754 100644

package/gstreamer/gst-ffmpeg/gst-ffmpeg.mk ifeq ($(BR2_ARM_CPU_HAS_NEON),y) · line 66

Quoted 7 lines
package/gstreamer/gst-ffmpeg/gst-ffmpeg.mk +1 -3
@@ -63,14 +63,11 @@ ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
 GST_FFMPEG_CONF_EXTRA_OPT += --enable-neon
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc),y)
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)

Same comment as previously.

Quoted 13 lines
package/gstreamer/gst-ffmpeg/gst-ffmpeg.mk +0 -1
 GST_FFMPEG_CONF_EXTRA_OPT += --enable-altivec
 else
 GST_FFMPEG_CONF_EXTRA_OPT += --disable-altivec
 endif
-endif
 
 ifeq ($(BR2_PREFER_STATIC_LIB),)
 GST_FFMPEG_CONF_EXTRA_OPT += --enable-pic
package/gstreamer1/gst1-libav/gst1-libav.mk +0 -0
index 7a0182e..f84bcb2 100644

package/gstreamer1/gst1-libav/gst1-libav.mk else · line 74

Quoted 7 lines
package/gstreamer1/gst1-libav/gst1-libav.mk +1 -3
@@ -71,14 +71,11 @@ else
 GST1_LIBAV_CONF_EXTRA_OPT += --disable-vfp
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc),y)
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HASH_ALTIVEC),y)

Same.

Quoted 13 lines
package/gstreamer1/gst1-libav/gst1-libav.mk +0 -1
 GST1_LIBAV_CONF_EXTRA_OPT += --enable-altivec
 else
 GST1_LIBAV_CONF_EXTRA_OPT += --disable-altivec
 endif
-endif
 
 GST1_LIBAV_CONF_OPT = \
 	--with-libav-extra-configure="$(GST1_LIBAV_CONF_EXTRA_OPT)"
package/libatomic_ops/Config.in +0 -0
index f0a55a4..fe1efd4 100644

package/libatomic_ops/Config.in line 3

Quoted 4 lines
package/libatomic_ops/Config.in +1 -1
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS
 	bool
-	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_powerpc || BR2_x86_64
+	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64

BR2_POWERPC ? Or maybe you have a good reason to not use this common option anywhere?

Quoted 8 lines
package/libatomic_ops/Config.in +0 -0
 config BR2_PACKAGE_LIBATOMIC_OPS
 	bool "libatomic_ops"
package/mpg123/mpg123.mk +0 -0
index a950813..d66592c 100644

package/mpg123/mpg123.mk ifeq ($(BR2_i386),y) · line 25

Quoted 6 lines
package/mpg123/mpg123.mk +1 -2
@@ -22,14 +22,12 @@ ifeq ($(BR2_i386),y)
 MPG123_CPU = x86
 endif
 
-ifeq ($(BR2_powerpc),y)
-ifneq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)

Same as above regarding Altivec.

Quoted 68 lines
package/mpg123/mpg123.mk +0 -1
 MPG123_CPU = altivec
 endif
 ifeq ($(BR2_SOFT_FLOAT),y)
 MPG123_CPU = ppc_nofpu
 endif
-endif
 
 ifeq ($(BR2_x86_64),y)
 MPG123_CPU = x86-64
package/openssl/openssl.mk +6 -0
index 52abb46..87bc2ef 100644
@@ -42,6 +42,12 @@ ifeq ($(BR2_powerpc_401)$(BR2_powerpc_403)$(BR2_powerpc_405)$(BR2_powerpc_405fp)
 	OPENSSL_TARGET_ARCH = ppc
 endif
 endif
+ifeq ($(ARCH),powerpc64)
+	OPENSSL_TARGET_ARCH = ppc64
+endif
+ifeq ($(ARCH),powerpc64le)
+	OPENSSL_TARGET_ARCH = ppc64le
+endif
 ifeq ($(ARCH),x86_64)
 	OPENSSL_TARGET_ARCH = x86_64
 endif
package/systemd/Config.in +2 -1
index f10637a..05f4680 100644
@@ -2,7 +2,8 @@ config BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS
 	bool
 	# see src/shared/architecture.h
 	default y if BR2_arm || BR2_armeb || BR2_i386 || BR2_mips || \
-		BR2_mipsel || BR2_powerpc || BR2_sh4 || BR2_sh4eb || \
+		BR2_mipsel || BR2_powerpc || BR2_powerpc64 || \
+		BR2_powerpc64le  || BR2_sh4 || BR2_sh4eb || \
 		BR2_sh4a || BR2_sh4aeb || BR2_sparc || BR2_x86_64 || \
 		BR2_aarch64 || BR2_m68k
 
package/vlc/vlc.mk +1 -2
index e14c9c3..6eb7eea 100644
@@ -49,8 +49,7 @@ ifeq ($(BR2_PREFER_STATIC_LIB),)
 VLC_CONF_OPT += --disable-static
 endif
 
-# Set powerpc altivec appropriately
-ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
 VCL_CONF_OPT += --enable-altivec
 else
 VLC_CONF_OPT += --disable-altivec
toolchain/toolchain-buildroot/Config.in +1 -1
index 216f9db..91ff705 100644
@@ -45,7 +45,7 @@ config BR2_TOOLCHAIN_BUILDROOT_EGLIBC
 		   BR2_i386   || BR2_mips     || BR2_mipsel  || \
 		   BR2_mips64 || BR2_mips64el || BR2_powerpc || \
 		   BR2_sh     || BR2_sh64     || BR2_sparc   || \
-		   BR2_x86_64 || BR2_microblaze
+		   BR2_x86_64 || BR2_microblaze || BR2_powerpc64
 	depends on BR2_USE_MMU
 	depends on !BR2_PREFER_STATIC_LIB
 	select BR2_TOOLCHAIN_USES_GLIBC

toolchain/toolchain-buildroot/Config.in config BR2_TOOLCHAIN_BUILDROOT_GLIBC · line 70

Quoted 9 lines
toolchain/toolchain-buildroot/Config.in +2 -1
@@ -63,7 +63,8 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 		   BR2_i386   || BR2_mips     || BR2_mipsel  || \
 		   BR2_mips64 || BR2_mips64el || BR2_powerpc || \
 		   BR2_sh     || BR2_sh64     || BR2_sparc   || \
-		   BR2_x86_64 || BR2_microblaze
+		   BR2_x86_64 || BR2_microblaze || BR2_powerpc64 || \
+		   BR2_powerpc64le
 	depends on BR2_USE_MMU
 	depends on !BR2_PREFER_STATIC_LIB
 	select BR2_TOOLCHAIN_USES_GLIBC

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH v2 1/2 powerpc64 powerpc64le: add support

Quoted 3 lines · Thomas Petazzoni

Generally speaking, I believe it would be nice if this patch could be split into smaller patches. This would also ease their way for merging. I'll try to suggest approaches to split it up while reviewing it, below.

yep, will do.

[...]

Quoted 8 lines

arch/Config.in.powerpc line 8

Quoted 6 lines
arch/Config.in.powerpc +6 -0
+config BR2_POWERPC_CPU_HAS_SPE
+	bool
+
+config BR2_POWERPC
+	bool
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le

I see what you want to do, but I'm not a big fan of just using a case

Quoted 8 lines

difference between BR2_POWERPC and BR2_powerpc. Unfortunately, I don't really have a great proposal to make here. One possibility would be to rename the current BR2_powerpc to BR2_powerpcbe, and then use BR2_powerpc64be instead of BR2_powerpc64. Then BR2_powerpc would be available as a common option for all PowerPC architectures. But that requires a fairly significant rename, so before implementing it, I'd suggest you wait a bit to see if there's a consensus around this proposal or not.

I don't like the BR2_powerpcbe change as it would mean the arch name and config option wouldn't be the same, potentially causing even more confusion than the switched caps mechanism I went with.

Quoted 4 lines

In any case, introducing this common BR2_POWERPC or BR2_powerpc option could be done as a separate, preliminary patch. This way, a good number of the package related changes to use BR2_POWERPC could be made before introducing the PPC64 support.

I avoided using BR2_POWERPC in packages as generally when a new ppc variant is added they'll need to be updated to support it.

Quoted 9 lines

Review

Quoted 4 lines

choice
prompt "Target Architecture Variant"

(quoted diff) +1 -1
-	depends on BR2_powerpc
+	depends on BR2_POWERPC

Not your fault, but since the file containing this is only included when BR2_powerpc is defined, I'm not sure to see why we have this 'depends on' here.

Yep, I'll remove these. This also removes much of the point of BR2_POWERPC, so I think I'll nuke it as well in v2.

[... removed a bunch of acks to your suggestions hidden in a mountain of code ...]