Skip to contentSkip to conversation

package/uhd: fix build with ARM

PATCH New Gwenhael Goavec-Merou 2 participants 2 messages Oct 30, 2020 – Nov 1, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/uhd: fix build with ARM

From: Gwenhael Goavec-Merou <[email protected]>

UHD has two issues with ARM:
1/ NEON_SIMD_ENABLE is always enabled when architecture is ARM. But NEON isn't
necessarily support in the CPU
2/ when NEON is supported -mfpu=neon must be passed to the compiler (not
automatically done by UHD)

Fixes:
- http://autobuild.buildroot.net/results/2519bd075b8c021b440677297b32f16b1c3cc3dd/
- http://autobuild.buildroot.net/results/99d9979be4f37c42390c87b1afd4cd33bac07f5e/
- http://autobuild.buildroot.net/results/cabc7a87ee869d6bac7d092c1a4fcfcdac22a96e/

---
 package/uhd/uhd.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)
package/uhd/uhd.mk +12 -0
index ec0ec03e9f..17d0dd569b 100644
@@ -38,6 +38,18 @@ UHD_CONF_OPTS = \
 	-DENABLE_UTILS=OFF \
 	-DENABLE_X300=OFF
 
+# As soon as architecture is ARM, uhd will try
+# to use it. But this doesn't necessarily
+# mean we have NEON support in our CPU.
+# When CPU support NEON -mfpu=neon must be added to CXX_FLAGS
+ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
+UHD_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -mfpu=neon"
+UHD_CONF_OPTS += -DNEON_SIMD_ENABLE=ON
+else
+UHD_CONF_OPTS += -Dhave_mfpu_neon=0
+UHD_CONF_OPTS += -DNEON_SIMD_ENABLE=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_ORC),y)
 UHD_DEPENDENCIES += orc
 endif
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/uhd: fix build with ARM

Gwenhael, All,

On 2020-10-30 15:29 +0100, Gwenhael Goavec-Merou spake thusly:

Quoted 8 lines

From: Gwenhael Goavec-Merou <[email protected]>

UHD has two issues with ARM:
1/ NEON_SIMD_ENABLE is always enabled when architecture is ARM. But NEON isn't
necessarily support in the CPU
2/ when NEON is supported -mfpu=neon must be passed to the compiler (not
automatically done by UHD)

Quoted 6 lines

Fixes:
- http://autobuild.buildroot.net/results/2519bd075b8c021b440677297b32f16b1c3cc3dd/
- http://autobuild.buildroot.net/results/99d9979be4f37c42390c87b1afd4cd33bac07f5e/
- http://autobuild.buildroot.net/results/cabc7a87ee869d6bac7d092c1a4fcfcdac22a96e/

Applied to master, thanks (I just slightly reworded the comment).

Regards,
Yann E. MORIN.

Quoted 34 lines
---
 package/uhd/uhd.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)
package/uhd/uhd.mk +12 -0
index ec0ec03e9f..17d0dd569b 100644
@@ -38,6 +38,18 @@ UHD_CONF_OPTS = \
 	-DENABLE_UTILS=OFF \
 	-DENABLE_X300=OFF
 
+# As soon as architecture is ARM, uhd will try
+# to use it. But this doesn't necessarily
+# mean we have NEON support in our CPU.
+# When CPU support NEON -mfpu=neon must be added to CXX_FLAGS
+ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
+UHD_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -mfpu=neon"
+UHD_CONF_OPTS += -DNEON_SIMD_ENABLE=ON
+else
+UHD_CONF_OPTS += -Dhave_mfpu_neon=0
+UHD_CONF_OPTS += -DNEON_SIMD_ENABLE=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_ORC),y)
 UHD_DEPENDENCIES += orc
 endif
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'