Skip to contentSkip to conversation

kodi: Enable raspberry-pi2 build support

PATCH New Benoît Mauduit 4 participants 10 messages Apr 26, 2016 – May 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

The previous commit [ef37472b20894c99cad758397f3cd6b90f933df1] was based on a newer version of Kodi :
"with-platform=raspberry-pi2" is not yet supported in Kodi "Jarvis" branch.

Backport 2 patches from Kodi master branch into this one.

---
 ...0007-configure-Add-raspberry-pi2-platform.patch | 205 +++++++++++++++++++++
 1 file changed, 205 insertions(+)
 create mode 100644 package/kodi/0007-configure-Add-raspberry-pi2-platform.patch
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +205 -0
new file mode 100644
index 0000000..7542b91
@@ -0,0 +1,205 @@
+From 968c4a0f412c80bf0afecf934b71044d297cad51 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Beno=C3=AEt=20Mauduit?= <[email protected]>
+Date: Tue, 26 Apr 2016 15:30:42 +0200
+Subject: [PATCH 1/1] configure: Add raspberry-pi2 platform
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original commit from "popcornmix" [0], and fixed by "wsnipex" [1] on Kodi branch master.
+Commit-id in xbmc/kodi upstream git :
+[0] Commit-id : 253ec417519afe9415612add80ff5a1753208b75
+[1] Commit-id : 1da2f07be715865bf7cf9731d7147dc4f43459be
+
+Addition to original patches :
+ * Add optimization flag for rpi2 in main xbmc build
+ * Add -mtune & -mvectorize-with-neon-quad flag in "tools/depends" build
+
+Signed-off-by: Beno?t Mauduit <[email protected]>
+---
+ configure.ac                                      | 21 +++++++++++--
+ m4/xbmc_arch.m4                                   |  8 ++---
+ tools/depends/Makefile.include.in                 |  2 +-
+ tools/depends/configure.ac                        | 37 ++++++++++++++++-------
+ tools/depends/target/Toolchain.cmake.in           |  2 +-
+ tools/depends/target/Toolchain_binaddons.cmake.in |  2 +-
+ 6 files changed, 50 insertions(+), 22 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5d47a4a..2eb0e20 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -698,8 +698,17 @@ case $use_platform in
+   raspberry-pi)
+      target_platform=target_raspberry_pi
+      use_neon=no
+-     use_arch="arm"
+      use_cpu=arm1176jzf-s
++     ;;
++  raspberry-pi2)
++     target_platform=target_raspberry_pi
++     use_neon=yes
++     use_cpu=cortex-a7
++     ;;
++esac
++
++if test "$target_platform" = "target_raspberry_pi" ; then
++     use_arch="arm"
+      use_hardcoded_tables="yes"
+      use_openmax=no
+      ARCH="arm"
+@@ -708,8 +717,7 @@ case $use_platform in
+      USE_MMAL=1; AC_DEFINE([HAS_MMAL],[1],["Define to 1 if MMAL libs is enabled"])
+      CFLAGS="$CFLAGS"
+      CXXFLAGS="$CXXFLAGS"
+-     ;;
+-esac
++fi
+ 
+ if test "$host_vendor" = "apple"; then
+   use_avahi=no
+@@ -807,6 +815,13 @@ if test "$host_vendor" = "apple" ; then
+ elif test "$target_platform" = "target_raspberry_pi"; then
+   ARCH="arm"
+   use_arch="arm"
++
++  # Add specific flags for rpi2
++  if test "$use_platform" = "raspberry-pi2"; then
++    CFLAGS="$CFLAGS -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++    CXXFLAGS="$CXXFLAGS -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++  fi
++
+ elif test "$use_arch" = "arm"; then
+   CFLAGS="$CFLAGS -mno-apcs-stack-check"
+   CXXFLAGS="$CXXFLAGS -mno-apcs-stack-check"
+diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
+index 0b66a82..adb8e97 100644
+--- a/m4/xbmc_arch.m4
++++ b/m4/xbmc_arch.m4
+@@ -77,9 +77,7 @@ if test "$target_platform" = "target_android" ; then
+   AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
+ fi
+ 
+-case $use_platform in
+-  raspberry-pi)
+-     AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI")
+-     ;;
+-esac
++if test "$target_platform" = "target_raspberry_pi" ; then
++  AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI")
++fi
+ ])
+diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in
+index 6e37022..326e7b8 100644
+--- a/tools/depends/Makefile.include.in
++++ b/tools/depends/Makefile.include.in
+@@ -20,7 +20,7 @@ NATIVE_OS=@build_os@
+ CROSS_COMPILING=@cross_compiling@
+ ARCH_DEFINES=@ARCH_DEFINES@
+ NATIVE_ARCH_DEFINES=@NATIVE_ARCH_DEFINES@
+-TARGET_PLATFORM=@use_platform@
++TARGET_PLATFORM=@target_platform@
+ XCODE_VERSION=@use_xcode@
+ AAPT=@AAPT@
+ DX=@DX@
+diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
+index 12935e3..05644b8 100644
+--- a/tools/depends/configure.ac
++++ b/tools/depends/configure.ac
+@@ -302,34 +302,49 @@ case $host in
+     AC_MSG_ERROR(unsupported host ($use_host))
+ esac
+ 
+-if test "$use_platform" = "raspberry-pi"; then
++case $use_platform in
++  raspberry-pi)
++     target_platform=raspberry-pi
++     use_neon=no
++     use_cpu=arm1176jzf-s
++     platform_cflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp"
++     platform_cxxflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp"
++     platform_ldflags=""
++     ;;
++  raspberry-pi2)
++     target_platform=raspberry-pi
++     use_neon=yes
++     use_cpu=cortex-a7
++     platform_cflags="-fPIC -mcpu=cortex-a7 -mtune=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++     platform_cxxflags="-fPIC -mcpu=cortex-a7 -mtune=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++     platform_ldflags="-lpthread"
++     ;;
++esac
++
++if test "$target_platform" = "raspberry-pi" ; then
+   if test -d "${use_firmware}/opt/vc/include"; then
+     :
+   else
+     AC_MSG_ERROR([Raspberry Pi firmware not found])
+   fi
+-  use_neon=no
+   use_arch="arm"
+-  use_cpu="arm1176jzf-s"
+   use_hardcoded_tables="yes"
+-  use_alsa="no"
+   ARCH="arm"
+   platform_os="linux"
+   cross_compiling="yes"
+   use_host="arm-linux-gnueabihf"
+   deps_dir="$use_host"
+-  platform_cflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard \
+-   -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated \
+-   -Wno-deprecated-declarations -isystem${use_firmware}/opt/vc/include \
++  platform_cflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \
++   -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \
++   -isystem${use_firmware}/opt/vc/include \
+    -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \
+    -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux"
+-  platform_cxxflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s \
+-   -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux -Wno-psabi \
++  platform_cxxflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \
+    -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \
+    -isystem${use_firmware}/opt/vc/include \
+    -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \
+    -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux"
+-  platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \
++  platform_ldflags+=" -L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \
+    -lvchiq_arm"
+ fi
+ 
+@@ -491,7 +506,7 @@ AC_SUBST(use_cpu)
+ AC_SUBST(use_toolchain)
+ AC_SUBST(use_build_toolchain)
+ AC_SUBST(use_tarballs)
+-AC_SUBST(use_platform)
++AC_SUBST(target_platform)
+ AC_SUBST(use_firmware)
+ AC_SUBST(cross_compiling)
+ AC_SUBST(platform_cflags)
+diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in
+index 943be73..59385e8 100644
+--- a/tools/depends/target/Toolchain.cmake.in
++++ b/tools/depends/target/Toolchain.cmake.in
+@@ -1,6 +1,6 @@
+ SET(OS "@platform_os@")
+ SET(CPU "@use_cpu@")
+-SET(PLATFORM "@use_platform@")
++SET(PLATFORM "@target_platform@")
+ IF("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android")
+ SET(CMAKE_SYSTEM_NAME Linux)
+ ENDIF()
+diff --git a/tools/depends/target/Toolchain_binaddons.cmake.in b/tools/depends/target/Toolchain_binaddons.cmake.in
+index dc6d565..98494b4 100644
+--- a/tools/depends/target/Toolchain_binaddons.cmake.in
++++ b/tools/depends/target/Toolchain_binaddons.cmake.in
+@@ -1,7 +1,7 @@
+ set(CMAKE_SYSTEM_VERSION 1)
+ set(OS "@platform_os@")
+ set(CPU "@use_cpu@")
+-set(PLATFORM "@use_platform@")
++set(PLATFORM "@target_platform@")
+ if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android")
+   set(CMAKE_SYSTEM_NAME Linux)
+ endif()
+-- 
+2.8.1
+
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

Hello,

Quoted 7 lines · Beno?t Mauduit

The previous commit [ef37472b20894c99cad758397f3cd6b90f933df1] was based on a newer version of Kodi :
"with-platform=raspberry-pi2" is not yet supported in Kodi "Jarvis" branch.

Backport 2 patches from Kodi master branch into this one.

Thanks. I do remember seeing a report (on IRC ?) that commit ef37472b20894c99cad758397f3cd6b90f933df1 was indeed causing some problems.

Yann, Bernd, can you review/ack this patch from Beno?t?

Thanks!

Thomas

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

PATCH 1/1 kodi: Enable raspberry-pi2 build support

Am Tue, 26 Apr 2016 22:32:56 +0200 schrieb Thomas Petazzoni:

Quoted 6 lines

Hello,

Quoted 3 lines · Beno?t Mauduit

The previous commit [ef37472b20894c99cad758397f3cd6b90f933df1] was based on a newer version of Kodi :
"with-platform=raspberry-pi2" is not yet supported in Kodi "Jarvis"

branch.

Quoted 10 lines
Quoted 4 lines

Backport 2 patches from Kodi master branch into this one.

Thanks. I do remember seeing a report (on IRC ?) that commit ef37472b20894c99cad758397f3cd6b90f933df1 was indeed causing some problems.

Yann, Bernd, can you review/ack this patch from Beno?t?

Hi Thomas,

reviewing it will be difficult for me because I can not do a runtime test because I do not have access to RPI hardware.

Currently I am preparing a patch series for the 17.0-Krypton version bump, I think I will send the first part of it to my github account in the coming days after some of my PR for the Kodi project are completed.

Backporting feature patches is, afair, something you do not really like ;) As always, as a normal Kodi user, I do not know any release dates but 17.0-Krypton did not even reach alpha1 yet so expect several months until the next version is released. Maybe we should wait for it nonetheless?

Regards, Bernd

#3 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

Hi all,

Quoted 25 lines · Bernd Kuhls

Am Tue, 26 Apr 2016 22:32:56 +0200 schrieb Thomas Petazzoni:

Quoted 6 lines

Hello,

Quoted 3 lines · Beno?t Mauduit

The previous commit [ef37472b20894c99cad758397f3cd6b90f933df1] was based on a newer version of Kodi :
"with-platform=raspberry-pi2" is not yet supported in Kodi "Jarvis"

branch.

Quoted 10 lines
Quoted 4 lines

Backport 2 patches from Kodi master branch into this one.

Thanks. I do remember seeing a report (on IRC ?) that commit ef37472b20894c99cad758397f3cd6b90f933df1 was indeed causing some problems.

Yann, Bernd, can you review/ack this patch from Beno?t?

Hi Thomas,

reviewing it will be difficult for me because I can not do a runtime test because I do not have access to RPI hardware.

Quoted 8 lines

Currently I am preparing a patch series for the 17.0-Krypton version bump, I think I will send the first part of it to my github account in the coming days after some of my PR for the Kodi project are completed.

Backporting feature patches is, afair, something you do not really like ;) As always, as a normal Kodi user, I do not know any release dates but 17.0-Krypton did not even reach alpha1 yet so expect several months until the next version is released. Maybe we should wait for it nonetheless?

Sorry to ask this, but do you have an explanation about not taking upstream patches ? It is not obvious for me.

Also, I began to implement this fix on my own, and after seeing that master branch have implemented this, I thought that it would better to backport it. (Plus some addition from my side, that I will try to report upstream).

From my point of view, we can integrate this patch (affecting only raspberry-pi2 build) and remove it when the newer version of Kodi will integrate it ?

Anyway, thanks for your feedbacks !
Regards,

Ps: I have tested Kodi on my raspberry-pi2. It works like a charm :)

Signature · 3 lines
Beno?t Mauduit
Mail : <[email protected]>
XMPP : <[email protected]>
#4 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

Beno?t, All,

On 2016-04-27 11:08 +0200, Beno?t Mauduit spake thusly:

Quoted 30 lines · Bernd Kuhls
Quoted 29 lines

Am Tue, 26 Apr 2016 22:32:56 +0200 schrieb Thomas Petazzoni:

Quoted 6 lines

Hello,

Quoted 3 lines · Beno?t Mauduit

The previous commit [ef37472b20894c99cad758397f3cd6b90f933df1] was based on a newer version of Kodi :
"with-platform=raspberry-pi2" is not yet supported in Kodi "Jarvis"

branch.

Quoted 10 lines
Quoted 4 lines

Backport 2 patches from Kodi master branch into this one.

Thanks. I do remember seeing a report (on IRC ?) that commit ef37472b20894c99cad758397f3cd6b90f933df1 was indeed causing some problems.

Yann, Bernd, can you review/ack this patch from Beno?t?

Hi Thomas,

reviewing it will be difficult for me because I can not do a runtime test because I do not have access to RPI hardware.

Currently I am preparing a patch series for the 17.0-Krypton version bump, I think I will send the first part of it to my github account in the coming days after some of my PR for the Kodi project are completed.

Quoted 7 lines
Quoted 4 lines

Backporting feature patches is, afair, something you do not really like ;) As always, as a normal Kodi user, I do not know any release dates but 17.0-Krypton did not even reach alpha1 yet so expect several months until the next version is released. Maybe we should wait for it nonetheless?

Sorry to ask this, but do you have an explanation about not taking upstream patches ? It is not obvious for me.

It's not upstream patch we do not like. What we do not like are feature patches. We try to limit the number of patches we have against packages, so we limit ourselves to bug-fix patches.

Quoted 4 lines

Also, I began to implement this fix on my own, and after seeing that master branch have implemented this, I thought that it would better to backport it. (Plus some addition from my side, that I will try to report upstream).

Yes, backporting upstream changes is preferred instead of rolling your own (unless the backport is not technically possible, of course).

Also, your 'additions' no longer make those patches simple upstream backports. If they are really needed, then the upstream backports should be in their own patches, with your additions in separate patches (note that this might be the case, I haven't looked at the patches).

But since those are feature patches, this discussion is moot anyway...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

In reply to Benoît Mauduit

Benoit, All,

On 2016-04-26 22:21 +0200, Beno?t Mauduit spake thusly:

Quoted 3 lines

The previous commit [ef37472b20894c99cad758397f3cd6b90f933df1] was based on a newer version of Kodi :
"with-platform=raspberry-pi2" is not yet supported in Kodi "Jarvis" branch.

Arg. My bad. I indeed looked at the master of Kodi when doing that patch.

Until there is a new release of Kodi (Krypton?), we should revert my patch, rather than backport upstream changes...

Regards,
Yann E. MORIN.

Quoted 226 lines

Backport 2 patches from Kodi master branch into this one.

---
 ...0007-configure-Add-raspberry-pi2-platform.patch | 205 +++++++++++++++++++++
 1 file changed, 205 insertions(+)
 create mode 100644 package/kodi/0007-configure-Add-raspberry-pi2-platform.patch
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +205 -0
new file mode 100644
index 0000000..7542b91
@@ -0,0 +1,205 @@
+From 968c4a0f412c80bf0afecf934b71044d297cad51 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Beno=C3=AEt=20Mauduit?= <[email protected]>
+Date: Tue, 26 Apr 2016 15:30:42 +0200
+Subject: [PATCH 1/1] configure: Add raspberry-pi2 platform
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original commit from "popcornmix" [0], and fixed by "wsnipex" [1] on Kodi branch master.
+Commit-id in xbmc/kodi upstream git :
+[0] Commit-id : 253ec417519afe9415612add80ff5a1753208b75
+[1] Commit-id : 1da2f07be715865bf7cf9731d7147dc4f43459be
+
+Addition to original patches :
+ * Add optimization flag for rpi2 in main xbmc build
+ * Add -mtune & -mvectorize-with-neon-quad flag in "tools/depends" build
+
+Signed-off-by: Beno?t Mauduit <[email protected]>
+---
+ configure.ac                                      | 21 +++++++++++--
+ m4/xbmc_arch.m4                                   |  8 ++---
+ tools/depends/Makefile.include.in                 |  2 +-
+ tools/depends/configure.ac                        | 37 ++++++++++++++++-------
+ tools/depends/target/Toolchain.cmake.in           |  2 +-
+ tools/depends/target/Toolchain_binaddons.cmake.in |  2 +-
+ 6 files changed, 50 insertions(+), 22 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5d47a4a..2eb0e20 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -698,8 +698,17 @@ case $use_platform in
+   raspberry-pi)
+      target_platform=target_raspberry_pi
+      use_neon=no
+-     use_arch="arm"
+      use_cpu=arm1176jzf-s
++     ;;
++  raspberry-pi2)
++     target_platform=target_raspberry_pi
++     use_neon=yes
++     use_cpu=cortex-a7
++     ;;
++esac
++
++if test "$target_platform" = "target_raspberry_pi" ; then
++     use_arch="arm"
+      use_hardcoded_tables="yes"
+      use_openmax=no
+      ARCH="arm"
+@@ -708,8 +717,7 @@ case $use_platform in
+      USE_MMAL=1; AC_DEFINE([HAS_MMAL],[1],["Define to 1 if MMAL libs is enabled"])
+      CFLAGS="$CFLAGS"
+      CXXFLAGS="$CXXFLAGS"
+-     ;;
+-esac
++fi
+ 
+ if test "$host_vendor" = "apple"; then
+   use_avahi=no
+@@ -807,6 +815,13 @@ if test "$host_vendor" = "apple" ; then
+ elif test "$target_platform" = "target_raspberry_pi"; then
+   ARCH="arm"
+   use_arch="arm"
++
++  # Add specific flags for rpi2
++  if test "$use_platform" = "raspberry-pi2"; then
++    CFLAGS="$CFLAGS -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++    CXXFLAGS="$CXXFLAGS -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++  fi
++
+ elif test "$use_arch" = "arm"; then
+   CFLAGS="$CFLAGS -mno-apcs-stack-check"
+   CXXFLAGS="$CXXFLAGS -mno-apcs-stack-check"
+diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
+index 0b66a82..adb8e97 100644
+--- a/m4/xbmc_arch.m4
++++ b/m4/xbmc_arch.m4
+@@ -77,9 +77,7 @@ if test "$target_platform" = "target_android" ; then
+   AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
+ fi
+ 
+-case $use_platform in
+-  raspberry-pi)
+-     AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI")
+-     ;;
+-esac
++if test "$target_platform" = "target_raspberry_pi" ; then
++  AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI")
++fi
+ ])
+diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in
+index 6e37022..326e7b8 100644
+--- a/tools/depends/Makefile.include.in
++++ b/tools/depends/Makefile.include.in
+@@ -20,7 +20,7 @@ NATIVE_OS=@build_os@
+ CROSS_COMPILING=@cross_compiling@
+ ARCH_DEFINES=@ARCH_DEFINES@
+ NATIVE_ARCH_DEFINES=@NATIVE_ARCH_DEFINES@
+-TARGET_PLATFORM=@use_platform@
++TARGET_PLATFORM=@target_platform@
+ XCODE_VERSION=@use_xcode@
+ AAPT=@AAPT@
+ DX=@DX@
+diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
+index 12935e3..05644b8 100644
+--- a/tools/depends/configure.ac
++++ b/tools/depends/configure.ac
+@@ -302,34 +302,49 @@ case $host in
+     AC_MSG_ERROR(unsupported host ($use_host))
+ esac
+ 
+-if test "$use_platform" = "raspberry-pi"; then
++case $use_platform in
++  raspberry-pi)
++     target_platform=raspberry-pi
++     use_neon=no
++     use_cpu=arm1176jzf-s
++     platform_cflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp"
++     platform_cxxflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp"
++     platform_ldflags=""
++     ;;
++  raspberry-pi2)
++     target_platform=raspberry-pi
++     use_neon=yes
++     use_cpu=cortex-a7
++     platform_cflags="-fPIC -mcpu=cortex-a7 -mtune=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++     platform_cxxflags="-fPIC -mcpu=cortex-a7 -mtune=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
++     platform_ldflags="-lpthread"
++     ;;
++esac
++
++if test "$target_platform" = "raspberry-pi" ; then
+   if test -d "${use_firmware}/opt/vc/include"; then
+     :
+   else
+     AC_MSG_ERROR([Raspberry Pi firmware not found])
+   fi
+-  use_neon=no
+   use_arch="arm"
+-  use_cpu="arm1176jzf-s"
+   use_hardcoded_tables="yes"
+-  use_alsa="no"
+   ARCH="arm"
+   platform_os="linux"
+   cross_compiling="yes"
+   use_host="arm-linux-gnueabihf"
+   deps_dir="$use_host"
+-  platform_cflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard \
+-   -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated \
+-   -Wno-deprecated-declarations -isystem${use_firmware}/opt/vc/include \
++  platform_cflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \
++   -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \
++   -isystem${use_firmware}/opt/vc/include \
+    -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \
+    -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux"
+-  platform_cxxflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s \
+-   -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux -Wno-psabi \
++  platform_cxxflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \
+    -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \
+    -isystem${use_firmware}/opt/vc/include \
+    -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \
+    -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux"
+-  platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \
++  platform_ldflags+=" -L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \
+    -lvchiq_arm"
+ fi
+ 
+@@ -491,7 +506,7 @@ AC_SUBST(use_cpu)
+ AC_SUBST(use_toolchain)
+ AC_SUBST(use_build_toolchain)
+ AC_SUBST(use_tarballs)
+-AC_SUBST(use_platform)
++AC_SUBST(target_platform)
+ AC_SUBST(use_firmware)
+ AC_SUBST(cross_compiling)
+ AC_SUBST(platform_cflags)
+diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in
+index 943be73..59385e8 100644
+--- a/tools/depends/target/Toolchain.cmake.in
++++ b/tools/depends/target/Toolchain.cmake.in
+@@ -1,6 +1,6 @@
+ SET(OS "@platform_os@")
+ SET(CPU "@use_cpu@")
+-SET(PLATFORM "@use_platform@")
++SET(PLATFORM "@target_platform@")
+ IF("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android")
+ SET(CMAKE_SYSTEM_NAME Linux)
+ ENDIF()
+diff --git a/tools/depends/target/Toolchain_binaddons.cmake.in b/tools/depends/target/Toolchain_binaddons.cmake.in
+index dc6d565..98494b4 100644
+--- a/tools/depends/target/Toolchain_binaddons.cmake.in
++++ b/tools/depends/target/Toolchain_binaddons.cmake.in
+@@ -1,7 +1,7 @@
+ set(CMAKE_SYSTEM_VERSION 1)
+ set(OS "@platform_os@")
+ set(CPU "@use_cpu@")
+-set(PLATFORM "@use_platform@")
++set(PLATFORM "@target_platform@")
+ if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android")
+   set(CMAKE_SYSTEM_NAME Linux)
+ endif()
+-- 
+2.8.1
+
Signature · 6 lines
2.8.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 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

In reply to Benoît Mauduit

Hello,

package/kodi/0007-configure-Add-raspberry-pi2-platform.patch line 12

Quoted 4 lines · Beno?t Mauduit
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +4 -0
+Original commit from "popcornmix" [0], and fixed by "wsnipex" [1] on Kodi branch master.
+Commit-id in xbmc/kodi upstream git :
+[0] Commit-id : 253ec417519afe9415612add80ff5a1753208b75
+[1] Commit-id : 1da2f07be715865bf7cf9731d7147dc4f43459be

In these are two patches upstream, then it should be two patches in Buildroot as well.

package/kodi/0007-configure-Add-raspberry-pi2-platform.patch line 16

Quoted 4 lines
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +4 -0
+
+Addition to original patches :
+ * Add optimization flag for rpi2 in main xbmc build
+ * Add -mtune & -mvectorize-with-neon-quad flag in "tools/depends" build

Why are you doing those additional changes compared to upstream?

Like Yann said, we prefer to not backport too much stuff, except when it's actually fixing a problem (which is not the case here).

Yann, will you send a patch that reverts your commit adding explicit RPi 2 support in the Kodi package ? This way we can have this for 2016.05, and when a new Kodi release is done with built-in support for RPi2, we can revisit this.

Thomas

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

PATCH 1/1 kodi: Enable raspberry-pi2 build support

Thomas, All,

On 2016-05-07 22:50 +0200, Thomas Petazzoni spake thusly:

Quoted 17 lines · Beno?t Mauduit

package/kodi/0007-configure-Add-raspberry-pi2-platform.patch line 12

Quoted 5 lines
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +4 -0
+Original commit from "popcornmix" [0], and fixed by "wsnipex" [1] on Kodi branch master.
+Commit-id in xbmc/kodi upstream git :
+[0] Commit-id : 253ec417519afe9415612add80ff5a1753208b75
+[1] Commit-id : 1da2f07be715865bf7cf9731d7147dc4f43459be

In these are two patches upstream, then it should be two patches in Buildroot as well.

package/kodi/0007-configure-Add-raspberry-pi2-platform.patch line 16

Quoted 4 lines
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +4 -0
+
+Addition to original patches :
+ * Add optimization flag for rpi2 in main xbmc build
+ * Add -mtune & -mvectorize-with-neon-quad flag in "tools/depends" build

Why are you doing those additional changes compared to upstream?

Quoted 7 lines

Like Yann said, we prefer to not backport too much stuff, except when it's actually fixing a problem (which is not the case here).

Yann, will you send a patch that reverts your commit adding explicit RPi 2 support in the Kodi package ? This way we can have this for 2016.05, and when a new Kodi release is done with built-in support for RPi2, we can revisit this.

Yes, I'll send it soonish...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

In reply to Thomas Petazzoni

Hi,

Quoted 4 lines · Thomas Petazzoni

Hello,

On Tue, 26 Apr 2016 22:21:14 +0200, Beno?t Mauduit wrote:

Quoted 8 lines

package/kodi/0007-configure-Add-raspberry-pi2-platform.patch line 12

Quoted 4 lines
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +4 -0
+Original commit from "popcornmix" [0], and fixed by "wsnipex" [1] on Kodi branch master.
+Commit-id in xbmc/kodi upstream git :
+[0] Commit-id : 253ec417519afe9415612add80ff5a1753208b75
+[1] Commit-id : 1da2f07be715865bf7cf9731d7147dc4f43459be

In these are two patches upstream, then it should be two patches in Buildroot as well.

Ok. I hesitate to do that. Because the second patch revert and improve some change done by the first, I thought it was easier to understand from Buildroot to integrate only one patch. (Following the philosophy, one commit, one feature).

Quoted 6 lines

package/kodi/0007-configure-Add-raspberry-pi2-platform.patch line 16

Quoted 4 lines
package/kodi/0007-configure-Add-raspberry-pi2-platform.patch new file +4 -0
+
+Addition to original patches :
+ * Add optimization flag for rpi2 in main xbmc build
+ * Add -mtune & -mvectorize-with-neon-quad flag in "tools/depends" build

Why are you doing those additional changes compared to upstream?

I tried different optimization flags before coming to theses. It is inspired by what Archlinux are doing for their kodi-rbp package. [1]

Quoted 3 lines

Like Yann said, we prefer to not backport too much stuff, except when it's actually fixing a problem (which is not the case here).

I see things a little differently when we talk about fixing/improving build system and not adding a Kodi feature.

Quoted 8 lines

Yann, will you send a patch that reverts your commit adding explicit RPi 2 support in the Kodi package ? This way we can have this for 2016.05, and when a new Kodi release is done with built-in support for RPi2, we can revisit this.

Thomas

Anyway, I had some strange behavior with this optimizations. When compiling in -Os I have no issue, and kodi run very fine (RPI2 & RPI3). But trying in -O3 result in various segfault. (I do not dig further about this, and don't know if this is related to this change...)

I think it is better to wait for the next kodi version.

Thanks for the feedbacks !

Ps: I just see that archlinux is providing a patch[2] for building kodi with gcc 6. Are we interested ? or are we waiting the next kodi ?

[1] : https://archlinuxarm.org/packages/armv6h/kodi-rbp/files/PKGBUILD
[2] : https://archlinuxarm.org/packages/armv6h/kodi-rbp/files/gcc6_fix.patch

Signature · 3 lines
Beno?t Mauduit
Mail : <[email protected]>
XMPP : <[email protected]>
#9 lore raw

PATCH 1/1 kodi: Enable raspberry-pi2 build support

Am Thu, 12 May 2016 15:06:02 +0200 schrieb Beno?t Mauduit:

Quoted 6 lines

Ps: I just see that archlinux is providing a patch[2] for building kodi with gcc 6. Are we interested ? or are we waiting the next kodi ?

[1] : https://archlinuxarm.org/packages/armv6h/kodi-rbp/files/PKGBUILD
[2] :
https://archlinuxarm.org/packages/armv6h/kodi-rbp/files/gcc6_fix.patch

Hi Beno?t,

I created that patch and send it to already here:
http://patchwork.ozlabs.org/patch/616330/

Please review the patch to help its integration in buildroot. Upstream
(https://github.com/xbmc/xbmc/pull/9703) had no technical complaints about the patch but will not commit it because they won't do another release for the Jarvis-16 branch. The next version Krypton-17 will not need the patch.

You can also test my kodi17 branch for buildroot:
https://github.com/bkuhls/buildroot/tree/kodi17

Regards, Bernd