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

Fail to build on arm64 #453

Closed
jerry-xie-000 opened this issue Oct 8, 2024 · 14 comments · May be fixed by #502
Closed

Fail to build on arm64 #453

jerry-xie-000 opened this issue Oct 8, 2024 · 14 comments · May be fixed by #502
Labels
bug Something isn't working needs info A bug report is waiting for more information

Comments

@jerry-xie-000
Copy link

Before posting the bug, take a look at the
FAQ
for a possible solution.

Required information

Operating system:

HOST: Linux UBUNTU2204_ROCKCHIP_DOCKER 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

TARGET: Linux rk3588 5.10.198 #206 SMP Thu Aug 29 06:05:00 UTC 2024 aarch64 GNU/Linux

Rust version:
rustc 1.81.0 (eeb90cda1 2024-09-04)

Cargo version:
cargo 1.81.0 (2dbb1af80 2024-08-20)

iceoryx2 version:
main branch

Observed result or behaviour:

workflow:

  1. init the arm64 environment
$ source /mnt/sda1/xzy/SDK_real/aarch64-buildroot-linux-gnu_sdk-buildroot-rockchip/environment-setup
 _           _ _     _                 _
| |__  _   _(_) | __| |_ __ ___   ___ | |_
| '_ \| | | | | |/ _` | '__/ _ \ / _ \| __|
| |_) | |_| | | | (_| | | | (_) | (_) | |_
|_.__/ \__,_|_|_|\__,_|_|  \___/ \___/ \__|

       Making embedded Linux easy!

Some tips:
* PATH now contains the SDK utilities
* Standard autotools variables (CC, LD, CFLAGS) are exported
* Kernel compilation variables (ARCH, CROSS_COMPILE, KERNELDIR) are exported
* To configure do "./configure $CONFIGURE_FLAGS" or use
  the "configure" alias
* To build CMake-based projects, use the "cmake" alias

  1. cmake
$ cmake -S . -B build -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../_OUTPUT
-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 12.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /mnt/sda1/xzy/SDK_real/aarch64-buildroot-linux-gnu_sdk-buildroot-rockchip/bin/aarch64-buildroot-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /mnt/sda1/xzy/SDK_real/aarch64-buildroot-linux-gnu_sdk-buildroot-rockchip/bin/aarch64-buildroot-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- iceoryx2 options:
--   BUILD_CXX_BINDING: ON (Description: Build C++ binding)
--   BUILD_EXAMPLES: ON (Description: Build examples)
--   BUILD_TESTING: OFF (Description: Build tests)
--   SANITIZERS: OFF (Description: Build with undefined-behavior- and address-sanitizer)
--   RUST_TARGET_TRIPLET:  (Description: The target triplet for cross compilation, e.g. 'aarch64-unknown-linux-gnu')
-- The package 'iceoryx2-c' is used in source code version.
-- iceoryx_hoofs not found! Using FetchContent!
-- [i] IOX_REPRODUCIBLE_BUILD: ON
-- [i] <<<<<<<<<<<<< Start iceoryx_platform configuration: >>>>>>>>>>>>>
-- [i] IOX_PLATFORM_TEMP_DIR: /tmp/
-- [i] IOX_PLATFORM_LOCK_FILE_PATH_PREFIX: /tmp/
-- [i] IOX_PLATFORM_UDS_SOCKET_PATH_PREFIX: /tmp/
-- [i] <<<<<<<<<<<<<< End iceoryx_platform configuration: >>>>>>>>>>>>>>
-- The package 'iceoryx_platform' is used in source code version.
-- [i] <<<<<<<<<<<<< Start iceoryx_hoofs configuration: >>>>>>>>>>>>>
-- [i] IOX_MINIMAL_LOG_LEVEL: TRACE
-- [i] IOX_MAX_NAMED_PIPE_MESSAGE_SIZE: 4096
-- [i] IOX_MAX_NAMED_PIPE_NUMBER_OF_MESSAGES: 10
-- [i] IOX_EXPERIMENTAL_POSH_FLAG:
-- [i] <<<<<<<<<<<<<< End iceoryx_hoofs configuration: >>>>>>>>>>>>>>
-- The package 'iceoryx_hoofs' is used in source code version.
CMake Warning at iceoryx2-ffi/cxx/cmake/fetch-iceoryx-hoofs.cmake:60 (message):
  #############################################################

  The project was build by obtaining iceoryx with FetchContent.

  This is fine for development but for production, it is

  recommended to use an existing installation with

  '-DCMAKE_PREFIX_PATH=/path/to/installed/iceoryx'!

  #############################################################

Call Stack (most recent call first):
  iceoryx2-ffi/cxx/CMakeLists.txt:16 (include)


-- The package 'iceoryx2-cxx' is used in source code version.
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/build

  1. make
$ make
   Compiling proc-macro2 v1.0.87
   Compiling unicode-ident v1.0.13
   Compiling serde v1.0.210
   Compiling libc v0.2.159
   Compiling rustix v0.38.37
   Compiling cfg-if v1.0.0
   Compiling memchr v2.7.4
   Compiling bitflags v2.6.0
   Compiling linux-raw-sys v0.4.14
   Compiling either v1.13.0
   Compiling glob v0.3.1
   Compiling log v0.4.22
   Compiling prettyplease v0.2.22
   Compiling minimal-lexical v0.2.1
   Compiling iceoryx2-pal-concurrency-sync v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-pal/concurrency-sync)
   Compiling regex-syntax v0.8.5
   Compiling home v0.5.9
   Compiling shlex v1.3.0
   Compiling bindgen v0.69.4
   Compiling lazy_static v1.5.0
   Compiling rustc-hash v1.1.0
   Compiling lazycell v1.3.0
   Compiling libloading v0.8.5
   Compiling iceoryx2-pal-configuration v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-pal/configuration)
   Compiling version_check v0.9.5
   Compiling heck v0.4.1
   Compiling iceoryx2-bb-elementary v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/elementary)
   Compiling cc v1.1.28
   Compiling autocfg v1.4.0
   Compiling tiny-fn v0.1.7
   Compiling syn v1.0.109
   Compiling hashbrown v0.15.0
   Compiling itertools v0.12.1
   Compiling yansi v1.0.1
   Compiling serde_json v1.0.128
   Compiling equivalent v1.0.1
   Compiling os_str_bytes v6.6.1
   Compiling hashbrown v0.12.3
   Compiling strsim v0.10.0
   Compiling fastrand v2.1.1
   Compiling itoa v1.0.11
   Compiling once_cell v1.20.2
   Compiling winnow v0.6.20
   Compiling clang-sys v1.8.1
   Compiling termcolor v1.4.1
   Compiling textwrap v0.16.1
   Compiling proc-macro2-diagnostics v0.10.1
   Compiling bitflags v1.3.2
   Compiling cbindgen v0.26.0
   Compiling ryu v1.0.18
   Compiling byteorder v1.5.0
   Compiling clap_lex v0.2.4
   Compiling aliasable v0.1.3
   Compiling nom v7.1.3
   Compiling static_assertions v1.1.0
   Compiling iceoryx2-bb-testing v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/testing)
   Compiling sha1_smol v1.0.1
   Compiling indexmap v1.9.3
   Compiling quote v1.0.37
   Compiling syn v2.0.79
   Compiling indexmap v2.6.0
   Compiling termsize v0.1.9
   Compiling atty v0.2.14
   Compiling iceoryx2-bb-log v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/log)
   Compiling iceoryx2-bb-lock-free v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/lock-free)
   Compiling clap v3.2.25
   Compiling regex-automata v0.4.8
   Compiling which v4.4.2
   Compiling tempfile v3.13.0
   Compiling cexpr v0.6.0
   Compiling regex v1.11.0
   Compiling serde_derive v1.0.210
   Compiling iceoryx2-bb-derive-macros v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/derive-macros)
   Compiling enum-iterator-derive v1.4.0
   Compiling ouroboros_macro v0.18.4
   Compiling iceoryx2-ffi-macros v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-ffi/ffi-macros)
   Compiling enum-iterator v2.1.0
   Compiling ouroboros v0.18.4
   Compiling iceoryx2-pal-posix v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-pal/posix)
   Compiling toml v0.5.11
   Compiling iceoryx2-bb-container v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/container)
   Compiling serde_spanned v0.6.8
   Compiling toml_datetime v0.6.8
   Compiling cdr v0.2.4
   Compiling toml_edit v0.22.22
   Compiling iceoryx2-bb-system-types v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/system-types)
   Compiling toml v0.8.19
The following warnings were emitted during compilation:

warning: [email protected]: aarch64-buildroot-linux-gnu-gcc.br_real: error: unrecognized command-line option ‘-m64’

error: failed to run custom build command for `iceoryx2-pal-posix v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-pal/posix)`

Caused by:
  process didn't exit successfully: `/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/build/rust/native/release/build/iceoryx2-pal-posix-bc9b3375cf6a096b/build-script-build` (exit status: 1)
  --- stdout
  cargo:rustc-link-lib=pthread
  cargo:rerun-if-changed=src/c/posix.h
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  cargo:rerun-if-changed=src/c/posix.h
  cargo:rerun-if-changed=/usr/include/mqueue.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/features-time64.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/timesize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/stdc-predef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/cdefs.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/long-double.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/gnu/stubs.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/gnu/stubs-64.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/types.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/timesize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/typesizes.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/time64.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/clock_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/time_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/timer_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/stdint-intn.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/endian.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/endian.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/endianness.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/byteswap.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/uintn-identity.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/select.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/select.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/time_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/endian.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/time_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/struct_mutex.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h
  cargo:rerun-if-changed=/usr/include/fcntl.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/fcntl.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/stat.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/struct_stat.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/mqueue.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/arpa/inet.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/netinet/in.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/socket.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/socket.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/socket_type.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sockaddr.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/time_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/asm/socket.h
  cargo:rerun-if-changed=/usr/include/asm-generic/socket.h
  cargo:rerun-if-changed=/usr/include/linux/posix_types.h
  cargo:rerun-if-changed=/usr/include/linux/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/asm/posix_types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/asm/posix_types_64.h
  cargo:rerun-if-changed=/usr/include/asm-generic/posix_types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/asm/bitsperlong.h
  cargo:rerun-if-changed=/usr/include/asm-generic/bitsperlong.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/asm/sockios.h
  cargo:rerun-if-changed=/usr/include/asm-generic/sockios.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_osockaddr.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/in.h
  cargo:rerun-if-changed=/usr/include/endian.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/byteswap.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/uintn-identity.h
  cargo:rerun-if-changed=/usr/include/dirent.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/dirent.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/posix1_lim.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/local_lim.h
  cargo:rerun-if-changed=/usr/include/linux/limits.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/pthread_stack_min.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/dirent_ext.h
  cargo:rerun-if-changed=/usr/include/grp.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/FILE.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/netinet/in.h
  cargo:rerun-if-changed=/usr/include/pthread.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/sched.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/time_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sched.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_sched_param.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/cpu-set.h
  cargo:rerun-if-changed=/usr/include/time.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/time.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/clock_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/time_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/timer_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/locale_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/endian.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/setjmp.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/setjmp.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h
  cargo:rerun-if-changed=/usr/include/pwd.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/FILE.h
  cargo:rerun-if-changed=/usr/include/sched.h
  cargo:rerun-if-changed=/usr/include/semaphore.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/semaphore.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/mman.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/mman.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/mman-map-flags-generic.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/mman-linux.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/mman-shared.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/resource.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/resource.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_rusage.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/select.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/socket.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/un.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/cdefs.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sockaddr.h
  cargo:rerun-if-changed=/usr/include/string.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/libc-header-start.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/locale_t.h
  cargo:rerun-if-changed=/usr/include/strings.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/locale_t.h
  cargo:rerun-if-changed=/usr/include/unistd.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/posix_opt.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/environments.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/confname.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/getopt_posix.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/getopt_core.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/unistd_ext.h
  cargo:rerun-if-changed=/usr/include/errno.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/errno.h
  cargo:rerun-if-changed=/usr/include/linux/errno.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/asm/errno.h
  cargo:rerun-if-changed=/usr/include/asm-generic/errno.h
  cargo:rerun-if-changed=/usr/include/asm-generic/errno-base.h
  cargo:rerun-if-changed=/usr/include/fcntl.h
  cargo:rerun-if-changed=/usr/include/signal.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/signum-generic.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/signum-arch.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/wordsize.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sigaction.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sigcontext.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/stack_t.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/ucontext.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/stack_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sigstack.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sigstksz.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/ss_flags.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/sigthread.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/signal_ext.h
  cargo:rerun-if-changed=/usr/include/stdio.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/libc-header-start.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdarg.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/__FILE.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/FILE.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/stdio_lim.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/floatn.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/floatn-common.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/long-double.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/floatn.h
  cargo:rerun-if-changed=/usr/include/stdlib.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/libc-header-start.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/waitflags.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/waitstatus.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/floatn.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/types.h
  cargo:rerun-if-changed=/usr/include/alloca.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/stdlib-float.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/floatn.h
  cargo:rerun-if-changed=/usr/include/string.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/stat.h
  cargo:rerun-if-changed=/usr/include/features.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/types/time_t.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/bits/stat.h
  cargo:rerun-if-changed=/usr/include/x86_64-linux-gnu/sys/types.h
  cargo:rerun-if-changed=/usr/include/time.h
  cargo:rerun-if-changed=src/c/sigaction.c
  OUT_DIR = Some(/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/build/rust/native/release/build/iceoryx2-pal-posix-1192dd49b9364f14/out)
  TARGET = Some(x86_64-unknown-linux-gnu)
  OPT_LEVEL = Some(3)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some(aarch64-buildroot-linux-gnu-gcc)
  cargo:rerun-if-env-changed=CC_KNOWN_WRAPPER_CUSTOM
  CC_KNOWN_WRAPPER_CUSTOM = None
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some(-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 -D_FORTIFY_SOURCE=1)
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:warning=aarch64-buildroot-linux-gnu-gcc.br_real: error: unrecognized command-line option ‘-m64’

  --- stderr


  error occurred: Command "aarch64-buildroot-linux-gnu-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-D_LARGEFILE_SOURCE" "-D_LARGEFILE64_SOURCE" "-D_FILE_OFFSET_BITS=64" "-Os" "-g0" "-D_FORTIFY_SOURCE=1" "-o" "/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/build/rust/native/release/build/iceoryx2-pal-posix-1192dd49b9364f14/out/9090567339c54aec-sigaction.o" "-c" "src/c/sigaction.c" with args aarch64-buildroot-linux-gnu-gcc did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
make[2]: *** [iceoryx2-ffi/c/CMakeFiles/iceoryx2-build-step.dir/build.make:70: iceoryx2-ffi/c/CMakeFiles/iceoryx2-build-step] Error 101
make[1]: *** [CMakeFiles/Makefile2:442: iceoryx2-ffi/c/CMakeFiles/iceoryx2-build-step.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

It seems need to remove the "-m64". How to remove it ?

@jerry-xie-000 jerry-xie-000 added the bug Something isn't working label Oct 8, 2024
@xieyuschen
Copy link
Contributor

Hi @jerry-xie-000 looks like you're going to cross-compile from arm to x86_64, but you use the compiler for aarch(arm).
I believe you have used a wrong compiler and you need to change to a right cross compiler. Can refer to this issue whether it's helpful: rust-lang/rust#119500

"g++-x86-64-linux-gnu" is the cross-compiler to x86_64 - so you want export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/x86_64-linux-gnu-gcc (rather than aarch64-linux-gnu-gcc)

@jerry-xie-000
Copy link
Author

It seems not suit to my question. I try to cross-compile from x86_64 to arm64. The host machine is x86_64 ubuntu 22.04, and need to cross-compile the source, and then run on arm64 linux.

@elBoberido
Copy link
Member

Cross compilation is not yet fully tested with the cmake build. There is an option to tell cmake the Rust target, though. Have you tried specifying RUST_TARGET_TRIPLET?

@jerry-xie-000
Copy link
Author

jerry-xie-000 commented Oct 10, 2024

I try to use RUST_TARGET_TRIPLET when cmake, but my cross-compiler is:

aarch64-buildroot-linux-gnu-addr2line           aarch64-buildroot-linux-gnu-gcc.br_real         aarch64-linux-ar                                aarch64-linux-gcov
aarch64-buildroot-linux-gnu-ar                  aarch64-buildroot-linux-gnu-gcov                aarch64-linux-as                                aarch64-linux-gcov-dump
aarch64-buildroot-linux-gnu-as                  aarch64-buildroot-linux-gnu-gcov-dump           aarch64-linux-c++                               aarch64-linux-gcov-tool
aarch64-buildroot-linux-gnu-c++                 aarch64-buildroot-linux-gnu-gcov-tool           aarch64-linux-c++.br_real                       aarch64-linux-gdb
aarch64-buildroot-linux-gnu-c++.br_real         aarch64-buildroot-linux-gnu-gdb                 aarch64-linux-c++filt                           aarch64-linux-gprof
aarch64-buildroot-linux-gnu-c++filt             aarch64-buildroot-linux-gnu-gdb-add-index       aarch64-linux-cc                                aarch64-linux-ld
aarch64-buildroot-linux-gnu-cc                  aarch64-buildroot-linux-gnu-gprof               aarch64-linux-cc.br_real                        aarch64-linux-ld.bfd
aarch64-buildroot-linux-gnu-cc.br_real          aarch64-buildroot-linux-gnu-ld                  aarch64-linux-cpp                               aarch64-linux-lto-dump
aarch64-buildroot-linux-gnu-cpp                 aarch64-buildroot-linux-gnu-ld.bfd              aarch64-linux-cpp.br_real                       aarch64-linux-nm
aarch64-buildroot-linux-gnu-cpp.br_real         aarch64-buildroot-linux-gnu-lto-dump            aarch64-linux-elfedit                           aarch64-linux-objcopy
aarch64-buildroot-linux-gnu-elfedit             aarch64-buildroot-linux-gnu-nm                  aarch64-linux-g++                               aarch64-linux-objdump
aarch64-buildroot-linux-gnu-g++                 aarch64-buildroot-linux-gnu-objcopy             aarch64-linux-g++.br_real                       aarch64-linux-ranlib
aarch64-buildroot-linux-gnu-g++.br_real         aarch64-buildroot-linux-gnu-objdump             aarch64-linux-gcc                               aarch64-linux-readelf
aarch64-buildroot-linux-gnu-gcc                 aarch64-buildroot-linux-gnu-ranlib              aarch64-linux-gcc-12.3.0                        aarch64-linux-size
aarch64-buildroot-linux-gnu-gcc-12.3.0          aarch64-buildroot-linux-gnu-readelf             aarch64-linux-gcc-12.3.0.br_real                aarch64-linux-strings
aarch64-buildroot-linux-gnu-gcc-12.3.0.br_real  aarch64-buildroot-linux-gnu-size                aarch64-linux-gcc-ar                            aarch64-linux-strip
aarch64-buildroot-linux-gnu-gcc-ar              aarch64-buildroot-linux-gnu-strings             aarch64-linux-gcc-nm                            
aarch64-buildroot-linux-gnu-gcc-nm              aarch64-buildroot-linux-gnu-strip               aarch64-linux-gcc-ranlib                        
aarch64-buildroot-linux-gnu-gcc-ranlib          aarch64-linux-addr2line                         aarch64-linux-gcc.br_real         

Not in the support list by rustc --print target-list.:

$ rustc --print target-list
aarch64-apple-darwin
aarch64-apple-ios
aarch64-apple-ios-macabi
aarch64-apple-ios-sim
aarch64-apple-tvos
aarch64-apple-tvos-sim
aarch64-apple-visionos
aarch64-apple-visionos-sim
aarch64-apple-watchos
aarch64-apple-watchos-sim
aarch64-fuchsia
aarch64-kmc-solid_asp3
aarch64-linux-android
aarch64-nintendo-switch-freestanding
aarch64-pc-windows-gnullvm
aarch64-pc-windows-msvc
aarch64-unknown-freebsd
aarch64-unknown-fuchsia
aarch64-unknown-hermit
aarch64-unknown-illumos
aarch64-unknown-linux-gnu
aarch64-unknown-linux-gnu_ilp32
aarch64-unknown-linux-musl
aarch64-unknown-linux-ohos
aarch64-unknown-netbsd
aarch64-unknown-none
aarch64-unknown-none-softfloat
aarch64-unknown-nto-qnx710
aarch64-unknown-openbsd
aarch64-unknown-redox
aarch64-unknown-teeos
aarch64-unknown-uefi
aarch64-uwp-windows-msvc
aarch64-wrs-vxworks
aarch64_be-unknown-linux-gnu
aarch64_be-unknown-linux-gnu_ilp32
aarch64_be-unknown-netbsd
arm-linux-androideabi

How to add aarch64-buildroot-linux-gnu into the target-list?

@elfenpiff
Copy link
Contributor

@jerry-xie-000 From here: https://rust-lang.github.io/rustup/cross-compilation.html

Try out: rustup target add aarch64-buildroot-linux-gnu

@jerry-xie-000
Copy link
Author

@jerry-xie-000 From here: https://rust-lang.github.io/rustup/cross-compilation.html

Try out: rustup target add aarch64-buildroot-linux-gnu

Not support:

$ rustup target add aarch64-buildroot-linux-gnu
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not support target 'aarch64-buildroot-linux-gnu'
note: you can see a list of supported targets with `rustc --print=target-list`
note: if you are adding support for a new target to rustc itself, see https://rustc-dev-guide.rust-lang.org/building/new-target.html

@elBoberido
Copy link
Member

@jerry-xie-000 I think aarch64-unknown-linux-gnu should work for you. Can you try that. It just passes that to rustc. There might be other issues though.

@elBoberido elBoberido added the needs info A bug report is waiting for more information label Oct 29, 2024
@elBoberido
Copy link
Member

@jerry-xie-000 did you have time to try my suggestion from above?

@jerry-xie-000
Copy link
Author

jerry-xie-000 commented Oct 30, 2024

Try it, and meet another problem:

   Compiling atty v0.2.14
   Compiling iceoryx2-bb-log v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/log)
   Compiling indexmap v2.6.0
   Compiling iceoryx2-bb-lock-free v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/lock-free)
   Compiling clap v3.2.25
   Compiling regex-automata v0.4.8
   Compiling cexpr v0.6.0
   Compiling which v4.4.2
   Compiling tempfile v3.13.0
   Compiling regex v1.11.0
   Compiling serde_derive v1.0.210
   Compiling iceoryx2-bb-derive-macros v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/derive-macros)
   Compiling enum-iterator-derive v1.4.0
   Compiling ouroboros_macro v0.18.4
   Compiling iceoryx2-ffi-macros v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-ffi/ffi-macros)
   Compiling enum-iterator v2.1.0
   Compiling ouroboros v0.18.4
   Compiling iceoryx2-pal-posix v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-pal/posix)
   Compiling toml v0.5.11
   Compiling iceoryx2-bb-container v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/container)
   Compiling toml_datetime v0.6.8
   Compiling serde_spanned v0.6.8
   Compiling cdr v0.2.4
   Compiling toml_edit v0.22.22
   Compiling iceoryx2-bb-system-types v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-bb/system-types)
error: failed to run custom build command for `iceoryx2-pal-posix v0.4.1 (/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/iceoryx2-pal/posix)`

Caused by:
  process didn't exit successfully: `/mnt/sda1/xzy/Workspace/device_controller/third_party/iceoryx2/target/ffi/build/rust/release/build/iceoryx2-pal-posix-bc9b3375cf6a096b/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-lib=pthread
  cargo:rerun-if-changed=src/c/posix.h
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  cargo:rerun-if-changed=src/c/posix.h

  --- stderr
  /usr/include/features-time64.h:20:10: fatal error: 'bits/wordsize.h' file not found
  thread 'main' panicked at iceoryx2-pal/posix/build.rs:46:18:
  Unable to generate bindings: ClangDiagnostic("/usr/include/features-time64.h:20:10: fatal error: 'bits/wordsize.h' file not found\n")
  stack backtrace:
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
make[2]: *** [iceoryx2-ffi/c/CMakeFiles/iceoryx2-build-step.dir/build.make:70: iceoryx2-ffi/c/CMakeFiles/iceoryx2-build-step] Error 101
make[1]: *** [CMakeFiles/Makefile2:442: iceoryx2-ffi/c/CMakeFiles/iceoryx2-build-step.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I haven't build the rust for arm before, so I have no idea how to fix these errors. It seems rust doesn't find 'bits/wordsize.h' in the arm64 sysroot path. My arm64 sysroot path does include this file.

@elBoberido
Copy link
Member

@jerry-xie-000 can you try using the BINDGEN_EXTRA_CLANG_ARGS env var to point to your sysroot? See also https://docs.rs/bindgen/latest/bindgen/struct.Builder.html#clang-arguments

@jerry-xie-000
Copy link
Author

Great, it build successfully after I set the export BINDGEN_EXTRA_CLANG_ARGS=--sysroot=/path/to/sysroot.

Another small issue, when I run make install, it only copy libiceoryx2_cxx.so、libiceoryx2_ffi.so to the install folder. But when I run the example, it need libiceoryx_platform.so and libiceoryx_hoofs.so, these libs are left in build\_deps\iceoryx-build\iceoryx_platform, so I need to copy them by myself.

@orecham
Copy link
Contributor

orecham commented Nov 1, 2024

@jerry-xie-000

You can incorporate the build and install of these components into your build system separately using these instructions: https://github.com/eclipse-iceoryx/iceoryx2/tree/main/iceoryx2-ffi/cxx

@elBoberido
Copy link
Member

@jerry-xie-000 could you please compile all the steps you did to make cross-compilation work with buildroot and put it under doc/cross-compile/buildroot.md?

@jerry-xie-000
Copy link
Author

Ok. I create pr: #502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs info A bug report is waiting for more information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants