← Back to team overview

kicad-developers team mailing list archive

Patch: Fixing a compile error on Power PC

 

I have enabled compilation for PPC64LE, because that was requested by a Fedora user.  KiCAD builds fine for 5.1, but the PPC64 compilation is broken on master.

The attached patch fixes that by reverting a small portion of commit 6cab769f41f.  Basically, on a 64-bit PPC machine, gcc defines both _ARCH_PPC and _ARCH_PPC64, thus commit 6cab769f41f resulted in trying to compile 32-bit PPC assembly code on PPC64.  Also, assuming the assembly worked, we would have wound up with multiple copies of the context code.

	Steve
>From 50cfa7f31eab8a8643dd52682d1e627983c8dbb0 Mon Sep 17 00:00:00 2001
From: "Steven A. Falco" <stevenfalco@xxxxxxxxx>
Date: Sat, 24 Aug 2019 15:13:46 -0400
Subject: [PATCH] Revert part of commit 6cab769f41f

Commit 6cab769f41f breaks compilation on ppc64le, because the gcc
compiler defines both _ARCH_PPC and _ARCH_PPC64.
---
 include/system/libcontext.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/system/libcontext.h b/include/system/libcontext.h
index dfa323dcd..645d38ebb 100644
--- a/include/system/libcontext.h
+++ b/include/system/libcontext.h
@@ -48,8 +48,7 @@
         #ifdef _ARCH_PPC64
             #define LIBCONTEXT_PLATFORM_linux_ppc64
             #define LIBCONTEXT_CALL_CONVENTION
-        #endif
-        #ifdef _ARCH_PPC
+        #elif defined _ARCH_PPC
             #define LIBCONTEXT_PLATFORM_linux_ppc32
             #define LIBCONTEXT_CALL_CONVENTION
         #endif
-- 
2.21.0


Follow ups