Skip to contentSkip to conversation

ne10: bump version to 1.0.0

PATCH New Baruch Siach 4 participants 10 messages Apr 8, 2014 – Apr 13, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

Switch to github helper while at it.

Fixes:
http://autobuild.buildroot.net/results/a2c/a2ca3fe245e410a738f4b10631a1414696a0edea/

---
 ...CMakeLists.txt-add-neon-support-to-CFLAGS.patch | 31 ++++++++++++++++++++++
 package/ne10/ne10.mk                               | 10 +++----
 2 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100644 package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +31 -0
new file mode 100644
index 000000000000..1777de102328
@@ -0,0 +1,31 @@
+From 1ab64866615643d19a8e5c4f1a3f62f1baad6e83 Mon Sep 17 00:00:00 2001
+Message-Id: <1ab64866615643d19a8e5c4f1a3f62f1baad6e83.1396964788.git.baruch@tkos.co.il>
+From: Baruch Siach <[email protected]>
+Date: Tue, 8 Apr 2014 16:40:28 +0300
+Subject: [PATCH] CMakeLists.txt: add neon support to CFLAGS
+
+Fixed build failure:
+
+.../include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e5a98af53c1f..22ce166650da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ if(ANDROID_PLATFORM)
+       add_subdirectory(android/NE10Demo/jni)
+     endif()
+ elseif(GNULINUX_PLATFORM)
+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")
+     set(CMAKE_ASM_FLAGS "-mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
+ elseif(IOS_PLATFORM)
+     #set minimal target ios version.If not provided this option, Xcode
+-- 
+1.9.1
+
package/ne10/ne10.mk +5 -5
index 79b53b809d16..24411482e0a5 100644
@@ -4,15 +4,15 @@
 #
 ################################################################################
 
-# We use a Git commit ID because the last tagged version is more than
-# one year old.
-NE10_VERSION = 88c18f02199947b2c8b57796f5a3ca53160aff96
-NE10_SITE = http://github.com/projectNe10/Ne10/tarball/$(NE10_VERSION)
+NE10_VERSION = v1.0.0
+NE10_SITE = $(call github,projectNe10,Ne10,$(NE10_VERSION))
 NE10_LICENSE = BSD-3c or Apache-2.0
 NE10_LICENSE_FILES = doc/LICENSE
 
+NE10_CONF_OPT = -DGNULINUX_PLATFORM=ON
+
 ifeq ($(BR2_PREFER_STATIC_LIB),)
-NE10_CONF_OPT = \
+NE10_CONF_OPT += \
 	-DNE10_BUILD_SHARED=ON
 endif
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

Switch to github helper while at it.
Fixes:
http://autobuild.buildroot.net/results/a2c/a2ca3fe245e410a738f4b10631a1414696a0edea/

---

Hmm, something doesn't work here:

Building C object modules/CMakeFiles/NE10_test.dir/math/NE10_detmat.neon.s.o
[ 95%] Building C object modules/CMakeFiles/NE10_test.dir/math/NE10_transmat.neon.s.o
Linking C executable NE10_test_static
[ 95%] [ 96%] Building C object modules/CMakeFiles/NE10_test.dir/math/NE10_identitymat.neon.s.o
Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_cfft.neon.s.o /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crt1.o: No such file or directory /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lm /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lc /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [samples/NE10_test_static] Error 1
make[3]: Leaving directory `/home/peko/source/buildroot/output/build/ne10-v1.0.0'
make[2]: *** [samples/CMakeFiles/NE10_test_static.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 96%] Linking C shared library libNE10.so
Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fft_float32.neon.s.o
[ 96%] Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fft_int32.neon.s.o
[ 97%] [ 97%] Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fir.neon.s.o
Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fft_int16.neon.s.o /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lm /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lc /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [modules/libNE10.so.10] Error 1

With a clean cortex A8 build (default codesourcery external toolchain).

Any ideas?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

Hi Peter,

Quoted 42 lines · Peter Korsgaard
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

Switch to github helper while at it.
Fixes:
http://autobuild.buildroot.net/results/a2c/a2ca3fe245e410a738f4b10631a1414696a0edea/

---

Hmm, something doesn't work here:

Building C object modules/CMakeFiles/NE10_test.dir/math/NE10_detmat.neon.s.o
[ 95%] Building C object modules/CMakeFiles/NE10_test.dir/math/NE10_transmat.neon.s.o
Linking C executable NE10_test_static
[ 95%] [ 96%] Building C object modules/CMakeFiles/NE10_test.dir/math/NE10_identitymat.neon.s.o
Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_cfft.neon.s.o /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crt1.o: No such file or directory /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lm /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lc /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [samples/NE10_test_static] Error 1
make[3]: Leaving directory `/home/peko/source/buildroot/output/build/ne10-v1.0.0'
make[2]: *** [samples/CMakeFiles/NE10_test_static.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 96%] Linking C shared library libNE10.so
Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fft_float32.neon.s.o
[ 96%] Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fft_int32.neon.s.o
[ 97%] [ 97%] Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fir.neon.s.o
Building C object modules/CMakeFiles/NE10_test.dir/dsp/NE10_fft_int16.neon.s.o /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lm /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lc /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s /home/peko/source/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [modules/libNE10.so.10] Error 1

Quoted 3 lines

With a clean cortex A8 build (default codesourcery external toolchain).

Any ideas?

Thanks for testing. This is caused by the -mthumb that is hard coded in CMakeLists.txt, which is incompatible with the default -marm. I added a dependency on BR2_ARM_INSTRUCTIONS_THUMB || BR2_ARM_INSTRUCTIONS_THUMB2 to fix this.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#3 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

In reply to Baruch Siach

Dear Baruch Siach,

Quoted 2 lines · Baruch Siach
+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")

This will not work on hardfp toolchains.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

Hi Thomas,

Quoted 6 lines · Thomas Petazzoni
Quoted 2 lines · Baruch Siach
+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")

This will not work on hardfp toolchains.

So would depending on BR2_ARM_FPU_NEON || BR2_ARM_FPU_NEON_VFPV4 be sufficient? The toolchain wrappers handles -mfloat-abi/-mfpu, so this patch is not needed actually.

BTW, what is BR2_ARM_ENABLE_NEON used for? I couldn't find any reference to this configuration symbol in the code.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#5 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

In reply to Baruch Siach

Hi Baruch, all,

Quoted 39 lines · Baruch Siach

Switch to github helper while at it.

Fixes:
http://autobuild.buildroot.net/results/a2c/a2ca3fe245e410a738f4b10631a1414696a0edea/

---
 ...CMakeLists.txt-add-neon-support-to-CFLAGS.patch | 31 ++++++++++++++++++++++
 package/ne10/ne10.mk                               | 10 +++----
 2 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100644 package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +21 -0
new file mode 100644
index 000000000000..1777de102328
@@ -0,0 +1,31 @@
+From 1ab64866615643d19a8e5c4f1a3f62f1baad6e83 Mon Sep 17 00:00:00 2001
+Message-Id: <1ab64866615643d19a8e5c4f1a3f62f1baad6e83.1396964788.git.baruch@tkos.co.il>
+From: Baruch Siach <[email protected]>
+Date: Tue, 8 Apr 2014 16:40:28 +0300
+Subject: [PATCH] CMakeLists.txt: add neon support to CFLAGS
+
+Fixed build failure:
+
+.../include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e5a98af53c1f..22ce166650da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ if(ANDROID_PLATFORM)
+       add_subdirectory(android/NE10Demo/jni)

package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch line 31

Quoted 10 lines
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +10 -0
+     endif()
+ elseif(GNULINUX_PLATFORM)
+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")
+     set(CMAKE_ASM_FLAGS "-mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
+ elseif(IOS_PLATFORM)
+     #set minimal target ios version.If not provided this option, Xcode
+--
+1.9.1
+

I clearly don't like this patch, so I nack it.

Quoted 14 lines
package/ne10/ne10.mk +2 -4
index 79b53b809d16..24411482e0a5 100644
@@ -4,15 +4,15 @@
 #
 ################################################################################
 
-# We use a Git commit ID because the last tagged version is more than
-# one year old.
-NE10_VERSION = 88c18f02199947b2c8b57796f5a3ca53160aff96
-NE10_SITE = http://github.com/projectNe10/Ne10/tarball/$(NE10_VERSION)
+NE10_VERSION = v1.0.0
+NE10_SITE = $(call github,projectNe10,Ne10,$(NE10_VERSION))

package/ne10/ne10.mk line 17

Quoted 10 lines
package/ne10/ne10.mk +3 -1
 NE10_LICENSE = BSD-3c or Apache-2.0
 NE10_LICENSE_FILES = doc/LICENSE
 
+NE10_CONF_OPT = -DGNULINUX_PLATFORM=ON
+
 ifeq ($(BR2_PREFER_STATIC_LIB),)
-NE10_CONF_OPT = \
+NE10_CONF_OPT += \
        -DNE10_BUILD_SHARED=ON
 endif

Instead of messing the CMAKE_C_FLAGS in the package build system itself for something related to the target, I suggest to do this logic in the Buildroot ne10.mk.

I mean, the toolchainfile.cmake allows you to pass some CFLAGS because it does:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Os ... " CACHE STRING
"Buildroot CFLAGS" FORCE)

So you can add the logic adjusting the -mfloat-abi=... and -mfpu=... in the ne10.mk:
NE10_CONF_OPT += -DCMAKE_C_FLAGS="-mfloat-abi=$(BR2_GCC_TARGET_FLOAT_ABI) -mfpu=$(BR2_GCC_TARGET_FPU)"

Regards,

Signature · 1 line
Samuel
#6 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

Quoted 46 lines · Samuel Martin

Hi Baruch, all,

Quoted 43 lines · Baruch Siach

Switch to github helper while at it.

Fixes:
http://autobuild.buildroot.net/results/a2c/a2ca3fe245e410a738f4b10631a1414696a0edea/

---
 ...CMakeLists.txt-add-neon-support-to-CFLAGS.patch | 31 ++++++++++++++++++++++
 package/ne10/ne10.mk                               | 10 +++----
 2 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100644 package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +25 -0
new file mode 100644
index 000000000000..1777de102328
@@ -0,0 +1,31 @@
+From 1ab64866615643d19a8e5c4f1a3f62f1baad6e83 Mon Sep 17 00:00:00 2001
+Message-Id: <1ab64866615643d19a8e5c4f1a3f62f1baad6e83.1396964788.git.baruch@tkos.co.il>
+From: Baruch Siach <[email protected]>
+Date: Tue, 8 Apr 2014 16:40:28 +0300
+Subject: [PATCH] CMakeLists.txt: add neon support to CFLAGS
+
+Fixed build failure:
+
+.../include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e5a98af53c1f..22ce166650da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ if(ANDROID_PLATFORM)
+       add_subdirectory(android/NE10Demo/jni)
+     endif()
+ elseif(GNULINUX_PLATFORM)
+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")
Quoted 8 lines

package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch line 31

Quoted 6 lines
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +6 -0
+     set(CMAKE_ASM_FLAGS "-mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
+ elseif(IOS_PLATFORM)
+     #set minimal target ios version.If not provided this option, Xcode
+--
+1.9.1
+

I clearly don't like this patch, so I nack it.

Just to be clear-crystal, the upstream CMake code is wrong: how could it know what is the target?

So, the "set(CMAKE_C_FLAGS ...)" and "set(CMAKE_ASM_FLAGS ...)" should be removed and set on the CMake command line by Buildroot.

Regards,

Signature · 1 line
Samuel
#7 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

In reply to Samuel Martin

Hi Samuel,

Quoted 41 lines · Samuel Martin
Quoted 40 lines · Baruch Siach

Switch to github helper while at it.

Fixes:
http://autobuild.buildroot.net/results/a2c/a2ca3fe245e410a738f4b10631a1414696a0edea/

---
 ...CMakeLists.txt-add-neon-support-to-CFLAGS.patch | 31 ++++++++++++++++++++++
 package/ne10/ne10.mk                               | 10 +++----
 2 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100644 package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +22 -0
new file mode 100644
index 000000000000..1777de102328
@@ -0,0 +1,31 @@
+From 1ab64866615643d19a8e5c4f1a3f62f1baad6e83 Mon Sep 17 00:00:00 2001
+Message-Id: <1ab64866615643d19a8e5c4f1a3f62f1baad6e83.1396964788.git.baruch@tkos.co.il>
+From: Baruch Siach <[email protected]>
+Date: Tue, 8 Apr 2014 16:40:28 +0300
+Subject: [PATCH] CMakeLists.txt: add neon support to CFLAGS
+
+Fixed build failure:
+
+.../include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e5a98af53c1f..22ce166650da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ if(ANDROID_PLATFORM)
+       add_subdirectory(android/NE10Demo/jni)
+     endif()
Quoted 8 lines

package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch line 28

Quoted 6 lines
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +6 -0
+ elseif(GNULINUX_PLATFORM)
+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")
+     set(CMAKE_ASM_FLAGS "-mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
+ elseif(IOS_PLATFORM)
+     #set minimal target ios version.If not provided this option, Xcode

I clearly don't like this patch, so I nack it.

I don't like it either.

Quoted 9 lines

[...]

Instead of messing the CMAKE_C_FLAGS in the package build system itself for something related to the target, I suggest to do this logic in the Buildroot ne10.mk.

I mean, the toolchainfile.cmake allows you to pass some CFLAGS because it does:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Os ... " CACHE STRING
"Buildroot CFLAGS" FORCE)

But toolchainfile.cmake is a global file, it doesn't change per package.

Review

Quoted 5 lines

So you can add the logic adjusting the -mfloat-abi=... and -mfpu=... in the ne10.mk:
NE10_CONF_OPT +=

(quoted diff) +0 -2
-DCMAKE_C_FLAGS="-mfloat-abi=$(BR2_GCC_TARGET_FLOAT_ABI)
-mfpu=$(BR2_GCC_TARGET_FPU)"

A quick test shows that this solution doesn't work. Just added:

NE10_CONF_OPT += "-DCMAKE_C_FLAGS=-O2 -mthumb-interwork -mthumb \
-march=armv7-a -mfloat-abi=softfp -mfpu=neon"

instead of patching, and got the same failure.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#8 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

Hi Baruch,

On Thu, Apr 10, 2014 at 6:39 AM, Baruch Siach <[email protected]> wrote:
[...]

Quoted 38 lines
Quoted 7 lines
Quoted 7 lines
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +7 -0
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e5a98af53c1f..22ce166650da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ if(ANDROID_PLATFORM)
+       add_subdirectory(android/NE10Demo/jni)
+     endif()
Quoted 8 lines

package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch line 28

Quoted 6 lines

+ elseif(GNULINUX_PLATFORM)

+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +3 -0
+     set(CMAKE_ASM_FLAGS "-mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
+ elseif(IOS_PLATFORM)
+     #set minimal target ios version.If not provided this option, Xcode

I clearly don't like this patch, so I nack it.

I don't like it either.

Quoted 9 lines

[...]

Instead of messing the CMAKE_C_FLAGS in the package build system itself for something related to the target, I suggest to do this logic in the Buildroot ne10.mk.

I mean, the toolchainfile.cmake allows you to pass some CFLAGS because it does:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Os ... " CACHE STRING
"Buildroot CFLAGS" FORCE)

But toolchainfile.cmake is a global file, it doesn't change per package.

Review

Quoted 5 lines

So you can add the logic adjusting the -mfloat-abi=... and -mfpu=... in the ne10.mk:
NE10_CONF_OPT +=

(quoted diff) +0 -2
-DCMAKE_C_FLAGS="-mfloat-abi=$(BR2_GCC_TARGET_FLOAT_ABI)
-mfpu=$(BR2_GCC_TARGET_FPU)"

A quick test shows that this solution doesn't work. Just added:

Quoted 4 lines

NE10_CONF_OPT += "-DCMAKE_C_FLAGS=-O2 -mthumb-interwork -mthumb \
-march=armv7-a -mfloat-abi=softfp -mfpu=neon"

instead of patching, and got the same failure.

Arf! Indeed, our CFLAGS got override by the default ones in the toolchainfile.cmake.
Could you try this patch: http://code.bulix.org/w0j2qz-86015 ?

Regards,

Signature · 1 line
Samuel
#9 lore raw

PATCH 1/1 ne10: bump version to 1.0.0

Hi Samuel,

Quoted 40 lines · Samuel Martin

On Thu, Apr 10, 2014 at 6:39 AM, Baruch Siach <[email protected]> wrote:
[...]

Quoted 38 lines
Quoted 7 lines
Quoted 7 lines
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +7 -0
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e5a98af53c1f..22ce166650da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ if(ANDROID_PLATFORM)
+       add_subdirectory(android/NE10Demo/jni)
+     endif()
Quoted 8 lines

package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch line 28

Quoted 6 lines

+ elseif(GNULINUX_PLATFORM)

+-    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3")
++    set(CMAKE_C_FLAGS "-O2 -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon")
package/ne10/ne10-01-CMakeLists.txt-add-neon-support-to-CFLAGS.patch new file +3 -0
+     set(CMAKE_ASM_FLAGS "-mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
+ elseif(IOS_PLATFORM)
+     #set minimal target ios version.If not provided this option, Xcode

I clearly don't like this patch, so I nack it.

I don't like it either.

Quoted 9 lines

[...]

Instead of messing the CMAKE_C_FLAGS in the package build system itself for something related to the target, I suggest to do this logic in the Buildroot ne10.mk.

I mean, the toolchainfile.cmake allows you to pass some CFLAGS because it does:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Os ... " CACHE STRING
"Buildroot CFLAGS" FORCE)

But toolchainfile.cmake is a global file, it doesn't change per package.

Review

Quoted 5 lines

So you can add the logic adjusting the -mfloat-abi=... and -mfpu=... in the ne10.mk:
NE10_CONF_OPT +=

(quoted diff) +0 -2
-DCMAKE_C_FLAGS="-mfloat-abi=$(BR2_GCC_TARGET_FLOAT_ABI)
-mfpu=$(BR2_GCC_TARGET_FPU)"

A quick test shows that this solution doesn't work. Just added:

Quoted 8 lines
Quoted 4 lines

NE10_CONF_OPT += "-DCMAKE_C_FLAGS=-O2 -mthumb-interwork -mthumb \
-march=armv7-a -mfloat-abi=softfp -mfpu=neon"

instead of patching, and got the same failure.

Arf! Indeed, our CFLAGS got override by the default ones in the toolchainfile.cmake.
Could you try this patch: http://code.bulix.org/w0j2qz-86015 ?

It turns out that this patch is not needed in this case. The -float-abi and -mfpu parameters are set by the toolchain wrapper. ne10 just needs to depend on the correct float/abi configuration.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -