[pjproject: 1/2] Fix ARM endianness issue
Jared Smith
jsmith at fedoraproject.org
Sun Oct 26 16:35:24 UTC 2014
commit 161751c6a182d61a18d0bb9c85f6a347eb082df0
Author: Jared K. Smith <jaredsmith at jaredsmith.net>
Date: Thu Oct 23 08:33:52 2014 -0400
Fix ARM endianness issue
pjproject.spec | 14 +++++++-------
pjproject_fix_arm.patch | 28 ++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 7 deletions(-)
---
diff --git a/pjproject.spec b/pjproject.spec
index a7874a7..29540b4 100644
--- a/pjproject.spec
+++ b/pjproject.spec
@@ -3,7 +3,7 @@
Name: pjproject
Summary: Libraries for building embedded/non-embedded VoIP applications
Version: 2.3
-Release: 3%{?dist}
+Release: 4%{?dist}
Group: System Environment/Libraries
License: GPLv2+
URL: http://www.pjsip.org
@@ -19,6 +19,8 @@ Patch2: pjproject_fix_libyuv.patch
# Keep the .pc file clean
# see https://bugzilla.redhat.com/show_bug.cgi?id=728302#c66
Patch3: pjproject_fixup_pc_file.patch
+# Fix endianness on ARM platforms
+Patch4: pjproject_fix_arm.patch
BuildRequires: alsa-lib-devel
@@ -65,6 +67,7 @@ Header information for:
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
# make sure we don't bundle these third-party libraries
# (They're excluded through ./configure, but this is an
@@ -98,12 +101,6 @@ rm -rf third_party/build/ilbc
# that functionality, and it made it easier to ensure that we don't
# bundle any unnecessary libraries. Please contact me if your project
# needs this support, and I'll re-enable it
-%ifarch x86_64 %{ix86} %{arm} aarch64 ppc64le
-ARCH_FLAGS="$ARCH_FLAGS -DPJ_IS_LITTLE_ENDIAN=1 -DPJ_IS_BIG_ENDIAN=0"
-%else
-ARCH_FLAGS="$ARCH_FLAGS -DPJ_IS_LITTLE_ENDIAN=0 -DPJ_IS_BIG_ENDIAN=1"
-%endif
-
export CFLAGS="-DPJ_HAS_IPV6=1 ${ARCHFLAGS} %{optflags}"
%configure --enable-shared \
--with-external-gsm \
@@ -168,6 +165,9 @@ echo -e '\n' >> %{buildroot}%{_includedir}/pj/config_site.h
%changelog
+* Thu Oct 23 2014 Jared Smith <jsmith at fedoraproject.org> - 2.3-4
+- Fix endianness support on ARM platform
+
* Wed Oct 15 2014 Jared Smith <jsmith at fedoraproject.org> - 2.3-3
- Add IPv6 support
diff --git a/pjproject_fix_arm.patch b/pjproject_fix_arm.patch
new file mode 100644
index 0000000..c054463
--- /dev/null
+++ b/pjproject_fix_arm.patch
@@ -0,0 +1,28 @@
+--- a/pjlib/include/pj/config.h 2014-10-15 09:56:34.510724006 -0600
++++ a/pjlib/include/pj/config.h 2014-10-19 13:46:46.071057753 -0600
+@@ -238,14 +238,22 @@
+ #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) || \
+ defined(ARMV4) || defined(__arm__)
+ /*
+- * ARM, bi-endian, so raise error if endianness is not configured
++ * ARM, bi-endian, so raise error if endianness is not configured or detected
+ */
+ # undef PJ_M_ARMV4
+ # define PJ_M_ARMV4 1
+ # define PJ_M_NAME "armv4"
+ # define PJ_HAS_PENTIUM 0
+ # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
+-# error Endianness must be declared for this processor
++# if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
++# define PJ_IS_LITTLE_ENDIAN 1
++# define PJ_IS_BIG_ENDIAN 0
++# elif (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
++# define PJ_IS_LITTLE_ENDIAN 0
++# define PJ_IS_BIG_ENDIAN 1
++# else
++# error Endianness must be declared for this processor
++# endif
+ # endif
+
+ #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
+
More information about the scm-commits
mailing list