RFR (M): 8036767 PPC64: Support for little endian execution model

Andrew Hughes gnu.andrew at redhat.com
Fri Feb 27 01:25:02 UTC 2015

----- Original Message -----
> <trimming>
> On 26/02/2015 12:31 PM, David Holmes wrote:
> > On 26/02/2015 2:57 AM, Andrew Hughes wrote:
> >>>>> These are the revised versions of the webrevs:
> >>>>>
> >>>>> http://cr.openjdk.java.net/~andrew/rh1191652/webrev.02/root/
> >>>>> http://cr.openjdk.java.net/~andrew/rh1191652/webrev.02/jdk/
> >>>>> http://cr.openjdk.java.net/~andrew/rh1191652/webrev.02/hotspot/
> >>>>>
> >>>>> (HotSpot is unchanged, dropped the sound changes from JDK)
> >>
> >> Ok if I push the jdk and root parts then? I think someone on the Oracle
> >> HS team (David?) needs to push the HotSpot bit.
> >
> > Best to push it all together I think, which I can do through the hs-rt
> > forest. But first I need to see where things settled with all this :) I
> > was quite confused by some of the initial suggestions. Will try to get
> > to this today.

Well, I'd push it all myself if there weren't still restrictions on pushing
to HotSpot...

> I'm still very confused by these changes and have trouble tracking the
> values of the various "arch" related variables. If I follow this right
> presently the only distinction between ppc64 and ppc64le is the value of
> OPENJDK_TARGET_CPU_ENDIAN. In particular they both use ppc64 as the
> hotspot LIBARCH value and ppc as the ARCH value. (Aside: so ARCH/ppc64
> is either unused or only used by a hotspot-only build?)
> The desired change is that the top-level architecture (VAR_CPU which
> becomes OPENJDK_TARGET_CPU) should now be ppc64le not ppc64, but that
> for hotspot the only difference is LIBARCH becomes ppc64le. So to
> achieve this hotspot-spec.gmk switches ARCH to be ppc64 instead of the
> current ppc; and then hotspot's def.make uses that combined with being
> lttle-endian to reset the LIBARCH to ppc64le.

>From ppc64le. Without the override in hotspot-spec.gmk, the HotSpot build
will get called with ARCH=ppc64le and fail, because make/defs.make will
set SRCARCH to x86

> This all seems very convoluted! Why can you not simply check the value
> of BUILD_ARCH for ppc64 and then check the endianess to redefine
> LIBARCH? That way you don't need to change ARCH as set by hotspot-spec.gmk.

How is this different to what we are doing?

+  # Override LIBARCH for ppc64le
+  ifeq ($(ARCH), ppc64)
+    ifeq ($(OPENJDK_TARGET_CPU_ENDIAN), little)
+      LIBARCH = ppc64le
+    endif
+  endif

Right there; we're checking the endianness to redefine LIBARCH.

> Does "uname -m" return ppc64le ? I'm unclear whether either your
> proposal or mine actually works correctly for a hotspot-only build. But
> maybe we just don't care about builds not done via configure any more.

It does. Different logic is employed for a configure build (which
sets various variables, including ARCH, in hotspot-spec.gmk) and
a HotSpot-only build which just use makefiles. If ARCH is not set
when we get to the HotSpot build, as in the latter, this block
in make/linux/makefiles/defs.make is used:

ifndef ARCH
  ARCH := $(shell uname -m)
  # Fold little endian PowerPC64 into big-endian (if ARCH is set in                                                            
  # hotspot-spec.gmk, this will be done by the configure script).                                                              
  ifeq ($(ARCH),ppc64le)
    ARCH := ppc64

This was added as part of:

8036767: PPC64: Support for little endian execution model

so our addition to hotspot-spec.gmk is just to do the same as this
block for configure builds.

It was unneeded before because configure would just set the arch
to ppc64 for the entire build, not just HotSpot.

> Thanks,
> David
> Given the LIBARCH switcheroo that happens in hotspot/make/def.make, why
> bother also doing the switcheroo in
> <top>/common/autoconf/hotspot-spec.gmk.in when you could just do
> everything in hotspot/make/defs
> > David
> > -----
> >
> >
> >> Thanks,
> >>

Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222

PGP Key: rsa4096/248BDC07 (hkp://keys.gnupg.net)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07

More information about the hotspot-dev mailing list