diff mbox

[Risu,v2,2/3] configure: Add initial support to PPC64 (big endian)

Message ID 1489084718-15294-3-git-send-email-joserz@linux.vnet.ibm.com
State New
Headers show

Commit Message

Jose Ricardo Ziviani March 9, 2017, 6:38 p.m. UTC
This commit set Makefile to point to ppc64le source for both archs
(ppc64 and ppc64le) because they do the exact same thing. The
difference is in risugen and how the binary is build.

Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
---
 configure | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Peter Maydell March 13, 2017, 11:10 a.m. UTC | #1
On 9 March 2017 at 19:38, Jose Ricardo Ziviani
<joserz@linux.vnet.ibm.com> wrote:
> This commit set Makefile to point to ppc64le source for both archs
> (ppc64 and ppc64le) because they do the exact same thing. The
> difference is in risugen and how the binary is build.

If we're going to share a single set of source files for ppc64le
and ppc64 (which makes sense) then I think we should use ARCH=ppc64
for that, and rename the 'ppc64le' source files to 'ppc64'.

The rest of these patches look OK.

> Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
> ---
>  configure | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/configure b/configure
> index 055e6d6..dd64d8b 100755
> --- a/configure
> +++ b/configure
> @@ -51,11 +51,7 @@ guess_arch() {
>      elif check_define __aarch64__ ; then
>          ARCH="aarch64"
>      elif check_define __powerpc64__ ; then
> -        if check_define __BIG_ENDIAN__; then
> -            ARCH="ppc64"
> -        else
> -            ARCH="ppc64le"
> -        fi
> +        ARCH="ppc64le"
>      else
>          echo "This cpu is not supported by risu. Try -h. " >&2
>          exit 1
> @@ -127,6 +123,9 @@ OBJDUMP="${OBJDUMP-${CROSS_PREFIX}objdump}"
>
>  if test "x${ARCH}" = "x"; then
>      guess_arch
> +elif test "x${ARCH}" = "xppc64"; then
> +    # ppc64 and ppc64le uses the same C source code
> +    ARCH="ppc64le"
>  fi
>
>  generate_makefilein
> --
> 2.7.4
>

Incidentally, maybe we should just drop support for
specifying ARCH= manually to configure. I can't really
see a use case where the auto-detection won't do the
right thing.

thanks
-- PMM
Jose Ricardo Ziviani March 14, 2017, 8:22 p.m. UTC | #2
On Mon, Mar 13, 2017 at 12:10:10PM +0100, Peter Maydell wrote:
> On 9 March 2017 at 19:38, Jose Ricardo Ziviani
> <joserz@linux.vnet.ibm.com> wrote:
> > This commit set Makefile to point to ppc64le source for both archs
> > (ppc64 and ppc64le) because they do the exact same thing. The
> > difference is in risugen and how the binary is build.
> 
> If we're going to share a single set of source files for ppc64le
> and ppc64 (which makes sense) then I think we should use ARCH=ppc64
> for that, and rename the 'ppc64le' source files to 'ppc64'.
> 

Your idea makes more sense. I'll  do that and send another patch
tomorrow morning.

Thank you Peter!

> The rest of these patches look OK.
> 
> > Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
> > ---
> >  configure | 9 ++++-----
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 055e6d6..dd64d8b 100755
> > --- a/configure
> > +++ b/configure
> > @@ -51,11 +51,7 @@ guess_arch() {
> >      elif check_define __aarch64__ ; then
> >          ARCH="aarch64"
> >      elif check_define __powerpc64__ ; then
> > -        if check_define __BIG_ENDIAN__; then
> > -            ARCH="ppc64"
> > -        else
> > -            ARCH="ppc64le"
> > -        fi
> > +        ARCH="ppc64le"
> >      else
> >          echo "This cpu is not supported by risu. Try -h. " >&2
> >          exit 1
> > @@ -127,6 +123,9 @@ OBJDUMP="${OBJDUMP-${CROSS_PREFIX}objdump}"
> >
> >  if test "x${ARCH}" = "x"; then
> >      guess_arch
> > +elif test "x${ARCH}" = "xppc64"; then
> > +    # ppc64 and ppc64le uses the same C source code
> > +    ARCH="ppc64le"
> >  fi
> >
> >  generate_makefilein
> > --
> > 2.7.4
> >
> 
> Incidentally, maybe we should just drop support for
> specifying ARCH= manually to configure. I can't really
> see a use case where the auto-detection won't do the
> right thing.
> 
> thanks
> -- PMM
>
diff mbox

Patch

diff --git a/configure b/configure
index 055e6d6..dd64d8b 100755
--- a/configure
+++ b/configure
@@ -51,11 +51,7 @@  guess_arch() {
     elif check_define __aarch64__ ; then
         ARCH="aarch64"
     elif check_define __powerpc64__ ; then
-        if check_define __BIG_ENDIAN__; then
-            ARCH="ppc64"
-        else
-            ARCH="ppc64le"
-        fi
+        ARCH="ppc64le"
     else
         echo "This cpu is not supported by risu. Try -h. " >&2
         exit 1
@@ -127,6 +123,9 @@  OBJDUMP="${OBJDUMP-${CROSS_PREFIX}objdump}"
 
 if test "x${ARCH}" = "x"; then
     guess_arch
+elif test "x${ARCH}" = "xppc64"; then
+    # ppc64 and ppc64le uses the same C source code
+    ARCH="ppc64le"
 fi
 
 generate_makefilein