Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolchain updates for flight pro 8096 kyro cross compilation #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

plusk01
Copy link

@plusk01 plusk01 commented Jul 17, 2019

These changes allow the linux_app.cmake macros to correctly build binaries and shared objects. The preconditions for using this toolchain with the sfpro is that the Intrinsyc instructions for setting up the cross-compilation environment and the DSPAL/SLPI dev env have been completed.

Note: by removing the search path to sdsprpc.so (${HEXAGON_SDK_ROOT}/${SDKLIB}/common/remote/ship/UbuntuARM_${RELEASE}), we allow the linker to find the correct sdsprpc.so (correct in the sense that it is a soft-float abi). Without this change, the following error about VFP register arguments occurs:

/home/dspal/Qualcomm/cross_compiler/sysroots/x86_64-oesdk-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.3/real-ld: error: \
/home/dspal/Qualcomm/Hexagon_SDK/3.1/libs/common/remote/ship/UbuntuARM_Debug/libsdsprpc.so uses VFP register arguments, output does not

The linker is complaining that the compiler being used (from the Intrinsyc cross-compiler toolchain) does not have a hard-float abi, but the sdsprpc.so in the Hexagon SDK does [1]. This is verified using readelf -A libsdsprpc.so:

$ readelf -A Qualcomm/Hexagon_SDK/3.1/libs/common/remote/ship/UbuntuARM_Debug/libadsprpc.so 
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  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_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: Deprecated
  Tag_ABI_VFP_args: VFP registers                  # <--- indicates hard-float abi
  Tag_ABI_optimization_goals: Aggressive Debug
  Tag_CPU_unaligned_access: v6

However, when we check the lib in the target sysroot:

$ readelf -A Qualcomm/cross_compiler/sysroots/aarch64-oe-linux/usr/lib/libsdsprpc.so
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  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_HardFP_use: Deprecated
  Tag_CPU_unaligned_access: v6

That line is not present because a soft-float abi is being used.

It seems that using the qurt_bundle CMake macro does not expose this problem because of the add_custom_target stanza:

add_custom_target(${QURT_BUNDLE_APP_NAME}_app ALL
    COMMAND ${QURT_BUNDLE_APPS_COMPILER}  ${${QURT_BUNDLE_APP_NAME}_INCLUDE_DIRS} ${QAIC_INCLUDE_DIRS} -o ${CMAKE_CURRENT_BINARY_DIR}/${QURT_BUNDLE_APP_NAME} ${QURT_BUNDLE_APPS_SOURCES} ${HEXAGON_SDK_ROOT}/${SDKLIB}/common/rpcmem/src/rpcmem.c "${CMAKE_CURRENT_BINARY_DIR}/${QURT_BUNDLE_IDL_NAME}_stub.c" ${FASTRPC_ARM_LIBS}
    DEPENDS generate_${QURT_BUNDLE_IDL_NAME}_stubs
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

where APPS_COMPILER tends to be passed in as Qualcomm/ARM_Tools/gcc-4.9-2014.11/bin/arm-linux-gnueabihf-gcc, which has a hard-float abi [2].


[1]: This is likely related to the fact that Snapdragon 820 has a Kyro CPU, based on ARMv8-A (64 bit), but for some reason the yocto linux shipped is 32-bit.
[2]: Maybe this is actually itself a problem? Why do we have both soft-float and hard-float abi compilers? Why is the shipped OS 32-bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant