Support ppc64, ppc64le, s390x in ArchInfo.c

This commit is contained in:
Stuart D. Gathman 2016-12-02 17:39:20 -05:00
parent 982e9e920a
commit 21a248dcb0
2 changed files with 35 additions and 1 deletions

31
cjdns.ppc64.patch Normal file
View File

@ -0,0 +1,31 @@
diff -up ./util/ArchInfo.c.ppc64 ./util/ArchInfo.c
--- ./util/ArchInfo.c.ppc64 2016-10-11 17:39:44.000000000 -0400
+++ ./util/ArchInfo.c 2016-12-02 17:35:50.896575546 -0500
@@ -98,8 +98,15 @@ gcc arch.c
#error unknown endian
#endif
#elif defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || defined(_ARCH_PPC64)
- #define ARCH ArchInfo_AUDIT_ARCH_PPC64
- #define ARCHSTR "ppc64"
+ #if defined(Endian_BIG)
+ #define ARCH ArchInfo_AUDIT_ARCH_PPC64
+ #define ARCHSTR "ppc64"
+ #elif defined(Endian_LITTLE)
+ #define ARCH ArchInfo_AUDIT_ARCH_PPC64LE
+ #define ARCHSTR "ppc64le"
+ #else
+ #error unknown endian
+ #endif
#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || defined(_ARCH_PPC)
#define ARCH ArchInfo_AUDIT_ARCH_PPC
#define ARCHSTR "ppc"
@@ -145,6 +152,9 @@ gcc arch.c
#else
#error unknown bit width
#endif
+#elif defined(__s390x__)
+ #define ARCH ArchInfo_AUDIT_ARCH_S390X
+ #define ARCHSTR "s390x"
#else
#error architecture unknown
#endif

View File

@ -78,7 +78,7 @@ Patch4: cjdns.genconf.patch
Patch5: cjdns.sbin.patch
# Patch make.js to use dynamic nacl library
Patch6: cjdns.dyn.patch
# Patch to use _LINUX_CAPABILITY_3
# Patch to use _LINUX_CAPABILITY_3 (cjdns < 18)
#Patch7: cjdns.cap3.patch
# Patch some source files to ignore selected warnings that break gcc6 builds
Patch8: cjdns.warnings.patch
@ -90,6 +90,8 @@ Patch10: cjdns.tools.patch
Patch11: cjdns.sodium.patch
# Disable WIP subnode code when SUBNODE not enabled
Patch12: cjdns.sign.patch
# Recognize ppc64, ppc64le, and s390x arches
Patch13: cjdns.ppc64.patch
BuildRequires: nodejs, nodejs-ronn
@ -203,6 +205,7 @@ fi
%patch9 -b .man
%patch10 -b .tools
%patch13 -b .ppc64
cp %{SOURCE1} README_Fedora.md