project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.49k stars 2.01k forks source link

[BUG] [chip-tool] cannot build for armhf (32bit ARM) #26466

Closed mmt-10 closed 1 year ago

mmt-10 commented 1 year ago

Reproduction steps

I tried cross build for armhf on Ubuntu 22.04 x86_64.

As a prerequisite, I added ports.ubuntu.com to /etc/apt/sources.list.d/ports_armhf.list.

$ sudo dpkg --add-architecture armhf
$ sudo apt update
$ sudo apt install crossbuild-essential-armhf
$ sudo apt install libssl-dev:armhf
$ sudo apt install libglib2.0-dev:armhf
$ cd ${MATTER_SDK}
$ source scripts/activate.sh
$ cd examples/chip-tool
$ gn gen out/debug --args='target_os="linux" target_cpu="arm"'
$ ninja -C out/debug

LOG chip-tool-armhf-build.log

/usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h

I set target_cpu="arm", but ninja accessed x86_64-linux-gnu directory.

and it maybe root cause is 64bit variable.

Can I resolve it?

Bug prevalence

always

GitHub hash of the SDK that was being used

commit 4088a77f557e8571a39338fad51a1d8eb0131d79 (HEAD, tag: v1.0.0.2)

Platform

other

Platform Version(s)

No response

Anything else?

Host OS : Ubuntu 22.04

mmt-10 commented 1 year ago

resolve it

$ export PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig"
bzbarsky-apple commented 1 year ago

Right, the glib path comes from pkg-config, and that will do what you tell it to do....

xlfdan commented 1 year ago

@mmt-10 , can you show the full content of ports_armhf.list and sources.list files? Thank you very much.

mmt-10 commented 1 year ago

I'm sorry, I had vacation.

Please refer to below quote. ports_armhf.list is here.

However, I gave up on cross-build. because, I cannot resolve the library(glibc3.0 and etc) dependencies for the target board. If you can resolve the library dependencies, please let me know.

deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse

deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse

deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse

deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse