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

Lite Rt Build Cross Compile Toolchain version incompatible #438

Open
pkgoogle opened this issue Jan 8, 2025 · 2 comments
Open

Lite Rt Build Cross Compile Toolchain version incompatible #438

pkgoogle opened this issue Jan 8, 2025 · 2 comments
Assignees
Labels
status:awaiting LiteRTer information is sufficient and the issue is escalated type:bug Bug type:build/install For build or installation issues

Comments

@pkgoogle
Copy link

pkgoogle commented Jan 8, 2025

Original Issue: tensorflow/tensorflow#82920
Original Author: @YigitKaanBingol

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

2.18

Custom code

No

OS platform and distribution

Linux Ubuntu 22.04

Mobile device

No response

Python version

No response

Bazel version

No response

GCC/compiler version

8.3.0

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I am trying to build with cross compile for armv6 raspberry pi 0. In the instruction of the cross compile lite rt, given toolchain link is not compatible with armv6, its not even running simple cross compiled hello_world.cpp, When we check the attributes of file, the arch of toolchain is armv7, but raspberry pi zero's arch is armv6.

Standalone code to reproduce the issue

#In the host computer:
 ~/toolchains/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ hello.cpp -march=armv6 -mfpu=vfp -mfloat-abi=hard -funsafe-math-optimizations  -o hello 

#Raspberry Pi Zero:
./hello

readelf -A hello

Relevant log output

Raspberry Pi Zero output:
Illegal instruction

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_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6
@pkgoogle pkgoogle self-assigned this Feb 28, 2025
@pkgoogle
Copy link
Author

I was able to reproduce, here's my hello.cpp:

#include <iostream>

int main() {
  std::cout << "Hello, World!" << std::endl;
  return 0;
}
$ readelf -A hello
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_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6

@pkgoogle pkgoogle added type:bug Bug type:build/install For build or installation issues status:awaiting LiteRTer information is sufficient and the issue is escalated labels Feb 28, 2025
@YigitKaanBingol
Copy link

This is compiled on the host computer with a cross-compile toolchain as described in the LiteRt instruction document and run on a Raspberry Pi Zero. Did I understand correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting LiteRTer information is sufficient and the issue is escalated type:bug Bug type:build/install For build or installation issues
Projects
None yet
Development

No branches or pull requests

2 participants