[gnuradio] Fix building on ARM

Peter Robinson pbrobinson at fedoraproject.org
Wed Apr 18 09:01:02 UTC 2012


commit c82303b59a1d8e0d5731321c5ac7cf4d6ac9e144
Author: Peter Robinson <pbrobinson at gmail.com>
Date:   Wed Apr 18 10:00:58 2012 +0100

    Fix building on ARM

 gnuradio-disable-arm-opt.patch |   59 ++++++++++++++++++++++++++++++++++++++++
 gnuradio.spec                  |   10 +++++-
 2 files changed, 67 insertions(+), 2 deletions(-)
---
diff --git a/gnuradio-disable-arm-opt.patch b/gnuradio-disable-arm-opt.patch
new file mode 100644
index 0000000..de1414f
--- /dev/null
+++ b/gnuradio-disable-arm-opt.patch
@@ -0,0 +1,59 @@
+--- gnuradio-3.5.3/configure.old	2012-04-16 21:05:13.000000000 -0400
++++ gnuradio-3.5.3/configure	2012-04-16 21:06:33.000000000 -0400
+@@ -19521,55 +19521,7 @@
+    x86 | i[3-7]86)	MD_CPU=x86	MD_SUBCPU=x86 ;;
+    x86_64)		MD_CPU=x86	MD_SUBCPU=x86_64 ;;
+    powerpc*)            MD_CPU=powerpc ;;
+-   arm*)
+-
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#ifndef __ARM_ARCH_5__
+-    #error "Not armv5"
+-    #endif
+-
+-int
+-main ()
+-{
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-  is_armv5=yes
+-else
+-  is_armv5=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#ifndef __ARM_ARCH_7A__
+-    #error "Not armv7-a"
+-    #endif
+-
+-int
+-main ()
+-{
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-  is_armv7_a=yes
+-else
+-  is_armv7_a=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-
+-
+-       if test $is_armv5 = yes; then MD_CPU=armv5;
+-       elif test $is_armv7_a = yes; then MD_CPU=armv7_a;
+-       else MD_CPU=generic; fi
+-       ;;
++   arm*)		MD_CPU=generic ;;
+    *)           	MD_CPU=generic ;;
+   esac
+ 
diff --git a/gnuradio.spec b/gnuradio.spec
index 4cfa0ed..71c61bb 100644
--- a/gnuradio.spec
+++ b/gnuradio.spec
@@ -9,7 +9,7 @@
 
 Name:		gnuradio
 Version:	3.5.3
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Software defined radio framework
 
 Group:		Applications/Engineering
@@ -23,7 +23,9 @@ Source0:	http://gnuradio.org/redmine/attachments/download/%{attachment_id}/gnura
 # git archive --format=tar --prefix=%%{name}-%%{version}/ %%{git_commit} | \
 # gzip > ../%%{name}-%%{version}.tar.gz
 
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# we actually disable ARM optimisations so it actually compiles on ARM. The compiler and the 
+# Fedora rpm compiler options do a much better job of sorting this out
+Patch0:		gnuradio-disable-arm-opt.patch
 
 Requires(pre):	shadow-utils
 BuildRequires:	sdcc
@@ -102,6 +104,7 @@ GNU Radio examples
 
 %prep
 %setup -q
+%patch0 -p1 -b .disable-arm-opts
 
 #force regeneration of cached moc output files
 find . -name "*_moc.cc" -exec rm {} \;
@@ -166,6 +169,9 @@ rm -rf %{buildroot}
 %{_datadir}/gnuradio/examples
 
 %changelog
+* Wed Apr 18 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 3.5.3-2
+- Fix building on ARM
+
 * Tue Apr 10 2012 Jaroslav Škarvada <jskarvad at redhat.com> - 3.5.3-1
 - New version
   Resolves: rhbz#810683


More information about the scm-commits mailing list