* [Buildroot] [PATCH] libmpeg2: add patch to fix build on ARMv7-M
@ 2016-11-05 18:18 Thomas Petazzoni
2016-11-07 22:07 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni @ 2016-11-05 18:18 UTC (permalink / raw)
To: buildroot
This commit adds a patch to libmpeg2 that improves the ARM detection
to not use the optimized ARM code on ARMv7-M architectures.
Fixes:
http://autobuild.buildroot.net/results/9c44de035ce81c6cc8a92ea8bad4def25cd99cd0
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/libmpeg2/0003-fix-arm-detection.patch | 39 +++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 package/libmpeg2/0003-fix-arm-detection.patch
diff --git a/package/libmpeg2/0003-fix-arm-detection.patch b/package/libmpeg2/0003-fix-arm-detection.patch
new file mode 100644
index 0000000..69ec454
--- /dev/null
+++ b/package/libmpeg2/0003-fix-arm-detection.patch
@@ -0,0 +1,39 @@
+Improve the ARM detection to work on Thumb-only architecture
+
+The ARM-specific assembly code doesn't build on Thumb-only
+architectures such as ARMv7-M, but the configure script assumes that
+if the host tuple is arm*, then it can build and use the ARM optimized
+code.
+
+This patch improves the configure.ac detection logic, by building one
+of the instruction of the optimized assembly code, and using this to
+decide whether or not the optimizations should be enabled.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -101,8 +101,10 @@
+ alpha*)
+ AC_DEFINE([ARCH_ALPHA],,[alpha architecture]);;
+ arm*)
+- arm_conditional=:
+- AC_DEFINE([ARCH_ARM],,[ARM architecture]);;
++ AC_TRY_LINK([], [asm(".syntax divided\nstmfd sp!,{r4-r11,lr}")],
++ [AC_DEFINE([ARCH_ARM],,[ARM architecture])
++ use_arm_optimization=yes],
++ [use_arm_optimization=no])
+ esac
+ elif test x"$CC" = x"tendracc"; then
+ dnl TenDRA portability checking compiler
+@@ -122,7 +124,7 @@
+ esac
+ fi
+
+-AM_CONDITIONAL(ARCH_ARM, ${arm_conditional})
++AM_CONDITIONAL(ARCH_ARM, test "${use_arm_optimization}" = "yes")
+
+ dnl Checks for libtool - this must be done after we set cflags
+ AC_LIBTOOL_WIN32_DLL
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] libmpeg2: add patch to fix build on ARMv7-M
2016-11-05 18:18 [Buildroot] [PATCH] libmpeg2: add patch to fix build on ARMv7-M Thomas Petazzoni
@ 2016-11-07 22:07 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-11-07 22:07 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 5 Nov 2016 19:18:50 +0100, Thomas Petazzoni wrote:
> This commit adds a patch to libmpeg2 that improves the ARM detection
> to not use the optimized ARM code on ARMv7-M architectures.
>
> Fixes:
>
> http://autobuild.buildroot.net/results/9c44de035ce81c6cc8a92ea8bad4def25cd99cd0
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> package/libmpeg2/0003-fix-arm-detection.patch | 39 +++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
> create mode 100644 package/libmpeg2/0003-fix-arm-detection.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-07 22:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-05 18:18 [Buildroot] [PATCH] libmpeg2: add patch to fix build on ARMv7-M Thomas Petazzoni
2016-11-07 22:07 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox