On 2018-08-10 12:39 +0200, Sjoerd Simons wrote:
> Package: ne10
> Version: 1.2.1-3
> Severity: serious
> Tags: patch
> Justification: fails to build from source
> 
> As per
> https://buildd.debian.org/status/fetch.php?pkg=ne10&arch=armhf&ver=1.2.1-3&stamp=1478897528&raw=0
> the build of ne10 fails on armhf. This is because it detects the build
> environment as targetting aarch64. From the log:
>   -- Target architecture : aarch64
> 
> Attached is the debdiff from a derivative we hvae which fixes the issue.

Thanks for this. I've been meaning to fix this for ages.

However there is already a patch in the Makefile to fix this, which I
think is cleaner than making an exception for armhf. Clearly the catch
is that it's not actually working...

native-build.patch:
Index: ne10-1.2.1/GNUlinux_config.cmake
===================================================================
--- ne10-1.2.1.orig/GNUlinux_config.cmake
+++ ne10-1.2.1/GNUlinux_config.cmake
@@ -43,6 +43,10 @@ else()
    set(NE10_LINUX_TARGET_ARCH $ENV{NE10_LINUX_TARGET_ARCH})
 endif()
 
+# debian DEB_TARGET_GNU_CPU calls this as 'arm', not 'armv7'
+if(NE10_LINUX_TARGET_ARCH STREQUAL "arm")
+   set (NE10_LINUX_TARGET_ARCH "armv7")
+
 if(NE10_LINUX_TARGET_ARCH STREQUAL "armv7")
    set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
    set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)


OK. turns out I needed to patch CMakelists.txt as well:
--- ne10-1.2.1.orig/CMakeLists.txt
+++ ne10-1.2.1/CMakeLists.txt
@@ -61,8 +61,9 @@ if(DEFINED NE10_ANDROID_TARGET_ARCH)
     endif()
 endif()

+#On debian this CPU arch is 'arm'
 if(DEFINED NE10_LINUX_TARGET_ARCH)
-    if(${NE10_LINUX_TARGET_ARCH} STREQUAL "armv7")
+    if(${NE10_LINUX_TARGET_ARCH} STREQUAL "arm")
         set(NE10_TARGET_ARCH "armv7")
     else()
         set(NE10_TARGET_ARCH "aarch64")


I've uploaded a fixed package (which also does a beter (more general)
job of setting up toolchains by just using ENV{DEB_BUILD_GNU_TYPE})

Thanks for the prod - this stayed broken for way too long...

---------------
> diff -Nru ne10-1.2.1/debian/rules ne10-1.2.1/debian/rules
> --- ne10-1.2.1/debian/rules   2016-10-12 19:35:53.000000000 +0200
> +++ ne10-1.2.1/debian/rules   2018-08-10 12:26:57.000000000 +0200
> @@ -13,12 +13,19 @@
>  # package maintainers to append LDFLAGS
>  #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
>  
> +ifeq ($(DEB_TARGET_GNU_CPU),arm)
> +     NE10_LINUX_TARGET_ARCH = armv7
> +else
> +     NE10_LINUX_TARGET_ARCH = ${DEB_TARGET_GNU_CPU}
> +endif
> +
>  %:
>       dh $@ 
>  
>  override_dh_auto_configure:
> +     
>       dh_auto_configure -- \
> -     -DNE10_LINUX_TARGET_ARCH=$(DEB_TARGET_GNU_CPU) \
> +     -DNE10_LINUX_TARGET_ARCH=$(NE10_LINUX_TARGET_ARCH) \
>       -DGNULINUX_PLATFORM=ON \
>       -DNE10_BUILD_SHARED=ON

Wookey
-- 
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to