v18 RPi2 build (-DCORE_PLATFORM_NAME=rbpi) results in bin w/ NEON extensions for ARMv*8*?
#1
Question 
Clean-building kodi18/head,


Code:
    git log | head
        commit 623d2ce19aa6e117c791532cc17185da802d0544
        Merge: 1111b281b0d 25e53ba3689
        Author: Rechi <[email protected]>
        Date:   Sun Oct 8 20:03:36 2017 +0200

            Merge pull request #12887 from Rechi/dxvaVP9

            [dxva] add VP9 profile 0 hardware decoder

        commit 1111b281b0db27f5b607f8121c65c0aa21bcea0c

for RPi2


Code:
    -DCORE_PLATFORM_NAME=rbpi

on


Code:
    lsb_release -rd
        Description:    Raspbian GNU/Linux 9.1 (stretch)
        Release:        9.1

I get an executable


Code:
    /usr/local/kodi/lib/kodi/kodi.bin -v
        18.0-ALPHA1 Git:20171008-623d2ce Media Center Kodi
        Copyright (C) 2005-2013 Team Kodi - http://kodi.tv

    file /usr/local/kodi/lib/kodi/kodi.bin
        /usr/local/kodi/lib/kodi/kodi.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=ac156f90f5e7d9aa3952061add7171ecd720a617, stripped


but checking the ARM ELF Binary


Code:
    readelf -A /usr/local/kodi/lib/kodi/kodi.bin
        Attribute Section: aeabi
        File Attributes
          Tag_CPU_name: "ARM v7"
          Tag_CPU_arch: v7
          Tag_CPU_arch_profile: Application
          Tag_ARM_ISA_use: Yes
          Tag_THUMB_ISA_use: Thumb-2
          Tag_FP_arch: VFPv4
          Tag_Advanced_SIMD_arch: NEON for ARMv8
          Tag_ABI_PCS_wchar_t: 4
          Tag_ABI_FP_rounding: Needed
          Tag_ABI_FP_denormal: Needed
          Tag_ABI_FP_exceptions: Needed
          Tag_ABI_FP_user_exceptions: Needed
          Tag_ABI_FP_number_model: IEEE 754
          Tag_ABI_align_needed: 8-byte
          Tag_ABI_enum_size: int
          Tag_ABI_HardFP_use: Deprecated
          Tag_ABI_VFP_args: VFP registers
          Tag_CPU_unaligned_access: v6
          Tag_MPextension_use: Allowed
          Tag_DIV_use: Allowed in v7-A with integer division extension
          Tag_Virtualization_use: TrustZone and Virtualization Extensions
I notice the


Code:
    Tag_Advanced_SIMD_arch: NEON for ARMv8

whereas prior builds' value was, historically,


Code:
    Tag_Advanced_SIMD_arch: NEONv1 with Fused-MAC

Afaict, these labels are generated from binutils/readelf.c.

The RPi2's, of course, an ARMv7 Cortex-A7 quad-core, not a v8.  I assume (?) NEON v8 extensions are a problem, here.

The build's CMakeCache.txt's flags contain:

 
Code:
  -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7

What config's needed to ensure the right NEON extensions for the right ARM version are identified/used, as in the past?
Reply
#2
With just


Code:
    cmake .. -DCORE_PLATFORM_NAME=rbpi ...

I note in configure


Code:
    ...
    -- Core system type: linux
    -- Platform:
    -- CPU: armv7l, ARCH: arm
    ...

but in,


Code:
    ./scripts/linux/ArchSetup.cmake  
        ...
          elseif(CPU STREQUAL arm1176jzf-s)
            set(ARCH arm)
            set(NEON False)
            set(NEON_FLAGS "-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp")
          elseif(CPU MATCHES "cortex-a7" OR CPU MATCHES "cortex-a53")
            set(ARCH arm)
            set(NEON True)
            set(NEON_FLAGS "-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad")
        ...
the correct match for RPi2 is


Code:
    elseif(CPU MATCHES "cortex-a7" OR CPU MATCHES "cortex-a53")

checking


Code:
    ./scripts/linux/ArchSetup.cmake  
        ...
        # -------- Main script --------- 
        message(STATUS "System type: ${CMAKE_SYSTEM_NAME}")

        if(WITH_CPU)
          set(CPU ${WITH_CPU})
        ...

configuring, instead, with


Code:
    cmake .. -DCORE_PLATFORM_NAME=rbpi -DWITH_CPU=cortex-a7 ...
returns a more appropriate


Code:
    ...
    -- Core system type: linux
    -- Platform:
    -- CPU: cortex-a7, ARCH: arm
    ...

Building now ...
Reply
#3
and, STILL ...


Code:
  Tag_Advanced_SIMD_arch: NEON for ARMv8
Reply
#4
which toolchain are you using? Kinda looks like a bug.
The options are correct, see https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

Also, does it run? Crashes?
Reply
#5
(2017-10-09, 15:08)wsnipex Wrote: which toolchain are you using? Kinda looks like a bug.
The options are correct, see https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

Also, does it run? Crashes?

I'm building in a full, clean-installed raspbian 9.1 chroot env.


Code:
[font=monospace][color=#000000]lsb_release -rd [/color]
Description:    Raspbian GNU/Linux 9.1 (stretch)
Release:        9.1[/font]

fyi


Code:
[font=monospace][color=#000000]gcc -v [/color]
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 6.3.0-18+rpi1' --with-bugurl
=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,
obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shar
ed --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads
=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcx
x-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-obje
ct --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browse
r-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gc
j-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --wi
th-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-e
cj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enab
le-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --e
nable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-li
nux-gnueabihf
Thread model: posix
gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1)[/font]

Yep, aware that the options are correct -- hence the bit of a mystery as to why they're not propagated.

Consistent also with

https://community.arm.com/tools/b/blog/p...mand-lines
http://infocenter.arm.com/help/index.jsp...hfbga.html

They're what I've been using with Kodi18 for awhile.  My prior builds (~6 months ago ...) had the correct "NeonV1 with Fused-MAC" id <- readelf.

I do *NOT* see the NEON_FLAGS in my post-config CMakeCache.txt.  I'd expected it there ... don't know yet if THAT is the problem.

I haven't yet moved the bin onto an actual RPi2 for testing.  Waiting on a new sdcard to arrive; that's the reason I'm rebuilding this in the 1st place ...

IN chroot, version query execs ok


Code:
[color=#000000]/usr/local/kodi/lib/kodi/kodi.bin -v [/color]
18.0-ALPHA1 Git:20171008-623d2ce Media Center Kodi
Copyright (C) 2005-2013 Team Kodi - http://kodi.tv


but exec of the bin segfaults


Code:
[color=#000000]/usr/local/kodi/lib/kodi/kodi.bin [/color]
* failed to open vchiq instance
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault (core dumped)

TBH, not sure what to expect on exec in the chroot ...
Reply
#6
in config output, the only mention of NEON I see is the status message


Code:
    ...
    -- Could not find hardware support for AVX2 (missing:  _AVX2_TRUE _AVX2_OK) 
!!  -- NEON optimization enabled
    -- core_file_read_filtered - filename: /usr/local/src/kodi/version.txt
    ...

which originates at


Code:
    ../cmake/scripts/common/ArchSetup.cmake
        ...
        if(NOT DEFINED NEON OR NEON)
          option(ENABLE_NEON "Enable NEON optimization" ${NEON})
          if(ENABLE_NEON)
!!          message(STATUS "NEON optimization enabled")
            add_definitions(-DHAS_NEON)
            if(NEON_FLAGS)
              add_options(ALL_LANGUAGES ALL_BUILDS ${NEON_FLAGS})
            endif()
          endif()
        endif()
        ...

from above, NEON_FLAGS is supposed to be added ...
Reply
#7
the binary is unlikely to run in qemu, given that it is missing the gpu/vpu.

I've just cross built master for rpi2 with our depends system:
Quote::~/src/code/kodi/xbmc/build$ readelf -A kodi.bin
Attribute Section: aeabi
File Attributes
 Tag_CPU_name: "Cortex-A7"
 Tag_CPU_arch: v7
 Tag_CPU_arch_profile: Application
 Tag_ARM_ISA_use: Yes
 Tag_THUMB_ISA_use: Thumb-2
 Tag_FP_arch: VFPv4
 Tag_Advanced_SIMD_arch: NEONv1 with Fused-MAC
 Tag_ABI_PCS_wchar_t: 4
 Tag_ABI_FP_denormal: Needed
 Tag_ABI_FP_exceptions: Needed
 Tag_ABI_FP_number_model: IEEE 754
 Tag_ABI_align_needed: 8-byte
 Tag_ABI_enum_size: int
 Tag_ABI_HardFP_use: Deprecated
 Tag_ABI_VFP_args: VFP registers
 Tag_CPU_unaligned_access: v6
 Tag_MPextension_use: Allowed
 Tag_DIV_use: Allowed in v7-A with integer division extension
 Tag_Virtualization_use: TrustZone and Virtualization Extensions

Toolchain from raspberrypi firmware git (not a fresh install, so might already be older):
Quote:$ /home/wolfgang/src/code/kodi/rbpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -v
Using built-in specs.
COLLECT_GCC=/home/wolfgang/src/code/kodi/rbpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/home/wolfgang/src/code/kodi/rbpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.3/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/.build/src/gcc-linaro-4.8-2014.03/configure --build=x86_64-build_unknown-linux-gnu --host=x86_64-build_unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/install --with-sysroot=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv6 --with-tune=arm1176jz-s --with-fpu=vfp --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --enable-gold --with-local-prefix=/home/zhehe01/work/bzr/pi-build/builds/arm-linux-gnueabihf-raspbian-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-float=hard
Thread model: posix
gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03)

CXX flags (only relevant flags):
Quote:-std=gnu++11 -fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -pipe -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations
Reply
#8
Hm Undecided

Notable differences,

mine


Code:
  Tag_CPU_name: "ARM v7"
  Tag_Advanced_SIMD_arch: NEON for ARMv8
  Tag_ABI_FP_rounding: Needed
  Tag_ABI_FP_user_exceptions: Needed

yours


Code:
  Tag_CPU_name: "Cortex-A7"
  Tag_Advanced_SIMD_arch: NEONv1 with Fused-MAC
  (Tag_ABI_FP_rounding:) **missing**
  (Tag_ABI_FP_user_exceptions:) **missing**


my g++ is v6x

 
Code:
  g++ -v
        Using built-in specs.
        COLLECT_GCC=g++
        COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper
        Target: arm-linux-gnueabihf
        Configured with: ../src/configure -v --with-pkgversion='Raspbian 6.3.0-18+rpi1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
        Thread model: posix
        gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1)

and


Code:
    grep CMAKE_CXX_FLAGS: CMakeCache.txt
        CMAKE_CXX_FLAGS:STRING=-O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -ftree-vectorize -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -std=c++11


comparing to your values


Code:
    -std=gnu++11 -fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -pipe -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations
mine include

 
Code:
  -std=c++11         -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -pipe                   -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations
Reply
#9
well, THIS is particularly .... annoying


Code:
cd /usr/local/src/kodi
cd    ./tools/depends/native/JsonSchemaBuilder/src
./autogen.sh
./configure --prefix=/usr/local
make clean
make -j4
make install
file /usr/local/bin/JsonSchemaBuilder
    /usr/local/bin/JsonSchemaBuilder: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=f07c798f2032f84f5c6a8c3558400231d158a6d9, not stripped
readelf -A /usr/local/bin/JsonSchemaBuilder | \
 egrep "Tag_CPU_name:|Tag_CPU_arch:|Tag_Advanced_SIMD_arch"
    Tag_CPU_name: "Cortex-A7"
    Tag_CPU_arch: v7
    Tag_Advanced_SIMD_arch: NEONv1 with Fused-MAC

but


Code:
cd /usr/local/src/kodi
cmake .. \
 -DWITH_CPU=cortex-a7 \
 -DCORE_PLATFORM_NAME=rbpi \
 ...
cmake --build . -- VERBOSE=1 -j4
make install
file /usr/local/kodi/lib/kodi/kodi.bin
    /usr/local/kodi/lib/kodi/kodi.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=ac156f90f5e7d9aa3952061add7171ecd720a617, stripped
readelf -A /usr/local/kodi/lib/kodi/kodi.bin |  egrep "Tag_CPU_name:|Tag_CPU_arch:|Tag_Advanced_SIMD_arch"
    Tag_CPU_name: "ARM v7"
    Tag_CPU_arch: v7
    Tag_Advanced_SIMD_arch: NEON for ARMv8
Reply
#10
Hmm, this is quite interesting.
I can confirm this behaviour even on crosscompiled builds with toolchains tailored for the board cpu.

I'm far from being an ARM expert, but I'll try to get to the bottom of this, seems like a nice puzzle.  Nod

Kodi master built for rpi2, gcc 7.2.0, binutils 2.29.1

Code:
readelf -A /usr/lib/kodi/kodi.bin |  egrep "Tag_"
 Tag_CPU_name: "Cortex-A7"
 Tag_CPU_arch: v7
 Tag_CPU_arch_profile: Application
 Tag_ARM_ISA_use: Yes
 Tag_THUMB_ISA_use: Thumb-2
 Tag_FP_arch: VFPv4
 Tag_Advanced_SIMD_arch: NEON for ARMv8
 Tag_ABI_PCS_wchar_t: 4
 Tag_ABI_FP_rounding: Needed
 Tag_ABI_FP_denormal: Needed
 Tag_ABI_FP_exceptions: Needed
 Tag_ABI_FP_user_exceptions: Needed
 Tag_ABI_FP_number_model: IEEE 754
 Tag_ABI_align_needed: 8-byte
 Tag_ABI_enum_size: int
 Tag_ABI_VFP_args: VFP registers
 Tag_CPU_unaligned_access: v6
 Tag_MPextension_use: Allowed
 Tag_DIV_use: Allowed in v7-A with integer division extension
 Tag_Virtualization_use: TrustZone and Virtualization Extensions

A random binary built using same toolchain and same *FLAGS

Code:
readelf -A /usr/bin/bash |  egrep "Tag_"
 Tag_CPU_name: "Cortex-A7"
 Tag_CPU_arch: v7
 Tag_CPU_arch_profile: Application
 Tag_ARM_ISA_use: Yes
 Tag_THUMB_ISA_use: Thumb-2
 Tag_FP_arch: VFPv4
 Tag_Advanced_SIMD_arch: NEONv1 with Fused-MAC
 Tag_ABI_PCS_wchar_t: 4
 Tag_ABI_FP_rounding: Needed
 Tag_ABI_FP_denormal: Needed
 Tag_ABI_FP_exceptions: Needed
 Tag_ABI_FP_user_exceptions: Needed
 Tag_ABI_FP_number_model: IEEE 754
 Tag_ABI_align_needed: 8-byte
 Tag_ABI_enum_size: int
 Tag_ABI_VFP_args: VFP registers
 Tag_CPU_unaligned_access: v6
 Tag_MPextension_use: Allowed
 Tag_DIV_use: Allowed in v7-A with integer division extension
 Tag_Virtualization_use: TrustZone and Virtualization Extensions
Reply
#11
(2017-10-10, 02:44)asavah Wrote: I can confirm this behaviour even on crosscompiled builds with toolchains tailored for the board cpu.
Using the kodi depends system?
Iiuc, that's exactly what wsnipex did, above ... albeit with an older toolchain.
I'm going to see if I can get a toolchain+depends system build working.
Reply
#12
I think it's ld.gold bug or toolchain misconfiguration.


Try configuring kodi with -DENABLE_LDGOLD=OFF
Code:
/home/asavah/kross/host/rpi2/bin/armv7-rpi2-linux-gnueabihf-readelf -A kodi.bin
Attribute Section: aeabi
File Attributes
 Tag_CPU_name: "Cortex-A7"
 Tag_CPU_arch: v7
 Tag_CPU_arch_profile: Application
 Tag_ARM_ISA_use: Yes
 Tag_THUMB_ISA_use: Thumb-2
 Tag_FP_arch: VFPv4
 Tag_Advanced_SIMD_arch: NEONv1 with Fused-MAC
 Tag_ABI_PCS_wchar_t: 4
 Tag_ABI_FP_rounding: Needed
 Tag_ABI_FP_denormal: Needed
 Tag_ABI_FP_exceptions: Needed
 Tag_ABI_FP_number_model: IEEE 754
 Tag_ABI_align_needed: 8-byte
 Tag_ABI_enum_size: int
 Tag_ABI_VFP_args: VFP registers
 Tag_CPU_unaligned_access: v6
 Tag_MPextension_use: Allowed
 Tag_DIV_use: Allowed in v7-A with integer division extension
 Tag_Virtualization_use: TrustZone and Virtualization Extensions



I've triple checked all the objects generated while building Kodi and all the libs Kodi links to, no NEON for ARMv8 bullshit.
EDIT: I indeed found at least one lib which has ARMv8 tags - libgcrypt.so.20.2.1 , the script I used to check that stuff was wrong.
It only appears at final link stage when linking kodi.bin with ldgold.
EDIT: it looks like a tag "clash".
However this DOES seem to happen when linking other binaries with ldgold (-fuse-ld=gold).
I'm not sure what could cause ldgold to misbehave like that, this would require a gcc/binutils/expert.
Also I'm sure as hell that this so far hasn't caused any issues in runtime on my pi2.

I'll dig further.

>Using the kodi depends system?
Nope, I have my own homegrown os, my own bleeding edge toolchains and large etc.
Reply
#13
So I found the culprit - it's libgcrypt 1.8.1 in my case (I think this was introduced in 1.7.4 but don't quote me on that).
It's neon/armv8 capabilities configuration is screwed up for armv7.

See https://archlinuxarm.org/packages/arm/li...s/PKGBUILD

This libgcrypt bug produces libgcrypt DSO built for V8 and anything linked with it by ldgold will inherit v8 tags.

I will have to wipe ccache and make a full build for pi2.
Will post if I find anything else.
Reply
#14
(2017-10-10, 19:52)asavah Wrote: >Using the kodi depends system?
Nope, I have my own homegrown os, my own bleeding edge toolchains and large etc.

Here, I've *been* building in a native raspbian 9.1 chroot.

atm, I'm attempting more or less a parallel your approach.

I've build up a gcc 7.2.0 cross toolchain for RPi2, on my opensuse linux64 instance, but when I use kodi's tools/depends to generate the Toolchain.cmake file, the configure's *missing* some-not-all of the toolchain bins.  Specifically, ld & g++ .  That makes me a bit suspicious about the "./configure" in general.

Here's what I see -> https://pastebin.com/thn3A1WN

Though you're not using the depends system for the build, are you using it for the Toolchain.cmake?  Or doing that manually?
Reply
#15
First check your libgcrypt.so.* with readelf.
If it has v8 tags - that's probably it.

I have everything done "manually", it's heavily scripted tho.
I was using crosstool-ng long time ago, but now I build everything myself

Make sure that your toolchain's ${CROSS_ROOT}/bin is on PATH

Here is my cmake toolchain 
Code:
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER armv7-rpi2-linux-gnueabihf-gcc)
SET(CMAKE_AR armv7-rpi2-linux-gnueabihf-gcc-ar CACHE FILEPATH "Archiver")
SET(CMAKE_RANLIB armv7-rpi2-linux-gnueabihf-gcc-ranlib)
SET(CMAKE_CXX_COMPILER armv7-rpi2-linux-gnueabihf-g++)
SET(CMAKE_ASM_COMPILER armv7-rpi2-linux-gnueabihf-gcc)
SET(CMAKE_SYSTEM_PROCESSOR arm)
SET(CMAKE_CROSSCOMPILING TRUE)

# rdynamic means the backtrace should work
IF (CMAKE_BUILD_TYPE MATCHES "Debug")
  add_definitions(-rdynamic)
ENDIF()

# avoids annoying and pointless warnings from gcc
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
SET(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -c")


SET(CMAKE_FIND_ROOT_PATH $ENV{ROOTFS})

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

if(NOT DEFINED ENV{CMAKE_NO_CCACHE})
       find_program(CCACHE_FOUND ccache)
       if(CCACHE_FOUND)
               set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
               if(NOT DEFINED ENV{CMAKE_NO_CCACHE_LINK})
                       set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
               endif()
       endif(CCACHE_FOUND)
endif()
Reply

Logout Mark Read Team Forum Stats Members Help
RPi2 build (-DCORE_PLATFORM_NAME=rbpi) results in bin w/ NEON extensions for ARMv*8*?0